Skip to content

Commit f34f5ab

Browse files
SUPERCILEXsamtstern
authored andcommitted
Style refactor (#784)
1 parent 41970bc commit f34f5ab

File tree

69 files changed

+549
-681
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+549
-681
lines changed

.idea/codeStyleSettings.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/AndroidManifest.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,48 @@
44
xmlns:tools="http://schemas.android.com/tools"
55
package="com.firebase.uidemo">
66

7-
<uses-permission android:name="android.permission.INTERNET"/>
8-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
7+
<uses-permission android:name="android.permission.INTERNET" />
8+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
99

1010
<application
1111
android:name=".auth.FirebaseUIDemo"
12+
android:label="@string/app_name"
1213
android:allowBackup="true"
1314
android:fullBackupContent="true"
1415
android:icon="@mipmap/ic_launcher"
15-
android:label="@string/app_name"
16-
android:theme="@style/AppTheme"
1716
android:supportsRtl="false"
17+
android:theme="@style/AppTheme"
1818
tools:ignore="GoogleAppIndexingWarning">
1919
<activity android:name=".ChooserActivity">
2020
<intent-filter>
21-
<action android:name="android.intent.action.MAIN"/>
22-
<category android:name="android.intent.category.LAUNCHER"/>
21+
<action android:name="android.intent.action.MAIN" />
22+
<category android:name="android.intent.category.LAUNCHER" />
2323
</intent-filter>
2424
<meta-data
2525
android:name="android.app.shortcuts"
26-
android:resource="@xml/shortcuts"/>
26+
android:resource="@xml/shortcuts" />
2727
</activity>
2828

2929
<!-- Chat demo -->
3030
<activity
3131
android:name=".database.ChatActivity"
32-
android:label="@string/name_chat"/>
32+
android:label="@string/name_chat" />
3333
<activity
3434
android:name=".database.ChatIndexActivity"
35-
android:label="@string/name_chat"/>
35+
android:label="@string/name_chat" />
3636

3737
<!-- Auth UI demo -->
3838
<activity
3939
android:name=".auth.AuthUiActivity"
40-
android:label="@string/name_auth_ui"/>
40+
android:label="@string/name_auth_ui" />
4141
<activity
4242
android:name=".auth.SignedInActivity"
43-
android:label="@string/name_auth_ui"/>
43+
android:label="@string/name_auth_ui" />
4444

4545
<!-- Storage UI demo-->
4646
<activity
4747
android:name=".storage.ImageActivity"
48-
android:label="@string/name_image"/>
48+
android:label="@string/name_image" />
4949
</application>
5050

5151
</manifest>

app/src/main/java/com/firebase/uidemo/auth/AuthUiActivity.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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);
@@ -408,10 +414,4 @@ private List<String> getGooglePermissions() {
408414
}
409415
return result;
410416
}
411-
412-
public static Intent createIntent(Context context) {
413-
Intent in = new Intent();
414-
in.setClass(context, AuthUiActivity.class);
415-
return in;
416-
}
417417
}

