@@ -137,6 +137,12 @@ public class AuthUiActivity extends AppCompatActivity {
137137 @ BindView (R .id .google_scope_youtube_data )
138138 CheckBox mGoogleScopeYoutubeData ;
139139
140+ public static Intent createIntent (Context context ) {
141+ Intent in = new Intent ();
142+ in .setClass (context , AuthUiActivity .class );
143+ return in ;
144+ }
145+
140146 @ Override
141147 public void onCreate (Bundle savedInstanceState ) {
142148 super .onCreate (savedInstanceState );
@@ -150,7 +156,7 @@ public void onCreate(Bundle savedInstanceState) {
150156 return ;
151157 }
152158
153- if (! isGoogleConfigured ()) {
159+ if (isGoogleMisconfigured ()) {
154160 mUseGoogleProvider .setChecked (false );
155161 mUseGoogleProvider .setEnabled (false );
156162 mUseGoogleProvider .setText (R .string .google_label_missing_config );
@@ -165,7 +171,7 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
165171 });
166172 }
167173
168- if (! isFacebookConfigured ()) {
174+ if (isFacebookMisconfigured ()) {
169175 mUseFacebookProvider .setChecked (false );
170176 mUseFacebookProvider .setEnabled (false );
171177 mUseFacebookProvider .setText (R .string .facebook_label_missing_config );
@@ -180,13 +186,13 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
180186 });
181187 }
182188
183- if (! isTwitterConfigured ()) {
189+ if (isTwitterMisconfigured ()) {
184190 mUseTwitterProvider .setChecked (false );
185191 mUseTwitterProvider .setEnabled (false );
186192 mUseTwitterProvider .setText (R .string .twitter_label_missing_config );
187193 }
188194
189- if (! isGoogleConfigured () || ! isFacebookConfigured () || ! isTwitterConfigured ()) {
195+ if (isGoogleMisconfigured () || isFacebookMisconfigured () || isTwitterMisconfigured ()) {
190196 showSnackbar (R .string .configuration_required );
191197 }
192198 }
@@ -359,25 +365,23 @@ private String getSelectedPrivacyPolicyUrl() {
359365 }
360366
361367 @ MainThread
362- private boolean isGoogleConfigured () {
363- return !UNCHANGED_CONFIG_VALUE .equals (
364- getString (R .string .default_web_client_id ));
368+ private boolean isGoogleMisconfigured () {
369+ return UNCHANGED_CONFIG_VALUE .equals (getString (R .string .default_web_client_id ));
365370 }
366371
367372 @ MainThread
368- private boolean isFacebookConfigured () {
369- return !UNCHANGED_CONFIG_VALUE .equals (
370- getString (R .string .facebook_application_id ));
373+ private boolean isFacebookMisconfigured () {
374+ return UNCHANGED_CONFIG_VALUE .equals (getString (R .string .facebook_application_id ));
371375 }
372376
373377 @ MainThread
374- private boolean isTwitterConfigured () {
378+ private boolean isTwitterMisconfigured () {
375379 List <String > twitterConfigs = Arrays .asList (
376380 getString (R .string .twitter_consumer_key ),
377381 getString (R .string .twitter_consumer_secret )
378382 );
379383
380- return ! twitterConfigs .contains (UNCHANGED_CONFIG_VALUE );
384+ return twitterConfigs .contains (UNCHANGED_CONFIG_VALUE );
381385 }
382386
383387 @ MainThread
@@ -408,10 +412,4 @@ private List<String> getGooglePermissions() {
408412 }
409413 return result ;
410414 }
411-
412- public static Intent createIntent (Context context ) {
413- Intent in = new Intent ();
414- in .setClass (context , AuthUiActivity .class );
415- return in ;
416- }
417415}
0 commit comments