@@ -54,12 +54,7 @@ public void onCancel(DialogInterface dialog) {
54
54
});
55
55
56
56
if (isPlayServicesAvailable ) {
57
- final FlowParameters flowParams = mActivityHelper .getFlowParams ();
58
- if (flowParams .isReauth ) {
59
- showReauthDialog ();
60
- } else {
61
- SignInDelegate .delegate (this , flowParams );
62
- }
57
+ start ();
63
58
} else {
64
59
mIsWaitingForPlayServices = true ;
65
60
}
@@ -79,7 +74,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
79
74
super .onActivityResult (requestCode , resultCode , data );
80
75
if (requestCode == RC_PLAY_SERVICES ) {
81
76
if (resultCode == ResultCodes .OK ) {
82
- SignInDelegate . delegate ( this , mActivityHelper . getFlowParams () );
77
+ start ( );
83
78
} else {
84
79
finish (ResultCodes .CANCELED ,
85
80
IdpResponse .getErrorCodeIntent (ErrorCodes .UNKNOWN_ERROR ));
@@ -90,23 +85,18 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
90
85
}
91
86
}
92
87
93
- /**
94
- * Check if there is an active or soon-to-be-active network connection.
95
- *
96
- * @return true if there is no network connection, false otherwise.
97
- */
98
- private boolean isOffline () {
99
- ConnectivityManager manager =
100
- (ConnectivityManager ) getSystemService (Context .CONNECTIVITY_SERVICE );
101
-
102
- return !(manager != null
103
- && manager .getActiveNetworkInfo () != null
104
- && manager .getActiveNetworkInfo ().isConnectedOrConnecting ());
88
+ private void start () {
89
+ FlowParameters flowParams = mActivityHelper .getFlowParams ();
90
+ if (flowParams .isReauth ) {
91
+ showReauthDialog ();
92
+ } else {
93
+ SignInDelegate .delegate (this , flowParams );
94
+ }
105
95
}
106
96
107
97
private void showReauthDialog () {
108
98
final FlowParameters flowParams = mActivityHelper .getFlowParams ();
109
- AlertDialog .Builder builder = new AlertDialog .Builder (this , R . style . FirebaseUI_Dialog )
99
+ AlertDialog .Builder builder = new AlertDialog .Builder (this )
110
100
.setTitle (R .string .reauth_dialog_title )
111
101
.setOnCancelListener (new DialogInterface .OnCancelListener () {
112
102
@ Override
@@ -133,4 +123,18 @@ public void onClick(DialogInterface dialog, int which) {
133
123
134
124
builder .create ().show ();
135
125
}
126
+
127
+ /**
128
+ * Check if there is an active or soon-to-be-active network connection.
129
+ *
130
+ * @return true if there is no network connection, false otherwise.
131
+ */
132
+ private boolean isOffline () {
133
+ ConnectivityManager manager =
134
+ (ConnectivityManager ) getSystemService (Context .CONNECTIVITY_SERVICE );
135
+
136
+ return !(manager != null
137
+ && manager .getActiveNetworkInfo () != null
138
+ && manager .getActiveNetworkInfo ().isConnectedOrConnecting ());
139
+ }
136
140
}
0 commit comments