Skip to content

Commit 94b5f5a

Browse files
author
Aaron Mandle
committed
Add loading dialogs when signing in
Change-Id: I0851464664a826cbd6732e4268f9d0c9f17cdcc8
1 parent bf9ef29 commit 94b5f5a

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

auth/src/main/java/com/firebase/ui/auth/ui/account_link/WelcomeBackIDPPrompt.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ protected void onCreate(Bundle savedInstanceState) {
9999
findViewById(R.id.welcome_back_idp_button).setOnClickListener(new View.OnClickListener() {
100100
@Override
101101
public void onClick(View view) {
102+
mActivityHelper.showLoadingDialog(R.string.progress_dialog_signing_in);
102103
mIdpProvider.startLogin(WelcomeBackIDPPrompt.this, getEmailFromIntent());
103104
}
104105
});
@@ -167,12 +168,14 @@ public void onComplete(@NonNull Task<AuthResult> task) {
167168
new OnCompleteListener<AuthResult>() {
168169
@Override
169170
public void onComplete(@NonNull Task<AuthResult> task) {
171+
mActivityHelper.dismissDialog();
170172
finish(Activity.RESULT_OK, new Intent());
171173

172174
}
173175
}
174176
);
175177
} else {
178+
mActivityHelper.dismissDialog();
176179
finish(Activity.RESULT_OK, new Intent());
177180
}
178181
}
@@ -183,6 +186,7 @@ public void onComplete(@NonNull Task<AuthResult> task) {
183186
authResultTask.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
184187
@Override
185188
public void onComplete(@NonNull Task<AuthResult> task) {
189+
mActivityHelper.dismissDialog();
186190
finish(Activity.RESULT_OK, new Intent());
187191
}
188192
});

auth/src/main/java/com/firebase/ui/auth/ui/account_link/WelcomeBackPasswordPrompt.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ protected void onCreate(Bundle savedInstanceState) {
8484
public void onClick(View view) {
8585
int id = view.getId();
8686
if (id == R.id.button_done) {
87+
mActivityHelper.showLoadingDialog(R.string.progress_dialog_signing_in);
8788
next(mEmail, mPasswordField.getText().toString());
8889
} else if (id == R.id.trouble_signing_in) {
90+
mActivityHelper.dismissDialog();
8991
startActivity(RecoverPasswordActivity.createIntent(
9092
getApplicationContext(),
9193
mActivityHelper.flowParams,
@@ -124,7 +126,7 @@ public void onComplete(@NonNull Task<AuthResult> task) {
124126
if (photoUri != null) {
125127
photoUrl = photoUri.toString();
126128
}
127-
129+
mActivityHelper.dismissDialog();
128130
startActivityForResult(
129131
SaveCredentialsActivity.createIntent(
130132
mActivityHelper.getApplicationContext(),

auth/src/main/java/com/firebase/ui/auth/ui/idp/AuthMethodPickerActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ private void populateIdpList(List<IDPProviderParcel> providers) {
115115
loginButton.setOnClickListener(new View.OnClickListener() {
116116
@Override
117117
public void onClick(View view) {
118+
mActivityHelper.showLoadingDialog(R.string.progress_dialog_loading);
118119
provider.startLogin(AuthMethodPickerActivity.this, null);
119120
}
120121
});
@@ -163,6 +164,7 @@ public void onComplete(
163164
@NonNull Task<ProviderQueryResult> task) {
164165
String provider = task.getResult().getProviders().get(0);
165166
if (provider.equals(EmailAuthProvider.PROVIDER_ID)) {
167+
mActivityHelper.dismissDialog();
166168
startActivityForResult(
167169
WelcomeBackPasswordPrompt.createIntent(
168170
mActivityHelper.getApplicationContext(),
@@ -171,6 +173,7 @@ public void onComplete(
171173
), RC_WELCOME_BACK_IDP);
172174

173175
} else {
176+
mActivityHelper.dismissDialog();
174177
startActivityForResult(
175178
WelcomeBackIDPPrompt.createIntent(
176179
mActivityHelper.getApplicationContext(),
@@ -190,6 +193,7 @@ public void onComplete(
190193
if (photoUri != null) {
191194
photoUrl = photoUri.toString();
192195
}
196+
mActivityHelper.dismissDialog();
193197
startActivityForResult(SaveCredentialsActivity.createIntent(
194198
mActivityHelper.getApplicationContext(),
195199
mActivityHelper.flowParams,

0 commit comments

Comments
 (0)