Skip to content

Commit 75abb66

Browse files
committed
Prevent flash of login
1 parent 472e053 commit 75abb66

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

res/layout/login.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@
66
android:padding="10sp">
77

88
<TextView
9-
android:id="@+id/textView"
9+
android:id="@+id/loginDesc"
1010
android:layout_width="match_parent"
1111
android:layout_height="wrap_content"
1212
android:paddingBottom="20sp"
1313
android:text="Google Play Games is used for storing the save games, so that you can continue your progress on any device. Click the button below to log in."
14+
android:visibility="gone"
1415
android:textSize="20sp" />
1516

1617
<Button
1718
android:id="@+id/loginButton"
1819
android:layout_width="match_parent"
1920
android:layout_height="wrap_content"
2021
android:text="Login"
22+
android:visibility="gone"
2123
android:textSize="20sp" />
2224

2325
<TextView

src/org/ancurio/mkxp/LoginActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ protected void onCreate(Bundle savedInstanceState) {
2020

2121
if (this.isObbMissing()) {
2222
findViewById(R.id.obbMissing).setVisibility(View.VISIBLE);
23-
findViewById(R.id.loginButton).setVisibility(View.GONE);
2423

2524
return;
2625
}
@@ -49,6 +48,8 @@ protected void authCompleteListener(com.google.android.gms.tasks.Task<com.google
4948
startActivity(intent);
5049
finish();
5150
} else {
51+
findViewById(R.id.loginButton).setVisibility(View.VISIBLE);
52+
findViewById(R.id.loginDesc).setVisibility(View.VISIBLE);
5253
Toast.makeText(this, "Not signed in to Google Play Games", Toast.LENGTH_SHORT).show();
5354
}
5455
}

0 commit comments

Comments
 (0)