Skip to content

Style refactor #784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,48 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.firebase.uidemo">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
android:name=".auth.FirebaseUIDemo"
android:label="@string/app_name"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:supportsRtl="false"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".ChooserActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts"/>
android:resource="@xml/shortcuts" />
</activity>

<!-- Chat demo -->
<activity
android:name=".database.ChatActivity"
android:label="@string/name_chat"/>
android:label="@string/name_chat" />
<activity
android:name=".database.ChatIndexActivity"
android:label="@string/name_chat"/>
android:label="@string/name_chat" />

<!-- Auth UI demo -->
<activity
android:name=".auth.AuthUiActivity"
android:label="@string/name_auth_ui"/>
android:label="@string/name_auth_ui" />
<activity
android:name=".auth.SignedInActivity"
android:label="@string/name_auth_ui"/>
android:label="@string/name_auth_ui" />

<!-- Storage UI demo-->
<activity
android:name=".storage.ImageActivity"
android:label="@string/name_image"/>
android:label="@string/name_image" />
</application>

</manifest>
12 changes: 6 additions & 6 deletions app/src/main/java/com/firebase/uidemo/auth/AuthUiActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ public class AuthUiActivity extends AppCompatActivity {
@BindView(R.id.google_scope_youtube_data)
CheckBox mGoogleScopeYoutubeData;

public static Intent createIntent(Context context) {
Intent in = new Intent();
in.setClass(context, AuthUiActivity.class);
return in;
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -408,10 +414,4 @@ private List<String> getGooglePermissions() {
}
return result;
}

public static Intent createIntent(Context context) {
Intent in = new Intent();
in.setClass(context, AuthUiActivity.class);
return in;
}
}
23 changes: 11 additions & 12 deletions app/src/main/java/com/firebase/uidemo/auth/SignedInActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ public class SignedInActivity extends AppCompatActivity {

private SignedInConfig mSignedInConfig;

public static Intent createIntent(
Context context,
IdpResponse idpResponse,
SignedInConfig signedInConfig) {
Intent startIntent = idpResponse == null ? new Intent() : idpResponse.toIntent();

return startIntent.setClass(context, SignedInActivity.class)
.putExtra(EXTRA_SIGNED_IN_CONFIG, signedInConfig);
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -220,8 +230,7 @@ private void populateIdpToken() {

@MainThread
private void showSnackbar(@StringRes int errorMessageRes) {
Snackbar.make(mRootView, errorMessageRes, Snackbar.LENGTH_LONG)
.show();
Snackbar.make(mRootView, errorMessageRes, Snackbar.LENGTH_LONG).show();
}

static final class SignedInConfig implements Parcelable {
Expand Down Expand Up @@ -283,14 +292,4 @@ public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(isHintSelectorEnabled ? 1 : 0);
}
}

public static Intent createIntent(
Context context,
IdpResponse idpResponse,
SignedInConfig signedInConfig) {
Intent startIntent = idpResponse == null ? new Intent() : idpResponse.toIntent();

return startIntent.setClass(context, SignedInActivity.class)
.putExtra(EXTRA_SIGNED_IN_CONFIG, signedInConfig);
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<string name="desc_image">Demonstrates displaying an image from Cloud Storage using Glide.</string>

<!-- strings for Auth UI demo activities -->
<eat-comment/>
<eat-comment />
<string name="launch_title">FirebaseUI Auth Demo</string>
<string name="sign_in">Start</string>
<string name="green_theme">Green Theme</string>
Expand Down
36 changes: 18 additions & 18 deletions auth/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,63 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.firebase.ui.auth">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<application>

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

<meta-data
android:name="io.fabric.ApiKey"
android:value="@string/twitter_consumer_secret"/>
android:value="@string/twitter_consumer_secret" />

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

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

<activity
android:name=".KickoffActivity"
android:label=""
android:exported="false"
android:theme="@style/FirebaseUI.Transparent"/>
android:theme="@style/FirebaseUI.Transparent" />

<activity
android:name=".ui.email.RecoverPasswordActivity"
android:label="@string/title_recover_password_activity"
android:exported="false"/>
android:exported="false" />

<activity
android:name=".ui.email.RegisterEmailActivity"
android:label="@string/sign_in_default"
android:exported="false"/>
android:exported="false" />

<activity
android:name=".ui.phone.PhoneVerificationActivity"
android:label="@string/sign_in_with_phone_number"
android:windowSoftInputMode="stateAlwaysVisible"
android:exported="false"/>
android:exported="false"
android:windowSoftInputMode="stateAlwaysVisible" />

<activity
android:name=".ui.accountlink.WelcomeBackIdpPrompt"
android:label="@string/title_welcome_back_idp_prompt"
android:exported="false"/>
android:exported="false" />

<activity
android:name=".ui.accountlink.WelcomeBackPasswordPrompt"
android:label="@string/title_welcome_back_password_prompt"
android:exported="false"/>
android:exported="false" />

<activity
android:name=".ui.idp.AuthMethodPickerActivity"
android:label="@string/default_toolbar_title"
android:exported="false"/>
android:exported="false" />

<activity
android:name="com.facebook.FacebookActivity"
Expand All @@ -72,12 +72,12 @@
android:exported="true"
tools:ignore="MissingRegistered">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="@string/facebook_login_protocol_scheme"/>
<data android:scheme="@string/facebook_login_protocol_scheme" />
</intent-filter>
</activity>

Expand Down
57 changes: 29 additions & 28 deletions auth/src/main/java/com/firebase/ui/auth/AuthUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public class AuthUI {
public @interface SupportedProvider {}

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

Expand Down Expand Up @@ -129,8 +129,8 @@ private AuthUI(FirebaseApp app) {
}

/**
* Retrieves the {@link AuthUI} instance associated with the default app, as returned by
* {@code FirebaseApp.getInstance()}.
* Retrieves the {@link AuthUI} instance associated with the default app, as returned by {@code
* FirebaseApp.getInstance()}.
*
* @throws IllegalStateException if the default app is not initialized.
*/
Expand Down Expand Up @@ -250,8 +250,8 @@ public Task<Void> then(@NonNull Task<Void> task) throws Exception {
}

/**
* Starts the process of creating a sign in intent, with the mandatory application
* context parameter.
* Starts the process of creating a sign in intent, with the mandatory application context
* parameter.
*/
public SignInIntentBuilder createSignInIntentBuilder() {
return new SignInIntentBuilder();
Expand All @@ -260,8 +260,8 @@ public SignInIntentBuilder createSignInIntentBuilder() {
/**
* Configuration for an identity provider.
* <p>
* In the simplest case, you can supply the provider ID and build the config like this:
* {@code new IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build()}
* In the simplest case, you can supply the provider ID and build the config like this: {@code
* new IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build()}
*/
public static class IdpConfig implements Parcelable {
private final String mProviderId;
Expand Down Expand Up @@ -391,8 +391,8 @@ private abstract class AuthIntentBuilder<T extends AuthIntentBuilder> {
private AuthIntentBuilder() {}

/**
* Specifies the theme to use for the application flow. If no theme is specified,
* a default theme will be used.
* Specifies the theme to use for the application flow. If no theme is specified, a default
* theme will be used.
*/
public T setTheme(@StyleRes int theme) {
Preconditions.checkValidStyle(
Expand All @@ -404,8 +404,8 @@ public T setTheme(@StyleRes int theme) {
}

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

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

if (config.getProviderId().equals(TWITTER_PROVIDER)) {
try {
Class c = com.twitter.sdk.android.core.TwitterCore.class;
} catch (NoClassDefFoundError e) {
throw new RuntimeException("Twitter provider cannot be configured " +
"without dependency. Did you forget to add " +
"'com.twitter.sdk.android:twitter-core:VERSION' dependency?");
throw new RuntimeException(
"Twitter provider cannot be configured " +
"without dependency. Did you forget to add " +
"'com.twitter.sdk.android:twitter-core:VERSION' dependency?");
}
}
}
Expand All @@ -476,8 +478,8 @@ public T setAvailableProviders(@NonNull List<IdpConfig> idpConfigs) {
}

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

/**
* Enables or disables the use of Smart Lock for Passwords in the sign in flow.
* To (en)disable hint selector and credential selector independently
* use {@link #setIsSmartLockEnabled(boolean, boolean)}
* Enables or disables the use of Smart Lock for Passwords in the sign in flow. To
* (en)disable hint selector and credential selector independently use {@link
* #setIsSmartLockEnabled(boolean, boolean)}
* <p>
* <p>SmartLock is enabled by default.
*
Expand All @@ -522,10 +524,9 @@ public T setIsSmartLockEnabled(boolean enabled) {
* selector.
* <p>
* <p>Both selectors are enabled by default.

*
* @param enableCredentials enables credential selector before signup
* @param enableHints enable hint selector in respective signup screens
* @return
* @param enableHints enable hint selector in respective signup screens
*/
public T setIsSmartLockEnabled(boolean enableCredentials, boolean enableHints) {
mEnableCredentials = enableCredentials;
Expand Down
Loading