谷歌的改变打法服务AccountPicker对话框 [英] Change style of Google Play Services AccountPicker dialog
本文介绍了谷歌的改变打法服务AccountPicker对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我显示从谷歌AccountPicker对话框播放服务与此code:
I am showing the AccountPicker dialog from Google Play Services with this code:
String[] accountTypes = new String[]{"com.google"};
Intent intent = AccountPicker.newChooseAccountIntent(null, null,
accountTypes, false, null, null, null, null);
startActivityForResult(intent, REQUEST_CODE_PICK_ACCOUNT);
它显示为,即使我使用的应用程序兼容性V21与Theme.AppCompat.Light深色主题的对话。
It appears as a dark themed dialog even though I am using AppCompat v21 with Theme.AppCompat.Light.
是否有可能样式对话框? preferably作为一个棒棒糖材料对话框,但至少使一个光对话,以配合我的应用程序
Is it possible to style the dialog? Preferably as a Material dialog on Lollipop but at least make it a light dialog to match my app
推荐答案
我认为,没有必要为黑客。它可以实现更容易:
I think, no need to "hack". It can be achieved easier:
...
String[] accountTypes = new String[]{GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE};
Intent intent = AccountPicker.newChooseAccountIntent(null, null, accountTypes, false, description, null, null, null);
// set the style
if ( isItDarkTheme ) {
intent.putExtra("overrideTheme", 0);
} else {
intent.putExtra("overrideTheme", 1);
}
intent.putExtra("overrideCustomTheme", 0);
try {
startActivityForResult(intent, YOUR_REQUEST_CODE_PICK_ACCOUNT);
} catch (ActivityNotFoundException e) {
...
}
...
这篇关于谷歌的改变打法服务AccountPicker对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文