app/src/main/java/com/firebase/uidemo/auth/SignedInActivity.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ public class SignedInActivity extends AppCompatActivity {
7979

8080
private SignedInConfig mSignedInConfig;
8181

82+
public static Intent createIntent(
83+
Context context,
84+
IdpResponse idpResponse,
85+
SignedInConfig signedInConfig) {
86+
Intent startIntent = idpResponse == null ? new Intent() : idpResponse.toIntent();
87+
88+
return startIntent.setClass(context, SignedInActivity.class)
89+
.putExtra(EXTRA_SIGNED_IN_CONFIG, signedInConfig);
90+
}
91+
8292
@Override
8393
public void onCreate(Bundle savedInstanceState) {
8494
super.onCreate(savedInstanceState);
@@ -220,8 +230,7 @@ private void populateIdpToken() {
220230

221231
@MainThread
222232
private void showSnackbar(@StringRes int errorMessageRes) {
223-
Snackbar.make(mRootView, errorMessageRes, Snackbar.LENGTH_LONG)
224-
.show();
233+
Snackbar.make(mRootView, errorMessageRes, Snackbar.LENGTH_LONG).show();
225234
}
226235

227236
static final class SignedInConfig implements Parcelable {
@@ -283,14 +292,4 @@ public void writeToParcel(Parcel dest, int flags) {
283292
dest.writeInt(isHintSelectorEnabled ? 1 : 0);
284293
}
285294
}
286-
287-
public static Intent createIntent(
288-
Context context,
289-
IdpResponse idpResponse,
290-
SignedInConfig signedInConfig) {
291-
Intent startIntent = idpResponse == null ? new Intent() : idpResponse.toIntent();
292-
293-
return startIntent.setClass(context, SignedInActivity.class)
294-
.putExtra(EXTRA_SIGNED_IN_CONFIG, signedInConfig);
295-
}
296295
}

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<string name="desc_image">Demonstrates displaying an image from Cloud Storage using Glide.</string>
1111

1212
<!-- strings for Auth UI demo activities -->
13-
<eat-comment/>
13+
<eat-comment />
1414
<string name="launch_title">FirebaseUI Auth Demo</string>
1515
<string name="sign_in">Start</string>
1616
<string name="green_theme">Green Theme</string>

auth/src/main/AndroidManifest.xml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,63 @@
33
xmlns:tools="http://schemas.android.com/tools"
44
package="com.firebase.ui.auth">
55

6-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
7-
<uses-permission android:name="android.permission.INTERNET"/>
6+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
7+
<uses-permission android:name="android.permission.INTERNET" />
88

99
<application>
1010

1111
<meta-data
1212
android:name="com.google.android.gms.version"
13-
android:value="@integer/google_play_services_version"/>
13+
android:value="@integer/google_play_services_version" />
1414

1515
<meta-data
1616
android:name="io.fabric.ApiKey"
17-
android:value="@string/twitter_consumer_secret"/>
17+
android:value="@string/twitter_consumer_secret" />
1818

1919
<meta-data
2020
android:name="com.facebook.sdk.ApplicationId"
21-
android:value="@string/facebook_application_id"/>
21+
android:value="@string/facebook_application_id" />
2222

2323
<meta-data
2424
android:name="com.facebook.sdk.AutoLogAppEventsEnabled"
25-
android:value="${enableFbLogging}"/>
25+
android:value="${enableFbLogging}" />
2626

2727
<activity
2828
android:name=".KickoffActivity"
2929
android:label=""
3030
android:exported="false"
31-
android:theme="@style/FirebaseUI.Transparent"/>
31+
android:theme="@style/FirebaseUI.Transparent" />
3232

3333
<activity
3434
android:name=".ui.email.RecoverPasswordActivity"
3535
android:label="@string/title_recover_password_activity"
36-
android:exported="false"/>
36+
android:exported="false" />
3737

3838
<activity
3939
android:name=".ui.email.RegisterEmailActivity"
4040
android:label="@string/sign_in_default"
41-
android:exported="false"/>
41+
android:exported="false" />
4242

4343
<activity
4444
android:name=".ui.phone.PhoneVerificationActivity"
4545
android:label="@string/sign_in_with_phone_number"
46-
android:windowSoftInputMode="stateAlwaysVisible"
47-
android:exported="false"/>
46+
android:exported="false"
47+
android:windowSoftInputMode="stateAlwaysVisible" />
4848

4949
<activity
5050
android:name=".ui.accountlink.WelcomeBackIdpPrompt"
5151
android:label="@string/title_welcome_back_idp_prompt"
52-
android:exported="false"/>
52+
android:exported="false" />
5353

5454
<activity
5555
android:name=".ui.accountlink.WelcomeBackPasswordPrompt"
5656
android:label="@string/title_welcome_back_password_prompt"
57-
android:exported="false"/>
57+
android:exported="false" />
5858

5959
<activity
6060
android:name=".ui.idp.AuthMethodPickerActivity"
6161
android:label="@string/default_toolbar_title"
62-
android:exported="false"/>
62+
android:exported="false" />
6363

6464
<activity
6565
android:name="com.facebook.FacebookActivity"
@@ -72,12 +72,12 @@
7272
android:exported="true"
7373
tools:ignore="MissingRegistered">
7474
<intent-filter>
75-
<action android:name="android.intent.action.VIEW"/>
75+
<action android:name="android.intent.action.VIEW" />
7676

77-
<category android:name="android.intent.category.DEFAULT"/>
78-
<category android:name="android.intent.category.BROWSABLE"/>
77+
<category android:name="android.intent.category.DEFAULT" />
78+
<category android:name="android.intent.category.BROWSABLE" />
7979

80-
<data android:scheme="@string/facebook_login_protocol_scheme"/>
80+
<data android:scheme="@string/facebook_login_protocol_scheme" />
8181
</intent-filter>
8282
</activity>
8383

auth/src/main/java/com/firebase/ui/auth/AuthUI.java

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public class AuthUI {
7676
public @interface SupportedProvider {}
7777

7878
/**
79-
* Provider identifier for email and password credentials, for use with
80-
* {@link SignInIntentBuilder#setAvailableProviders(List)}.
79+
* Provider identifier for email and password credentials, for use with {@link
80+
* SignInIntentBuilder#setAvailableProviders(List)}.
8181
*/
8282
public static final String EMAIL_PROVIDER = EmailAuthProvider.PROVIDER_ID;
8383

@@ -129,8 +129,8 @@ private AuthUI(FirebaseApp app) {
129129
}
130130

131131
/**
132-
* Retrieves the {@link AuthUI} instance associated with the default app, as returned by
133-
* {@code FirebaseApp.getInstance()}.
132+
* Retrieves the {@link AuthUI} instance associated with the default app, as returned by {@code
133+
* FirebaseApp.getInstance()}.
134134
*
135135
* @throws IllegalStateException if the default app is not initialized.
136136
*/
@@ -250,8 +250,8 @@ public Task<Void> then(@NonNull Task<Void> task) throws Exception {
250250
}
251251

252252
/**
253-
* Starts the process of creating a sign in intent, with the mandatory application
254-
* context parameter.
253+
* Starts the process of creating a sign in intent, with the mandatory application context
254+
* parameter.
255255
*/
256256
public SignInIntentBuilder createSignInIntentBuilder() {
257257
return new SignInIntentBuilder();
@@ -260,8 +260,8 @@ public SignInIntentBuilder createSignInIntentBuilder() {
260260
/**
261261
* Configuration for an identity provider.
262262
* <p>
263-
* In the simplest case, you can supply the provider ID and build the config like this:
264-
* {@code new IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build()}
263+
* In the simplest case, you can supply the provider ID and build the config like this: {@code
264+
* new IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build()}
265265
*/
266266
public static class IdpConfig implements Parcelable {
267267
private final String mProviderId;
@@ -391,8 +391,8 @@ private abstract class AuthIntentBuilder<T extends AuthIntentBuilder> {
391391
private AuthIntentBuilder() {}
392392

393393
/**
394-
* Specifies the theme to use for the application flow. If no theme is specified,
395-
* a default theme will be used.
394+
* Specifies the theme to use for the application flow. If no theme is specified, a default
395+
* theme will be used.
396396
*/
397397
public T setTheme(@StyleRes int theme) {
398398
Preconditions.checkValidStyle(
@@ -404,8 +404,8 @@ public T setTheme(@StyleRes int theme) {
404404
}
405405

406406
/**
407-
* Specifies the logo to use for the {@link AuthMethodPickerActivity}. If no logo
408-
* is specified, none will be used.
407+
* Specifies the logo to use for the {@link AuthMethodPickerActivity}. If no logo is
408+
* specified, none will be used.
409409
*/
410410
public T setLogo(@DrawableRes int logo) {
411411
mLogo = logo;
@@ -429,8 +429,8 @@ public T setPrivacyPolicyUrl(@Nullable String privacyPolicyUrl) {
429429
}
430430

431431
/**
432-
* Specified the set of supported authentication providers. At least one provider must
433-
* be specified. There may only be one instance of each provider.
432+
* Specified the set of supported authentication providers. At least one provider must be
433+
* specified. There may only be one instance of each provider.
434434
* <p>
435435
* <p>If no providers are explicitly specified by calling this method, then the email
436436
* provider is the default supported provider.
@@ -455,19 +455,21 @@ public T setAvailableProviders(@NonNull List<IdpConfig> idpConfigs) {
455455
try {
456456
Class c = com.facebook.FacebookSdk.class;
457457
} catch (NoClassDefFoundError e) {
458-
throw new RuntimeException("Facebook provider cannot be configured " +
459-
"without dependency. Did you forget to add " +
460-
"'com.facebook.android:facebook-android-sdk:VERSION' dependency?");
458+
throw new RuntimeException(
459+
"Facebook provider cannot be configured " +
460+
"without dependency. Did you forget to add " +
461+
"'com.facebook.android:facebook-android-sdk:VERSION' dependency?");
461462
}
462463
}
463464

464465
if (config.getProviderId().equals(TWITTER_PROVIDER)) {
465466
try {
466467
Class c = com.twitter.sdk.android.core.TwitterCore.class;
467468
} catch (NoClassDefFoundError e) {
468-
throw new RuntimeException("Twitter provider cannot be configured " +
469-
"without dependency. Did you forget to add " +
470-
"'com.twitter.sdk.android:twitter-core:VERSION' dependency?");
469+
throw new RuntimeException(
470+
"Twitter provider cannot be configured " +
471+
"without dependency. Did you forget to add " +
472+
"'com.twitter.sdk.android:twitter-core:VERSION' dependency?");
471473
}
472474
}
473475
}
@@ -476,8 +478,8 @@ public T setAvailableProviders(@NonNull List<IdpConfig> idpConfigs) {
476478
}
477479

478480
/**
479-
* Specified the set of supported authentication providers. At least one provider must
480-
* be specified. There may only be one instance of each provider.
481+
* Specified the set of supported authentication providers. At least one provider must be
482+
* specified. There may only be one instance of each provider.
481483
* <p>
482484
* <p>If no providers are explicitly specified by calling this method, then the email
483485
* provider is the default supported provider.
@@ -504,9 +506,9 @@ public T setProviders(@NonNull List<IdpConfig> idpConfigs) {
504506
}
505507

506508
/**
507-
* Enables or disables the use of Smart Lock for Passwords in the sign in flow.
508-
* To (en)disable hint selector and credential selector independently
509-
* use {@link #setIsSmartLockEnabled(boolean, boolean)}
509+
* Enables or disables the use of Smart Lock for Passwords in the sign in flow. To
510+
* (en)disable hint selector and credential selector independently use {@link
511+
* #setIsSmartLockEnabled(boolean, boolean)}
510512
* <p>
511513
* <p>SmartLock is enabled by default.
512514
*
@@ -522,10 +524,9 @@ public T setIsSmartLockEnabled(boolean enabled) {
522524
* selector.
523525
* <p>
524526
* <p>Both selectors are enabled by default.
525-
527+
*
526528
* @param enableCredentials enables credential selector before signup
527-
* @param enableHints enable hint selector in respective signup screens
528-
* @return
529+
* @param enableHints enable hint selector in respective signup screens
529530
*/
530531
public T setIsSmartLockEnabled(boolean enableCredentials, boolean enableHints) {
531532
mEnableCredentials = enableCredentials;

0 commit comments

Comments
 (0)