基本上,当用户按下登录按钮并在Google完成登录过程之前,Android谷歌登录会闪烁一个小的空白白框。这一切发生得非常快,但我想摆脱这个白框。我认为这个白框是显示进度条的失败尝试。
编辑:添加了一个图形重现正在发生的事情...
我正在三星Tab 3上测试。
此问题不包括用户第一次登录或访问权限被吊销后登录的情况。
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.requestIdToken(getString(R.string.google_server_client_id))
.build();
// google login stuff
googlebutton = (com.google.android.gms.common.SignInButton) findViewById(R.id.googlebutton);
googlebutton.setOnClickListener(this);
googlebutton.setStyle(SignInButton.SIZE_STANDARD, SignInButton.COLOR_LIGHT);
// Build GoogleApiClient with access to basic profile
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.build();
并且登录功能...
private void gSignIn() {
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
startActivityForResult(signInIntent, RC_SIGN_IN);
}
理想情况下,我希望恢复正常的进度条行为。这是我的Gradle...
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.0'
defaultConfig {
applicationId "xxxxxxxxx"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
//compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.android.support:design:23.0.1'
}