From d995eb7a71afbbbc71ea9ee96aef6a0d80e4ead1 Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Wed, 19 Jul 2017 12:58:41 -0700 Subject: [PATCH 1/9] Merge improvements from anonymous auth PR (#309) (#808) --- .../java/com/firebase/ui/auth/AuthUI.java | 2 +- .../com/firebase/ui/auth/IdpResponse.java | 57 ++----- .../main/java/com/firebase/ui/auth/User.java | 159 ++++++++++++++++++ .../ui/auth/provider/FacebookProvider.java | 39 +++-- .../ui/auth/provider/GoogleProvider.java | 7 +- .../ui/auth/provider/TwitterProvider.java | 76 ++++----- .../java/com/firebase/ui/auth/ui/User.java | 115 ------------- .../ui/accountlink/WelcomeBackIdpPrompt.java | 4 +- .../WelcomeBackPasswordPrompt.java | 5 +- .../ui/auth/ui/email/CheckEmailFragment.java | 9 +- .../auth/ui/email/RegisterEmailActivity.java | 8 +- .../auth/ui/email/RegisterEmailFragment.java | 22 +-- .../auth/ui/idp/CredentialSignInHandler.java | 6 +- .../ui/phone/PhoneVerificationActivity.java | 7 +- .../signincontainer/IdpSignInContainer.java | 4 +- .../util/signincontainer/SignInDelegate.java | 8 +- .../ui/email/RegisterEmailActivityTest.java | 14 +- .../email/WelcomeBackPasswordPromptTest.java | 7 +- .../ui/idp/CredentialSignInHandlerTest.java | 16 +- 19 files changed, 311 insertions(+), 254 deletions(-) create mode 100644 auth/src/main/java/com/firebase/ui/auth/User.java delete mode 100644 auth/src/main/java/com/firebase/ui/auth/ui/User.java diff --git a/auth/src/main/java/com/firebase/ui/auth/AuthUI.java b/auth/src/main/java/com/firebase/ui/auth/AuthUI.java index 1adc2ea8b..abb693db7 100644 --- a/auth/src/main/java/com/firebase/ui/auth/AuthUI.java +++ b/auth/src/main/java/com/firebase/ui/auth/AuthUI.java @@ -192,7 +192,7 @@ public Task signOut(@NonNull FragmentActivity activity) { // Twitter sign out try { - TwitterProvider.signout(activity); + TwitterProvider.signOut(activity); } catch (NoClassDefFoundError e) { // do nothing } diff --git a/auth/src/main/java/com/firebase/ui/auth/IdpResponse.java b/auth/src/main/java/com/firebase/ui/auth/IdpResponse.java index 36a882334..e9df58df1 100644 --- a/auth/src/main/java/com/firebase/ui/auth/IdpResponse.java +++ b/auth/src/main/java/com/firebase/ui/auth/IdpResponse.java @@ -24,7 +24,6 @@ import com.firebase.ui.auth.ui.ExtraConstants; import com.google.firebase.auth.FacebookAuthProvider; -import com.google.firebase.auth.GithubAuthProvider; import com.google.firebase.auth.GoogleAuthProvider; import com.google.firebase.auth.TwitterAuthProvider; @@ -32,27 +31,21 @@ * A container that encapsulates the result of authenticating with an Identity Provider. */ public class IdpResponse implements Parcelable { - private final String mProviderId; - private final String mEmail; - private final String mPhoneNumber; + private final User mUser; private final String mToken; private final String mSecret; private final int mErrorCode; private IdpResponse(int errorCode) { - this(null, null, null, null, null, errorCode); + this(null, null, null, errorCode); } private IdpResponse( - String providerId, - String email, - String phoneNumber, + User user, String token, String secret, int errorCode) { - mProviderId = providerId; - mEmail = email; - mPhoneNumber = phoneNumber; + mUser = user; mToken = token; mSecret = secret; mErrorCode = errorCode; @@ -89,7 +82,7 @@ public Intent toIntent() { @NonNull @AuthUI.SupportedProvider public String getProviderType() { - return mProviderId; + return mUser.getProviderId(); } /** @@ -97,7 +90,7 @@ public String getProviderType() { */ @Nullable public String getEmail() { - return mEmail; + return mUser.getEmail(); } /** @@ -105,7 +98,7 @@ public String getEmail() { */ @Nullable public String getPhoneNumber() { - return mPhoneNumber; + return mUser.getPhoneNumber(); } /** @@ -138,9 +131,7 @@ public int describeContents() { @Override public void writeToParcel(Parcel dest, int flags) { - dest.writeString(mProviderId); - dest.writeString(mEmail); - dest.writeString(mPhoneNumber); + dest.writeParcelable(mUser, flags); dest.writeString(mToken); dest.writeString(mSecret); dest.writeInt(mErrorCode); @@ -150,9 +141,7 @@ public void writeToParcel(Parcel dest, int flags) { @Override public IdpResponse createFromParcel(Parcel in) { return new IdpResponse( - in.readString(), - in.readString(), - in.readString(), + in.readParcelable(User.class.getClassLoader()), in.readString(), in.readString(), in.readInt() @@ -167,21 +156,12 @@ public IdpResponse[] newArray(int size) { @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) public static class Builder { - private String mProviderId; - private String mEmail; - private String mPhoneNumber; + private User mUser; private String mToken; private String mSecret; - public Builder(@AuthUI.SupportedProvider @NonNull String providerId, - @Nullable String email) { - mProviderId = providerId; - mEmail = email; - } - - public Builder setPhoneNumber(String phoneNumber) { - mPhoneNumber = phoneNumber; - return this; + public Builder(@NonNull User user) { + mUser = user; } public Builder setToken(String token) { @@ -195,22 +175,21 @@ public Builder setSecret(String secret) { } public IdpResponse build() { - if ((mProviderId.equalsIgnoreCase(GoogleAuthProvider.PROVIDER_ID) - || mProviderId.equalsIgnoreCase(FacebookAuthProvider.PROVIDER_ID) - || mProviderId.equalsIgnoreCase(TwitterAuthProvider.PROVIDER_ID) - || mProviderId.equalsIgnoreCase(GithubAuthProvider.PROVIDER_ID)) + String providerId = mUser.getProviderId(); + if ((providerId.equalsIgnoreCase(GoogleAuthProvider.PROVIDER_ID) + || providerId.equalsIgnoreCase(FacebookAuthProvider.PROVIDER_ID) + || providerId.equalsIgnoreCase(TwitterAuthProvider.PROVIDER_ID)) && TextUtils.isEmpty(mToken)) { throw new IllegalStateException( "Token cannot be null when using a non-email provider."); } - if (mProviderId.equalsIgnoreCase(TwitterAuthProvider.PROVIDER_ID) + if (providerId.equalsIgnoreCase(TwitterAuthProvider.PROVIDER_ID) && TextUtils.isEmpty(mSecret)) { throw new IllegalStateException( "Secret cannot be null when using the Twitter provider."); } - return new IdpResponse( - mProviderId, mEmail, mPhoneNumber, mToken, mSecret, ResultCodes.OK); + return new IdpResponse(mUser, mToken, mSecret, ResultCodes.OK); } } } diff --git a/auth/src/main/java/com/firebase/ui/auth/User.java b/auth/src/main/java/com/firebase/ui/auth/User.java new file mode 100644 index 000000000..0fb9da13d --- /dev/null +++ b/auth/src/main/java/com/firebase/ui/auth/User.java @@ -0,0 +1,159 @@ +package com.firebase.ui.auth; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.os.Parcel; +import android.os.Parcelable; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.annotation.RestrictTo; + +import com.firebase.ui.auth.ui.ExtraConstants; + +@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) +public class User implements Parcelable { + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + @Override + public User createFromParcel(Parcel in) { + return new User( + in.readString(), + in.readString(), + in.readString(), + in.readString(), + in.readParcelable(Uri.class.getClassLoader())); + } + + @Override + public User[] newArray(int size) { + return new User[size]; + } + }; + + private final String mProviderId; + private final String mEmail; + private final String mPhoneNumber; + private final String mName; + private final Uri mPhotoUri; + + private User(String providerId, String email, String phoneNumber, String name, Uri photoUri) { + mProviderId = providerId; + mEmail = email; + mPhoneNumber = phoneNumber; + mName = name; + mPhotoUri = photoUri; + } + + public static User getUser(Intent intent) { + return intent.getParcelableExtra(ExtraConstants.EXTRA_USER); + } + + public static User getUser(Bundle arguments) { + return arguments.getParcelable(ExtraConstants.EXTRA_USER); + } + + @NonNull + @AuthUI.SupportedProvider + public String getProviderId() { + return mProviderId; + } + + @Nullable + public String getEmail() { + return mEmail; + } + + @Nullable + public String getPhoneNumber() { + return mPhoneNumber; + } + + @Nullable + public String getName() { + return mName; + } + + @Nullable + public Uri getPhotoUri() { + return mPhotoUri; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + User user = (User) o; + + return mProviderId.equals(user.mProviderId) + && (mEmail == null ? user.mEmail == null : mEmail.equals(user.mEmail)) + && (mName == null ? user.mName == null : mName.equals(user.mName)) + && (mPhotoUri == null ? user.mPhotoUri == null : mPhotoUri.equals(user.mPhotoUri)); + } + + @Override + public int hashCode() { + int result = mProviderId.hashCode(); + result = 31 * result + (mEmail == null ? 0 : mEmail.hashCode()); + result = 31 * result + (mName == null ? 0 : mName.hashCode()); + result = 31 * result + (mPhotoUri == null ? 0 : mPhotoUri.hashCode()); + return result; + } + + @Override + public String toString() { + return "User{" + + "mProviderId='" + mProviderId + '\'' + + ", mEmail='" + mEmail + '\'' + + ", mName='" + mName + '\'' + + ", mPhotoUri=" + mPhotoUri + + '}'; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(@NonNull Parcel dest, int flags) { + dest.writeString(mProviderId); + dest.writeString(mEmail); + dest.writeString(mPhoneNumber); + dest.writeString(mName); + dest.writeParcelable(mPhotoUri, flags); + } + + public static class Builder { + private String mProviderId; + private String mEmail; + private String mPhoneNumber; + private String mName; + private Uri mPhotoUri; + + public Builder(@AuthUI.SupportedProvider @NonNull String providerId, + @Nullable String email) { + mProviderId = providerId; + mEmail = email; + } + + public Builder setPhoneNumber(String phoneNumber) { + mPhoneNumber = phoneNumber; + return this; + } + + public Builder setName(String name) { + mName = name; + return this; + } + + public Builder setPhotoUri(Uri photoUri) { + mPhotoUri = photoUri; + return this; + } + + public User build() { + return new User(mProviderId, mEmail, mPhoneNumber, mName, mPhotoUri); + } + } +} diff --git a/auth/src/main/java/com/firebase/ui/auth/provider/FacebookProvider.java b/auth/src/main/java/com/firebase/ui/auth/provider/FacebookProvider.java index 878f97d25..ed7fd6d42 100644 --- a/auth/src/main/java/com/firebase/ui/auth/provider/FacebookProvider.java +++ b/auth/src/main/java/com/firebase/ui/auth/provider/FacebookProvider.java @@ -17,6 +17,7 @@ import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.support.annotation.LayoutRes; import android.support.annotation.Nullable; @@ -35,6 +36,7 @@ import com.firebase.ui.auth.AuthUI; import com.firebase.ui.auth.IdpResponse; import com.firebase.ui.auth.R; +import com.firebase.ui.auth.User; import com.google.firebase.auth.AuthCredential; import com.google.firebase.auth.FacebookAuthProvider; @@ -133,19 +135,31 @@ public void onCompleted(JSONObject object, GraphResponse response) { Log.w(TAG, "Received null response from Facebook GraphRequest"); onFailure(); } else { + String email = null; + String name = null; + Uri photoUri = null; + try { - String email = object.getString("email"); - onSuccess(email, loginResult); + email = object.getString("email"); } catch (JSONException e) { Log.e(TAG, "Failure retrieving Facebook email", e); - onSuccess(null, loginResult); } + try { + name = object.getString("name"); + } catch (JSONException ignored) {} + try { + photoUri = Uri.parse(object.getJSONObject("picture") + .getJSONObject("data") + .getString("url")); + } catch (JSONException ignored) {} + + onSuccess(loginResult, email, name, photoUri); } } }); Bundle parameters = new Bundle(); - parameters.putString("fields", "id,name,email"); + parameters.putString("fields", "id,name,email,picture"); request.setParameters(parameters); request.executeAsync(); } @@ -161,15 +175,18 @@ public void onError(FacebookException error) { onFailure(); } - private void onSuccess(@Nullable String email, LoginResult loginResult) { + private void onSuccess(LoginResult loginResult, + @Nullable String email, + String name, + Uri photoUri) { gcCallbackManager(); - mCallbackObject.onSuccess(createIdpResponse(email, loginResult)); - } - - private IdpResponse createIdpResponse(@Nullable String email, LoginResult loginResult) { - return new IdpResponse.Builder(FacebookAuthProvider.PROVIDER_ID, email) + mCallbackObject.onSuccess(new IdpResponse.Builder( + new User.Builder(FacebookAuthProvider.PROVIDER_ID, email) + .setName(name) + .setPhotoUri(photoUri) + .build()) .setToken(loginResult.getAccessToken().getToken()) - .build(); + .build()); } private void onFailure() { diff --git a/auth/src/main/java/com/firebase/ui/auth/provider/GoogleProvider.java b/auth/src/main/java/com/firebase/ui/auth/provider/GoogleProvider.java index 7cd0cb0d1..c91c32707 100644 --- a/auth/src/main/java/com/firebase/ui/auth/provider/GoogleProvider.java +++ b/auth/src/main/java/com/firebase/ui/auth/provider/GoogleProvider.java @@ -28,6 +28,7 @@ import com.firebase.ui.auth.AuthUI.IdpConfig; import com.firebase.ui.auth.IdpResponse; import com.firebase.ui.auth.R; +import com.firebase.ui.auth.User; import com.firebase.ui.auth.util.GoogleApiHelper; import com.google.android.gms.auth.api.Auth; import com.google.android.gms.auth.api.signin.GoogleSignInAccount; @@ -113,7 +114,11 @@ public void disconnect() { } private IdpResponse createIdpResponse(GoogleSignInAccount account) { - return new IdpResponse.Builder(GoogleAuthProvider.PROVIDER_ID, account.getEmail()) + return new IdpResponse.Builder( + new User.Builder(GoogleAuthProvider.PROVIDER_ID, account.getEmail()) + .setName(account.getDisplayName()) + .setPhotoUri(account.getPhotoUrl()) + .build()) .setToken(account.getIdToken()) .build(); } diff --git a/auth/src/main/java/com/firebase/ui/auth/provider/TwitterProvider.java b/auth/src/main/java/com/firebase/ui/auth/provider/TwitterProvider.java index cdca74033..2faf7f37a 100644 --- a/auth/src/main/java/com/firebase/ui/auth/provider/TwitterProvider.java +++ b/auth/src/main/java/com/firebase/ui/auth/provider/TwitterProvider.java @@ -3,6 +3,7 @@ import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.net.Uri; import android.support.annotation.LayoutRes; import android.util.Log; @@ -19,8 +20,7 @@ import com.twitter.sdk.android.core.TwitterException; import com.twitter.sdk.android.core.TwitterSession; import com.twitter.sdk.android.core.identity.TwitterAuthClient; - -import java.lang.ref.WeakReference; +import com.twitter.sdk.android.core.models.User; public class TwitterProvider extends Callback implements IdpProvider { @@ -51,7 +51,7 @@ private static void initialize(Context context) { Twitter.initialize(config); } - public static void signout(Context context) { + public static void signOut(Context context) { try { Twitter.getInstance(); } catch (IllegalStateException e) { @@ -92,9 +92,27 @@ public void startLogin(Activity activity) { } @Override - public void success(Result result) { - mTwitterAuthClient.requestEmail(result.data, - new EmailCallback(result.data, mCallbackObject)); + public void success(final Result sessionResult) { + TwitterCore.getInstance() + .getApiClient() + .getAccountService() + .verifyCredentials(false, false, true) + .enqueue(new Callback() { + @Override + public void success(Result result) { + User user = result.data; + mCallbackObject.onSuccess(createIdpResponse( + sessionResult.data, + user.email, + user.name, + Uri.parse(user.profileImageUrlHttps))); + } + + @Override + public void failure(TwitterException exception) { + mCallbackObject.onFailure(); + } + }); } @Override @@ -103,39 +121,17 @@ public void failure(TwitterException exception) { mCallbackObject.onFailure(); } - private static class EmailCallback extends Callback { - private TwitterSession mTwitterSession; - private WeakReference mCallbackObject; - - public EmailCallback(TwitterSession session, IdpCallback callbackObject) { - mTwitterSession = session; - mCallbackObject = new WeakReference<>(callbackObject); - } - - @Override - public void success(Result emailResult) { - onSuccess(createIdpResponse(emailResult.data)); - } - - @Override - public void failure(TwitterException exception) { - Log.e(TAG, "Failure retrieving Twitter email. " + exception.getMessage()); - // If retrieving the email fails, we should still be able to sign in, but Smart Lock - // and account linking won't work. - onSuccess(createIdpResponse(null)); - } - - private void onSuccess(IdpResponse response) { - if (mCallbackObject != null) { - mCallbackObject.get().onSuccess(response); - } - } - - private IdpResponse createIdpResponse(String email) { - return new IdpResponse.Builder(TwitterAuthProvider.PROVIDER_ID, email) - .setToken(mTwitterSession.getAuthToken().token) - .setSecret(mTwitterSession.getAuthToken().secret) - .build(); - } + private IdpResponse createIdpResponse(TwitterSession session, + String email, + String name, + Uri photoUri) { + return new IdpResponse.Builder( + new com.firebase.ui.auth.User.Builder(TwitterAuthProvider.PROVIDER_ID, email) + .setName(name) + .setPhotoUri(photoUri) + .build()) + .setToken(session.getAuthToken().token) + .setSecret(session.getAuthToken().secret) + .build(); } } diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/User.java b/auth/src/main/java/com/firebase/ui/auth/ui/User.java deleted file mode 100644 index aa2634b50..000000000 --- a/auth/src/main/java/com/firebase/ui/auth/ui/User.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.firebase.ui.auth.ui; - -import android.content.Intent; -import android.net.Uri; -import android.os.Bundle; -import android.os.Parcel; -import android.os.Parcelable; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.annotation.RestrictTo; - -import com.firebase.ui.auth.AuthUI; - -@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) -public class User implements Parcelable { - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - @Override - public User createFromParcel(Parcel in) { - return new User( - in.readString(), - in.readString(), - in.readString(), - in.readParcelable(Uri.class.getClassLoader())); - } - - @Override - public User[] newArray(int size) { - return new User[size]; - } - }; - - private String mEmail; - private String mName; - private String mProvider; - private Uri mPhotoUri; - - private User(String email, String name, String provider, Uri photoUri) { - mEmail = email; - mName = name; - mProvider = provider; - mPhotoUri = photoUri; - } - - public static User getUser(Intent intent) { - return intent.getParcelableExtra(ExtraConstants.EXTRA_USER); - } - - public static User getUser(Bundle arguments) { - return arguments.getParcelable(ExtraConstants.EXTRA_USER); - } - - @NonNull - public String getEmail() { - return mEmail; - } - - @Nullable - public String getName() { - return mName; - } - - @Nullable - @AuthUI.SupportedProvider - public String getProvider() { - return mProvider; - } - - @Nullable - public Uri getPhotoUri() { - return mPhotoUri; - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(@NonNull Parcel dest, int flags) { - dest.writeString(mEmail); - dest.writeString(mName); - dest.writeString(mProvider); - dest.writeParcelable(mPhotoUri, flags); - } - - public static class Builder { - private String mEmail; - private String mName; - private String mProvider; - private Uri mPhotoUri; - - public Builder(@NonNull String email) { - mEmail = email; - } - - public Builder setName(String name) { - mName = name; - return this; - } - - public Builder setProvider(@AuthUI.SupportedProvider String provider) { - mProvider = provider; - return this; - } - - public Builder setPhotoUri(Uri photoUri) { - mPhotoUri = photoUri; - return this; - } - - public User build() { - return new User(mEmail, mName, mProvider, mPhotoUri); - } - } -} diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackIdpPrompt.java b/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackIdpPrompt.java index a7b539594..df796f6b1 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackIdpPrompt.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackIdpPrompt.java @@ -41,7 +41,7 @@ import com.firebase.ui.auth.ui.FlowParameters; import com.firebase.ui.auth.ui.HelperActivityBase; import com.firebase.ui.auth.ui.TaskFailureLogger; -import com.firebase.ui.auth.ui.User; +import com.firebase.ui.auth.User; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; @@ -80,7 +80,7 @@ protected void onCreate(Bundle savedInstanceState) { User oldUser = User.getUser(getIntent()); - String providerId = oldUser.getProvider(); + String providerId = oldUser.getProviderId(); for (IdpConfig idpConfig : getFlowParams().providerInfo) { if (providerId.equals(idpConfig.getProviderId())) { switch (providerId) { diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackPasswordPrompt.java b/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackPasswordPrompt.java index 211facfc0..7a0a20ad4 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackPasswordPrompt.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackPasswordPrompt.java @@ -42,6 +42,7 @@ import com.firebase.ui.auth.ui.HelperActivityBase; import com.firebase.ui.auth.ui.ImeHelper; import com.firebase.ui.auth.ui.TaskFailureLogger; +import com.firebase.ui.auth.User; import com.firebase.ui.auth.ui.email.RecoverPasswordActivity; import com.firebase.ui.auth.util.signincontainer.SaveSmartLock; import com.google.android.gms.tasks.OnFailureListener; @@ -162,7 +163,9 @@ public void onSuccess(AuthResult authResult) { mSaveSmartLock, authResult.getUser(), password, - new IdpResponse.Builder(EmailAuthProvider.PROVIDER_ID, email) + new IdpResponse.Builder( + new User.Builder(EmailAuthProvider.PROVIDER_ID, email) + .build()) .build()); } else { authResult.getUser() diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/email/CheckEmailFragment.java b/auth/src/main/java/com/firebase/ui/auth/ui/email/CheckEmailFragment.java index 6f341d50f..68ed57d0c 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/email/CheckEmailFragment.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/email/CheckEmailFragment.java @@ -17,12 +17,12 @@ import android.widget.EditText; import com.firebase.ui.auth.R; +import com.firebase.ui.auth.User; import com.firebase.ui.auth.provider.ProviderUtils; import com.firebase.ui.auth.ui.ExtraConstants; import com.firebase.ui.auth.ui.FlowParameters; import com.firebase.ui.auth.ui.FragmentBase; import com.firebase.ui.auth.ui.ImeHelper; -import com.firebase.ui.auth.ui.User; import com.firebase.ui.auth.ui.email.fieldvalidators.EmailFieldValidator; import com.firebase.ui.auth.util.GoogleApiHelper; import com.google.android.gms.auth.api.Auth; @@ -198,15 +198,16 @@ private void checkAccountExists(@NonNull final String email) { @Override public void onSuccess(String provider) { if (provider == null) { - mListener.onNewUser(new User.Builder(email) + mListener.onNewUser(new User.Builder(EmailAuthProvider.PROVIDER_ID, email) .setName(finalName) .setPhotoUri(finalPhotoUri) .build()); } else if (EmailAuthProvider.PROVIDER_ID.equalsIgnoreCase(provider)) { - mListener.onExistingEmailUser(new User.Builder(email).build()); + mListener.onExistingEmailUser( + new User.Builder(EmailAuthProvider.PROVIDER_ID, email).build()); } else { mListener.onExistingIdpUser( - new User.Builder(email).setProvider(provider).build()); + new User.Builder(EmailAuthProvider.PROVIDER_ID, email).build()); } } }) diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailActivity.java b/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailActivity.java index 4f367d1e4..c9ae9507d 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailActivity.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailActivity.java @@ -27,10 +27,9 @@ import com.firebase.ui.auth.ui.ExtraConstants; import com.firebase.ui.auth.ui.FlowParameters; import com.firebase.ui.auth.ui.HelperActivityBase; -import com.firebase.ui.auth.ui.User; +import com.firebase.ui.auth.User; import com.firebase.ui.auth.ui.accountlink.WelcomeBackIdpPrompt; import com.firebase.ui.auth.ui.accountlink.WelcomeBackPasswordPrompt; -import com.google.firebase.auth.EmailAuthProvider; /** * Activity to control the entire email sign up flow. Plays host to {@link CheckEmailFragment} and @@ -96,8 +95,7 @@ public void onExistingEmailUser(User user) { WelcomeBackPasswordPrompt.createIntent( this, getFlowParams(), - new IdpResponse.Builder( - EmailAuthProvider.PROVIDER_ID, user.getEmail()).build()), + new IdpResponse.Builder(user).build()), RC_SIGN_IN); setSlideAnimation(); @@ -110,7 +108,7 @@ public void onExistingIdpUser(User user) { this, getFlowParams(), user, - new IdpResponse.Builder(EmailAuthProvider.PROVIDER_ID, user.getEmail()).build()); + new IdpResponse.Builder(user).build()); startActivityForResult(intent, RC_WELCOME_BACK_IDP); setSlideAnimation(); diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailFragment.java b/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailFragment.java index 4397f7bcc..c1ed59d94 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailFragment.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailFragment.java @@ -15,6 +15,7 @@ import com.firebase.ui.auth.IdpResponse; import com.firebase.ui.auth.R; +import com.firebase.ui.auth.User; import com.firebase.ui.auth.provider.ProviderUtils; import com.firebase.ui.auth.ui.ExtraConstants; import com.firebase.ui.auth.ui.FlowParameters; @@ -22,7 +23,6 @@ import com.firebase.ui.auth.ui.HelperActivityBase; import com.firebase.ui.auth.ui.ImeHelper; import com.firebase.ui.auth.ui.TaskFailureLogger; -import com.firebase.ui.auth.ui.User; import com.firebase.ui.auth.ui.accountlink.WelcomeBackIdpPrompt; import com.firebase.ui.auth.ui.accountlink.WelcomeBackPasswordPrompt; import com.firebase.ui.auth.ui.email.fieldvalidators.EmailFieldValidator; @@ -173,7 +173,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) { @Override public void onSaveInstanceState(Bundle outState) { outState.putParcelable(ExtraConstants.EXTRA_USER, - new User.Builder(mEmailEditText.getText().toString()) + new User.Builder(EmailAuthProvider.PROVIDER_ID, mEmailEditText.getText().toString()) .setName(mNameEditText.getText().toString()) .setPhotoUri(mUser.getPhotoUri()) .build()); @@ -246,8 +246,11 @@ public void onComplete(@NonNull Task task) { // the credential to SmartLock (if enabled). mActivity.saveCredentialsOrFinish( mSaveSmartLock, user, password, - new IdpResponse.Builder(EmailAuthProvider.PROVIDER_ID, - email).build()); + new IdpResponse.Builder(new User.Builder( + EmailAuthProvider.PROVIDER_ID, email) + .setName(name) + .setPhotoUri(mUser.getPhotoUri()) + .build()).build()); } }); } @@ -288,21 +291,20 @@ public void onSuccess(String provider) { WelcomeBackPasswordPrompt.createIntent( getContext(), getFlowParams(), - new IdpResponse.Builder( + new IdpResponse.Builder(new User.Builder( EmailAuthProvider.PROVIDER_ID, - email).build()), + email).build()).build()), RegisterEmailActivity.RC_WELCOME_BACK_IDP); } else { getActivity().startActivityForResult( WelcomeBackIdpPrompt.createIntent( getContext(), getFlowParams(), - new User.Builder(email) - .setProvider(provider) + new User.Builder(provider, email) .build(), - new IdpResponse.Builder( + new IdpResponse.Builder(new User.Builder( EmailAuthProvider.PROVIDER_ID, - email).build()), + email).build()).build()), RegisterEmailActivity.RC_WELCOME_BACK_IDP); } } diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/idp/CredentialSignInHandler.java b/auth/src/main/java/com/firebase/ui/auth/ui/idp/CredentialSignInHandler.java index 6c71bda91..63fafb578 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/idp/CredentialSignInHandler.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/idp/CredentialSignInHandler.java @@ -25,7 +25,7 @@ import com.firebase.ui.auth.ResultCodes; import com.firebase.ui.auth.provider.ProviderUtils; import com.firebase.ui.auth.ui.HelperActivityBase; -import com.firebase.ui.auth.ui.User; +import com.firebase.ui.auth.User; import com.firebase.ui.auth.ui.accountlink.WelcomeBackIdpPrompt; import com.firebase.ui.auth.ui.accountlink.WelcomeBackPasswordPrompt; import com.firebase.ui.auth.util.signincontainer.SaveSmartLock; @@ -115,9 +115,7 @@ public void onSuccess(String provider) { WelcomeBackIdpPrompt.createIntent( mActivity, mActivity.getFlowParams(), - new User.Builder(mResponse.getEmail()) - .setProvider(provider) - .build(), + new User.Builder(provider, mResponse.getEmail()).build(), mResponse), mAccountLinkRequestCode); } diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/phone/PhoneVerificationActivity.java b/auth/src/main/java/com/firebase/ui/auth/ui/phone/PhoneVerificationActivity.java index b94c0b0cc..4d4adc8d8 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/phone/PhoneVerificationActivity.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/phone/PhoneVerificationActivity.java @@ -31,6 +31,7 @@ import com.firebase.ui.auth.IdpResponse; import com.firebase.ui.auth.R; import com.firebase.ui.auth.ResultCodes; +import com.firebase.ui.auth.User; import com.firebase.ui.auth.ui.AppCompatBase; import com.firebase.ui.auth.ui.ExtraConstants; import com.firebase.ui.auth.ui.FlowParameters; @@ -287,8 +288,10 @@ private void showSubmitCodeFragment() { } private void finish(FirebaseUser user) { - IdpResponse response = new IdpResponse.Builder(PhoneAuthProvider.PROVIDER_ID, null) - .setPhoneNumber(user.getPhoneNumber()) + IdpResponse response = new IdpResponse.Builder( + new User.Builder(PhoneAuthProvider.PROVIDER_ID, null) + .setPhoneNumber(user.getPhoneNumber()) + .build()) .build(); setResult(ResultCodes.OK, response.toIntent()); finish(); diff --git a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/IdpSignInContainer.java b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/IdpSignInContainer.java index de54081e7..8132f84c2 100644 --- a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/IdpSignInContainer.java +++ b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/IdpSignInContainer.java @@ -38,7 +38,7 @@ import com.firebase.ui.auth.ui.FragmentBase; import com.firebase.ui.auth.ui.HelperActivityBase; import com.firebase.ui.auth.ui.TaskFailureLogger; -import com.firebase.ui.auth.ui.User; +import com.firebase.ui.auth.User; import com.firebase.ui.auth.ui.idp.CredentialSignInHandler; import com.google.firebase.auth.AuthCredential; import com.google.firebase.auth.FacebookAuthProvider; @@ -88,7 +88,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) { mSaveSmartLock = getAuthHelper().getSaveSmartLockInstance(mActivity); User user = User.getUser(getArguments()); - String provider = user.getProvider(); + String provider = user.getProviderId(); AuthUI.IdpConfig providerConfig = null; for (AuthUI.IdpConfig config : getFlowParams().providerInfo) { diff --git a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java index 8c20475d8..0ea606e7e 100644 --- a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java +++ b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java @@ -19,7 +19,7 @@ import com.firebase.ui.auth.ui.ExtraConstants; import com.firebase.ui.auth.ui.FlowParameters; import com.firebase.ui.auth.ui.TaskFailureLogger; -import com.firebase.ui.auth.ui.User; +import com.firebase.ui.auth.User; import com.firebase.ui.auth.ui.email.RegisterEmailActivity; import com.firebase.ui.auth.ui.idp.AuthMethodPickerActivity; import com.firebase.ui.auth.ui.phone.PhoneVerificationActivity; @@ -273,7 +273,8 @@ private void startAuthMethodChoice() { */ private void signInWithEmailAndPassword(String email, String password) { final IdpResponse response = - new IdpResponse.Builder(EmailAuthProvider.PROVIDER_ID, email).build(); + new IdpResponse.Builder(new User.Builder(EmailAuthProvider.PROVIDER_ID, email).build()) + .build(); getAuthHelper().getFirebaseAuth() .signInWithEmailAndPassword(email, password) @@ -341,8 +342,7 @@ private void redirectToIdpSignIn(String email, String accountType) { IdpSignInContainer.signIn( getActivity(), getFlowParams(), - new User.Builder(email) - .setProvider(accountTypeToProviderId(accountType)) + new User.Builder(SmartLockBase.accountTypeToProviderId(accountType), email) .build()); } else { Log.w(TAG, "Unknown provider: " + accountType); diff --git a/auth/src/test/java/com/firebase/ui/auth/ui/email/RegisterEmailActivityTest.java b/auth/src/test/java/com/firebase/ui/auth/ui/email/RegisterEmailActivityTest.java index b3f7b60f3..091297d5c 100644 --- a/auth/src/test/java/com/firebase/ui/auth/ui/email/RegisterEmailActivityTest.java +++ b/auth/src/test/java/com/firebase/ui/auth/ui/email/RegisterEmailActivityTest.java @@ -23,13 +23,13 @@ import com.firebase.ui.auth.AuthUI; import com.firebase.ui.auth.BuildConfig; import com.firebase.ui.auth.R; +import com.firebase.ui.auth.User; import com.firebase.ui.auth.testhelpers.AuthHelperShadow; import com.firebase.ui.auth.testhelpers.AutoCompleteTask; import com.firebase.ui.auth.testhelpers.CustomRobolectricGradleTestRunner; import com.firebase.ui.auth.testhelpers.FakeAuthResult; import com.firebase.ui.auth.testhelpers.TestConstants; import com.firebase.ui.auth.testhelpers.TestHelper; -import com.firebase.ui.auth.ui.User; import com.google.firebase.auth.EmailAuthProvider; import com.google.firebase.auth.UserProfileChangeRequest; @@ -74,7 +74,8 @@ public void testSignUpButton_validatesFields() { RegisterEmailActivity registerEmailActivity = createActivity(); // Trigger RegisterEmailFragment (bypass check email) - registerEmailActivity.onNewUser(new User.Builder(TestConstants.EMAIL).build()); + registerEmailActivity.onNewUser( + new User.Builder(EmailAuthProvider.PROVIDER_ID, TestConstants.EMAIL).build()); Button button = (Button) registerEmailActivity.findViewById(R.id.button_create); button.performClick(); @@ -108,10 +109,11 @@ public void testSignUpButton_successfulRegistrationShouldContinueToSaveCredentia RegisterEmailActivity registerEmailActivity = createActivity(); // Trigger new user UI (bypassing check email) - registerEmailActivity.onNewUser(new User.Builder(TestConstants.EMAIL) - .setName(TestConstants.NAME) - .setPhotoUri(TestConstants.PHOTO_URI) - .build()); + registerEmailActivity.onNewUser( + new User.Builder(EmailAuthProvider.PROVIDER_ID, TestConstants.EMAIL) + .setName(TestConstants.NAME) + .setPhotoUri(TestConstants.PHOTO_URI) + .build()); EditText name = (EditText) registerEmailActivity.findViewById(R.id.name); EditText password = (EditText) registerEmailActivity.findViewById(R.id.password); diff --git a/auth/src/test/java/com/firebase/ui/auth/ui/email/WelcomeBackPasswordPromptTest.java b/auth/src/test/java/com/firebase/ui/auth/ui/email/WelcomeBackPasswordPromptTest.java index b5d67f57e..850134354 100644 --- a/auth/src/test/java/com/firebase/ui/auth/ui/email/WelcomeBackPasswordPromptTest.java +++ b/auth/src/test/java/com/firebase/ui/auth/ui/email/WelcomeBackPasswordPromptTest.java @@ -22,6 +22,7 @@ import com.firebase.ui.auth.BuildConfig; import com.firebase.ui.auth.IdpResponse; import com.firebase.ui.auth.R; +import com.firebase.ui.auth.User; import com.firebase.ui.auth.testhelpers.AuthHelperShadow; import com.firebase.ui.auth.testhelpers.AutoCompleteTask; import com.firebase.ui.auth.testhelpers.CustomRobolectricGradleTestRunner; @@ -61,8 +62,10 @@ private WelcomeBackPasswordPrompt createActivity() { Intent startIntent = WelcomeBackPasswordPrompt.createIntent( RuntimeEnvironment.application, TestHelper.getFlowParameters(Collections.emptyList()), - new IdpResponse.Builder(EmailAuthProvider.PROVIDER_ID, - TestConstants.EMAIL).build()); + new IdpResponse.Builder( + new User.Builder(EmailAuthProvider.PROVIDER_ID, TestConstants.EMAIL) + .build()) + .build()); return Robolectric .buildActivity(WelcomeBackPasswordPrompt.class) .withIntent(startIntent) diff --git a/auth/src/test/java/com/firebase/ui/auth/ui/idp/CredentialSignInHandlerTest.java b/auth/src/test/java/com/firebase/ui/auth/ui/idp/CredentialSignInHandlerTest.java index eb2b79365..9d24b60c7 100644 --- a/auth/src/test/java/com/firebase/ui/auth/ui/idp/CredentialSignInHandlerTest.java +++ b/auth/src/test/java/com/firebase/ui/auth/ui/idp/CredentialSignInHandlerTest.java @@ -18,6 +18,7 @@ import com.firebase.ui.auth.BuildConfig; import com.firebase.ui.auth.IdpResponse; +import com.firebase.ui.auth.User; import com.firebase.ui.auth.testhelpers.AuthHelperShadow; import com.firebase.ui.auth.testhelpers.AutoCompleteTask; import com.firebase.ui.auth.testhelpers.CustomRobolectricGradleTestRunner; @@ -28,7 +29,6 @@ import com.firebase.ui.auth.ui.AppCompatBase; import com.firebase.ui.auth.ui.FlowParameters; import com.firebase.ui.auth.ui.ProgressDialogHolder; -import com.firebase.ui.auth.ui.User; import com.firebase.ui.auth.ui.accountlink.WelcomeBackIdpPrompt; import com.firebase.ui.auth.ui.accountlink.WelcomeBackPasswordPrompt; import com.firebase.ui.auth.util.AuthHelper; @@ -78,7 +78,9 @@ public void setUp() { public void testSignInSucceeded() { AppCompatBase mockActivity = mock(AppCompatBase.class); IdpResponse idpResponse = - new IdpResponse.Builder(GoogleAuthProvider.PROVIDER_ID, TestConstants.EMAIL) + new IdpResponse.Builder( + new User.Builder(GoogleAuthProvider.PROVIDER_ID, TestConstants.EMAIL) + .build()) .setToken(TestConstants.TOKEN) .build(); SaveSmartLock smartLock = mock(SaveSmartLock.class); @@ -116,7 +118,9 @@ public void testSignInSucceeded() { public void testSignInFailed_withFacebookAlreadyLinked() { AppCompatBase mockActivity = mock(AppCompatBase.class); IdpResponse idpResponse = - new IdpResponse.Builder(GoogleAuthProvider.PROVIDER_ID, TestConstants.EMAIL) + new IdpResponse.Builder( + new User.Builder(GoogleAuthProvider.PROVIDER_ID, TestConstants.EMAIL) + .build()) .setToken(TestConstants.TOKEN) .build(); CredentialSignInHandler credentialSignInHandler = new CredentialSignInHandler( @@ -161,7 +165,7 @@ public void testSignInFailed_withFacebookAlreadyLinked() { capturedUser.getEmail()); assertEquals( FacebookAuthProvider.PROVIDER_ID, - capturedUser.getProvider()); + capturedUser.getProviderId()); } @@ -170,7 +174,9 @@ public void testSignInFailed_withFacebookAlreadyLinked() { public void testSignInFailed_withPasswordAccountAlreadyLinked() { AppCompatBase mockActivity = mock(AppCompatBase.class); IdpResponse idpResponse = - new IdpResponse.Builder(GoogleAuthProvider.PROVIDER_ID, TestConstants.EMAIL) + new IdpResponse.Builder( + new User.Builder(GoogleAuthProvider.PROVIDER_ID, TestConstants.EMAIL) + .build()) .setToken(TestConstants.TOKEN) .build(); CredentialSignInHandler credentialSignInHandler = new CredentialSignInHandler( From 0f5540707054c2937df1647f490fc5283d884613 Mon Sep 17 00:00:00 2001 From: Willie Chalmers III Date: Thu, 20 Jul 2017 15:29:39 -0500 Subject: [PATCH 2/9] Use resource prefix for library resources (#796) --- auth/build.gradle | 2 + auth/lint.xml | 6 + auth/src/main/AndroidManifest.xml | 28 ++-- .../ui/auth/provider/EmailProvider.java | 4 +- .../ui/auth/provider/FacebookProvider.java | 4 +- .../ui/auth/provider/GoogleProvider.java | 6 +- .../ui/auth/provider/PhoneProvider.java | 4 +- .../ui/auth/provider/TwitterProvider.java | 4 +- .../ui/accountlink/WelcomeBackIdpPrompt.java | 8 +- .../WelcomeBackPasswordPrompt.java | 8 +- .../ui/auth/ui/email/CheckEmailFragment.java | 4 +- .../ui/auth/ui/email/PreambleHandler.java | 12 +- .../ui/email/RecoverPasswordActivity.java | 6 +- .../ui/email/RecoveryEmailSentDialog.java | 4 +- .../auth/ui/email/RegisterEmailActivity.java | 6 +- .../auth/ui/email/RegisterEmailFragment.java | 18 +-- .../fieldvalidators/EmailFieldValidator.java | 4 +- .../PasswordFieldValidator.java | 2 +- .../RequiredFieldValidator.java | 2 +- .../auth/ui/idp/AuthMethodPickerActivity.java | 4 +- .../ui/phone/CompletableProgressDialog.java | 2 +- .../ui/auth/ui/phone/CountryListAdapter.java | 2 +- .../ui/phone/PhoneVerificationActivity.java | 26 ++-- .../phone/SubmitConfirmationCodeFragment.java | 10 +- .../ui/phone/VerifyPhoneNumberFragment.java | 10 +- .../util/signincontainer/SaveSmartLock.java | 2 +- .../util/signincontainer/SignInDelegate.java | 2 +- .../util/signincontainer/SmartLockBase.java | 4 +- ...de_in_right.xml => fui_slide_in_right.xml} | 0 ...de_out_left.xml => fui_slide_out_left.xml} | 0 ...check_mark.xml => fui_done_check_mark.xml} | 0 ...2dp.xml => fui_ic_facebook_white_22dp.xml} | 0 ...24dp.xml => fui_ic_googleg_color_24dp.xml} | 0 ...te_24dp.xml => fui_ic_mail_white_24dp.xml} | 0 ...l => fui_ic_settings_phone_white_24dp.xml} | 0 ...xml => fui_ic_twitter_bird_white_24dp.xml} | 0 ...ml => fui_idp_button_background_email.xml} | 0 ...=> fui_idp_button_background_facebook.xml} | 0 ...l => fui_idp_button_background_google.xml} | 0 ...ml => fui_idp_button_background_phone.xml} | 0 ... => fui_idp_button_background_twitter.xml} | 0 ....xml => fui_auth_method_picker_layout.xml} | 6 +- ...il.xml => fui_activity_register_email.xml} | 0 ...ne.xml => fui_activity_register_phone.xml} | 0 ....xml => fui_auth_method_picker_layout.xml} | 2 +- ..._layout.xml => fui_check_email_layout.xml} | 2 +- ...t.xml => fui_confirmation_code_layout.xml} | 14 +- ...untry_row.xml => fui_dgts_country_row.xml} | 0 ...out.xml => fui_forgot_password_layout.xml} | 6 +- ...cebook.xml => fui_idp_button_facebook.xml} | 2 +- ...n_google.xml => fui_idp_button_google.xml} | 2 +- ...twitter.xml => fui_idp_button_twitter.xml} | 2 +- ...> fui_include_auth_method_picker_logo.xml} | 2 +- ...{phone_layout.xml => fui_phone_layout.xml} | 6 +- ...alog.xml => fui_phone_progress_dialog.xml} | 4 +- ...mail.xml => fui_provider_button_email.xml} | 2 +- ...hone.xml => fui_provider_button_phone.xml} | 2 +- ...yout.xml => fui_register_email_layout.xml} | 10 +- ...=> fui_welcome_back_idp_prompt_layout.xml} | 4 +- ...i_welcome_back_password_prompt_layout.xml} | 8 +- auth/src/main/res/values-b+es+419/strings.xml | 141 +++++++++-------- auth/src/main/res/values-bg/strings.xml | 141 +++++++++-------- auth/src/main/res/values-bn/strings.xml | 141 +++++++++-------- auth/src/main/res/values-ca/strings.xml | 141 +++++++++-------- auth/src/main/res/values-cs/strings.xml | 143 +++++++++-------- auth/src/main/res/values-da/strings.xml | 141 +++++++++-------- auth/src/main/res/values-de-rAT/strings.xml | 141 +++++++++-------- auth/src/main/res/values-de-rCH/strings.xml | 141 +++++++++-------- auth/src/main/res/values-de/strings.xml | 141 +++++++++-------- auth/src/main/res/values-el/strings.xml | 141 +++++++++-------- auth/src/main/res/values-en-rAU/strings.xml | 141 +++++++++-------- auth/src/main/res/values-en-rCA/strings.xml | 141 +++++++++-------- auth/src/main/res/values-en-rGB/strings.xml | 141 +++++++++-------- auth/src/main/res/values-en-rIE/strings.xml | 141 +++++++++-------- auth/src/main/res/values-en-rIN/strings.xml | 141 +++++++++-------- auth/src/main/res/values-en-rSG/strings.xml | 141 +++++++++-------- auth/src/main/res/values-en-rZA/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rAR/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rBO/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rCL/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rCO/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rCR/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rDO/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rEC/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rGT/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rHN/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rMX/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rNI/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rPA/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rPE/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rPR/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rPY/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rSV/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rUS/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rUY/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es-rVE/strings.xml | 141 +++++++++-------- auth/src/main/res/values-es/strings.xml | 141 +++++++++-------- auth/src/main/res/values-fa/strings.xml | 141 +++++++++-------- auth/src/main/res/values-fi/strings.xml | 141 +++++++++-------- auth/src/main/res/values-fil/strings.xml | 141 +++++++++-------- auth/src/main/res/values-fr-rCH/strings.xml | 141 +++++++++-------- auth/src/main/res/values-fr/strings.xml | 141 +++++++++-------- auth/src/main/res/values-gsw/strings.xml | 141 +++++++++-------- auth/src/main/res/values-gu/strings.xml | 141 +++++++++-------- auth/src/main/res/values-hi/strings.xml | 141 +++++++++-------- auth/src/main/res/values-hr/strings.xml | 142 +++++++++-------- auth/src/main/res/values-hu/strings.xml | 141 +++++++++-------- auth/src/main/res/values-in/strings.xml | 141 +++++++++-------- auth/src/main/res/values-it/strings.xml | 141 +++++++++-------- auth/src/main/res/values-ja/strings.xml | 141 +++++++++-------- auth/src/main/res/values-kn/strings.xml | 141 +++++++++-------- auth/src/main/res/values-ko/strings.xml | 141 +++++++++-------- auth/src/main/res/values-ln/strings.xml | 141 +++++++++-------- auth/src/main/res/values-lt/strings.xml | 143 +++++++++-------- auth/src/main/res/values-lv/strings.xml | 142 +++++++++-------- auth/src/main/res/values-mo/strings.xml | 142 +++++++++-------- auth/src/main/res/values-mr/strings.xml | 141 +++++++++-------- auth/src/main/res/values-ms/strings.xml | 141 +++++++++-------- auth/src/main/res/values-nb/strings.xml | 141 +++++++++-------- auth/src/main/res/values-nl/strings.xml | 141 +++++++++-------- auth/src/main/res/values-no/strings.xml | 141 +++++++++-------- auth/src/main/res/values-pl/strings.xml | 143 +++++++++-------- auth/src/main/res/values-pt-rBR/strings.xml | 141 +++++++++-------- auth/src/main/res/values-pt-rPT/strings.xml | 141 +++++++++-------- auth/src/main/res/values-pt/strings.xml | 141 +++++++++-------- auth/src/main/res/values-ro/strings.xml | 142 +++++++++-------- auth/src/main/res/values-ru/strings.xml | 143 +++++++++-------- auth/src/main/res/values-sk/strings.xml | 143 +++++++++-------- auth/src/main/res/values-sl/strings.xml | 143 +++++++++-------- auth/src/main/res/values-sr/strings.xml | 142 +++++++++-------- auth/src/main/res/values-sv/strings.xml | 141 +++++++++-------- auth/src/main/res/values-sw360dp/dimens.xml | 16 +- auth/src/main/res/values-ta/strings.xml | 141 +++++++++-------- auth/src/main/res/values-th/strings.xml | 141 +++++++++-------- auth/src/main/res/values-tl/strings.xml | 141 +++++++++-------- auth/src/main/res/values-tr/strings.xml | 141 +++++++++-------- auth/src/main/res/values-uk/strings.xml | 143 +++++++++-------- auth/src/main/res/values-ur/strings.xml | 141 +++++++++-------- auth/src/main/res/values-vi/strings.xml | 141 +++++++++-------- auth/src/main/res/values-zh-rCN/strings.xml | 141 +++++++++-------- auth/src/main/res/values-zh-rHK/strings.xml | 141 +++++++++-------- auth/src/main/res/values-zh-rTW/strings.xml | 141 +++++++++-------- auth/src/main/res/values-zh/strings.xml | 141 +++++++++-------- auth/src/main/res/values/attrs.xml | 4 +- auth/src/main/res/values/colors.xml | 12 +- auth/src/main/res/values/config.xml | 3 +- auth/src/main/res/values/dimens.xml | 16 +- auth/src/main/res/values/strings.xml | 146 +++++++++--------- auth/src/main/res/values/styles.xml | 51 +++--- auth/src/main/res/values/values.xml | 2 +- .../ui/email/RegisterEmailActivityTest.java | 8 +- .../email/WelcomeBackPasswordPromptTest.java | 2 +- .../phone/PhoneVerificationActivityTest.java | 8 +- library/src/main/res/values/strings.xml | 1 - scripts/translations/add_string_prefix.py | 27 ++++ scripts/translations/base_string_script.py | 92 ++++++++--- scripts/translations/clean_up_translations.sh | 5 + scripts/translations/export_translations.py | 29 ++++ scripts/translations/fix_typography.py | 3 +- .../translations/remove_non_translatable.py | 6 +- 160 files changed, 6072 insertions(+), 6208 deletions(-) create mode 100644 auth/lint.xml rename auth/src/main/res/anim/{slide_in_right.xml => fui_slide_in_right.xml} (100%) rename auth/src/main/res/anim/{slide_out_left.xml => fui_slide_out_left.xml} (100%) rename auth/src/main/res/drawable/{done_check_mark.xml => fui_done_check_mark.xml} (100%) rename auth/src/main/res/drawable/{ic_facebook_white_22dp.xml => fui_ic_facebook_white_22dp.xml} (100%) rename auth/src/main/res/drawable/{ic_googleg_color_24dp.xml => fui_ic_googleg_color_24dp.xml} (100%) rename auth/src/main/res/drawable/{ic_mail_white_24dp.xml => fui_ic_mail_white_24dp.xml} (100%) rename auth/src/main/res/drawable/{ic_settings_phone_white_24dp.xml => fui_ic_settings_phone_white_24dp.xml} (100%) rename auth/src/main/res/drawable/{ic_twitter_bird_white_24dp.xml => fui_ic_twitter_bird_white_24dp.xml} (100%) rename auth/src/main/res/drawable/{idp_button_background_email.xml => fui_idp_button_background_email.xml} (100%) rename auth/src/main/res/drawable/{idp_button_background_facebook.xml => fui_idp_button_background_facebook.xml} (100%) rename auth/src/main/res/drawable/{idp_button_background_google.xml => fui_idp_button_background_google.xml} (100%) rename auth/src/main/res/drawable/{idp_button_background_phone.xml => fui_idp_button_background_phone.xml} (100%) rename auth/src/main/res/drawable/{idp_button_background_twitter.xml => fui_idp_button_background_twitter.xml} (100%) rename auth/src/main/res/layout-land/{auth_method_picker_layout.xml => fui_auth_method_picker_layout.xml} (82%) rename auth/src/main/res/layout/{activity_register_email.xml => fui_activity_register_email.xml} (100%) rename auth/src/main/res/layout/{activity_register_phone.xml => fui_activity_register_phone.xml} (100%) rename auth/src/main/res/layout/{auth_method_picker_layout.xml => fui_auth_method_picker_layout.xml} (88%) rename auth/src/main/res/layout/{check_email_layout.xml => fui_check_email_layout.xml} (95%) rename auth/src/main/res/layout/{confirmation_code_layout.xml => fui_confirmation_code_layout.xml} (90%) rename auth/src/main/res/layout/{dgts__country_row.xml => fui_dgts_country_row.xml} (100%) rename auth/src/main/res/layout/{forgot_password_layout.xml => fui_forgot_password_layout.xml} (87%) rename auth/src/main/res/layout/{idp_button_facebook.xml => fui_idp_button_facebook.xml} (84%) rename auth/src/main/res/layout/{idp_button_google.xml => fui_idp_button_google.xml} (84%) rename auth/src/main/res/layout/{idp_button_twitter.xml => fui_idp_button_twitter.xml} (84%) rename auth/src/main/res/layout/{include_auth_method_picker_logo.xml => fui_include_auth_method_picker_logo.xml} (85%) rename auth/src/main/res/layout/{phone_layout.xml => fui_phone_layout.xml} (91%) rename auth/src/main/res/layout/{phone_progress_dialog.xml => fui_phone_progress_dialog.xml} (93%) rename auth/src/main/res/layout/{provider_button_email.xml => fui_provider_button_email.xml} (86%) rename auth/src/main/res/layout/{provider_button_phone.xml => fui_provider_button_phone.xml} (86%) rename auth/src/main/res/layout/{register_email_layout.xml => fui_register_email_layout.xml} (91%) rename auth/src/main/res/layout/{welcome_back_idp_prompt_layout.xml => fui_welcome_back_idp_prompt_layout.xml} (90%) rename auth/src/main/res/layout/{welcome_back_password_prompt_layout.xml => fui_welcome_back_password_prompt_layout.xml} (89%) create mode 100644 scripts/translations/add_string_prefix.py create mode 100644 scripts/translations/export_translations.py diff --git a/auth/build.gradle b/auth/build.gradle index 8613ea5a2..56154ce00 100644 --- a/auth/build.gradle +++ b/auth/build.gradle @@ -10,6 +10,8 @@ android { targetSdkVersion targetSdk versionCode 1 versionName "1.0" + + resourcePrefix "fui_" } buildTypes { diff --git a/auth/lint.xml b/auth/lint.xml new file mode 100644 index 000000000..c4af12697 --- /dev/null +++ b/auth/lint.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/auth/src/main/AndroidManifest.xml b/auth/src/main/AndroidManifest.xml index f3a1db420..d5c7d6959 100644 --- a/auth/src/main/AndroidManifest.xml +++ b/auth/src/main/AndroidManifest.xml @@ -32,38 +32,38 @@ + android:label="@string/fui_title_recover_password_activity" + android:exported="false"/> + android:label="@string/fui_sign_in_default" + android:exported="false"/> + android:label="@string/fui_sign_in_with_phone_number" + android:windowSoftInputMode="stateAlwaysVisible" + android:exported="false"/> + android:label="@string/fui_title_welcome_back_idp_prompt" + android:exported="false"/> + android:label="@string/fui_title_welcome_back_password_prompt" + android:exported="false"/> + android:label="@string/fui_default_toolbar_title" + android:exported="false"/> diff --git a/auth/src/main/java/com/firebase/ui/auth/provider/EmailProvider.java b/auth/src/main/java/com/firebase/ui/auth/provider/EmailProvider.java index d9de4f6c3..4f73a9808 100644 --- a/auth/src/main/java/com/firebase/ui/auth/provider/EmailProvider.java +++ b/auth/src/main/java/com/firebase/ui/auth/provider/EmailProvider.java @@ -23,13 +23,13 @@ public EmailProvider(Activity activity, FlowParameters flowParameters) { @Override public String getName(Context context) { - return context.getString(R.string.provider_name_email); + return context.getString(R.string.fui_provider_name_email); } @Override @LayoutRes public int getButtonLayout() { - return R.layout.provider_button_email; + return R.layout.fui_provider_button_email; } @Override diff --git a/auth/src/main/java/com/firebase/ui/auth/provider/FacebookProvider.java b/auth/src/main/java/com/firebase/ui/auth/provider/FacebookProvider.java index ed7fd6d42..59bf2a2f9 100644 --- a/auth/src/main/java/com/firebase/ui/auth/provider/FacebookProvider.java +++ b/auth/src/main/java/com/firebase/ui/auth/provider/FacebookProvider.java @@ -76,13 +76,13 @@ public static AuthCredential createAuthCredential(IdpResponse response) { @Override public String getName(Context context) { - return context.getString(R.string.idp_name_facebook); + return context.getString(R.string.fui_idp_name_facebook); } @Override @LayoutRes public int getButtonLayout() { - return R.layout.idp_button_facebook; + return R.layout.fui_idp_button_facebook; } @Override diff --git a/auth/src/main/java/com/firebase/ui/auth/provider/GoogleProvider.java b/auth/src/main/java/com/firebase/ui/auth/provider/GoogleProvider.java index c91c32707..960c6e368 100644 --- a/auth/src/main/java/com/firebase/ui/auth/provider/GoogleProvider.java +++ b/auth/src/main/java/com/firebase/ui/auth/provider/GoogleProvider.java @@ -92,13 +92,13 @@ private GoogleSignInOptions getSignInOptions(@Nullable String email) { @Override public String getName(Context context) { - return context.getString(R.string.idp_name_google); + return context.getString(R.string.fui_idp_name_google); } @Override @LayoutRes public int getButtonLayout() { - return R.layout.idp_button_google; + return R.layout.fui_idp_button_google; } @Override @@ -133,7 +133,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { Toast.makeText( mActivity, mActivity.getString( - R.string.signed_in_with_specific_account, + R.string.fui_signed_in_with_specific_account, result.getSignInAccount().getEmail()), Toast.LENGTH_SHORT).show(); } diff --git a/auth/src/main/java/com/firebase/ui/auth/provider/PhoneProvider.java b/auth/src/main/java/com/firebase/ui/auth/provider/PhoneProvider.java index 81b51465d..0af5e6e6d 100644 --- a/auth/src/main/java/com/firebase/ui/auth/provider/PhoneProvider.java +++ b/auth/src/main/java/com/firebase/ui/auth/provider/PhoneProvider.java @@ -24,13 +24,13 @@ public PhoneProvider(Activity activity, FlowParameters parameters) { @Override public String getName(Context context) { - return context.getString(R.string.provider_name_phone); + return context.getString(R.string.fui_provider_name_phone); } @Override @LayoutRes public int getButtonLayout() { - return R.layout.provider_button_phone; + return R.layout.fui_provider_button_phone; } @Override diff --git a/auth/src/main/java/com/firebase/ui/auth/provider/TwitterProvider.java b/auth/src/main/java/com/firebase/ui/auth/provider/TwitterProvider.java index 2faf7f37a..65dd7bf8a 100644 --- a/auth/src/main/java/com/firebase/ui/auth/provider/TwitterProvider.java +++ b/auth/src/main/java/com/firebase/ui/auth/provider/TwitterProvider.java @@ -67,13 +67,13 @@ private static void signOut() throws IllegalStateException { @Override public String getName(Context context) { - return context.getString(R.string.idp_name_twitter); + return context.getString(R.string.fui_idp_name_twitter); } @Override @LayoutRes public int getButtonLayout() { - return R.layout.idp_button_twitter; + return R.layout.fui_idp_button_twitter; } @Override diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackIdpPrompt.java b/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackIdpPrompt.java index df796f6b1..eb44b9f8b 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackIdpPrompt.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackIdpPrompt.java @@ -73,7 +73,7 @@ public static Intent createIntent( @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.welcome_back_idp_prompt_layout); + setContentView(R.layout.fui_welcome_back_idp_prompt_layout); IdpResponse newUserIdpResponse = IdpResponse.fromResultIntent(getIntent()); mPrevCredential = ProviderUtils.getAuthCredential(newUserIdpResponse); @@ -118,14 +118,14 @@ protected void onCreate(Bundle savedInstanceState) { findViewById(R.id.welcome_back_idp_button).setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { - getDialogHolder().showLoadingDialog(R.string.progress_dialog_signing_in); + getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_signing_in); mIdpProvider.startLogin(WelcomeBackIdpPrompt.this); } }); } private String getIdpPromptString(String email) { - return getString(R.string.welcome_back_idp_prompt, email, mIdpProvider.getName(this)); + return getString(R.string.fui_welcome_back_idp_prompt, email, mIdpProvider.getName(this)); } @Override @@ -191,7 +191,7 @@ public void onFailure() { } private void finishWithError() { - Toast.makeText(this, R.string.general_error, Toast.LENGTH_LONG).show(); + Toast.makeText(this, R.string.fui_general_error, Toast.LENGTH_LONG).show(); finish(ResultCodes.CANCELED, IdpResponse.getErrorCodeIntent(ErrorCodes.UNKNOWN_ERROR)); } diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackPasswordPrompt.java b/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackPasswordPrompt.java index 7a0a20ad4..5f4e85022 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackPasswordPrompt.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/accountlink/WelcomeBackPasswordPrompt.java @@ -79,7 +79,7 @@ public static Intent createIntent( @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.welcome_back_password_prompt_layout); + setContentView(R.layout.fui_welcome_back_password_prompt_layout); // Show keyboard getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); @@ -94,7 +94,7 @@ protected void onCreate(Bundle savedInstanceState) { ImeHelper.setImeOnDoneListener(mPasswordField, this); // Create welcome back text with email bolded. - String bodyText = getString(R.string.welcome_back_password_prompt_body, mEmail); + String bodyText = getString(R.string.fui_welcome_back_password_prompt_body, mEmail); SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(bodyText); int emailStart = bodyText.indexOf(mEmail); @@ -137,12 +137,12 @@ private void validateAndSignIn() { private void validateAndSignIn(final String email, final String password) { // Check for null or empty password if (TextUtils.isEmpty(password)) { - mPasswordLayout.setError(getString(R.string.required_field)); + mPasswordLayout.setError(getString(R.string.fui_required_field)); return; } else { mPasswordLayout.setError(null); } - getDialogHolder().showLoadingDialog(R.string.progress_dialog_signing_in); + getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_signing_in); final FirebaseAuth firebaseAuth = getAuthHelper().getFirebaseAuth(); diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/email/CheckEmailFragment.java b/auth/src/main/java/com/firebase/ui/auth/ui/email/CheckEmailFragment.java index 68ed57d0c..552145c40 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/email/CheckEmailFragment.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/email/CheckEmailFragment.java @@ -99,7 +99,7 @@ public static CheckEmailFragment newInstance(@NonNull FlowParameters flowParamet public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { - View v = inflater.inflate(R.layout.check_email_layout, container, false); + View v = inflater.inflate(R.layout.fui_check_email_layout, container, false); // Email field and validator mEmailLayout = (TextInputLayout) v.findViewById(R.id.email_layout); @@ -179,7 +179,7 @@ private void validateAndProceed() { } private void checkAccountExists(@NonNull final String email) { - getDialogHolder().showLoadingDialog(R.string.progress_dialog_checking_accounts); + getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_checking_accounts); // Get name from SmartLock, if possible String name = null; diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/email/PreambleHandler.java b/auth/src/main/java/com/firebase/ui/auth/ui/email/PreambleHandler.java index 06ebb1d51..4c6d853db 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/email/PreambleHandler.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/email/PreambleHandler.java @@ -35,7 +35,7 @@ public PreambleHandler(Context context, FlowParameters parameters, @StringRes in mContext = context; mFlowParameters = parameters; mButtonText = buttonText; - mLinkSpan = new ForegroundColorSpan(ContextCompat.getColor(mContext, R.color.linkColor)); + mLinkSpan = new ForegroundColorSpan(ContextCompat.getColor(mContext, R.color.fui_linkColor)); setupCreateAccountPreamble(); } @@ -54,8 +54,8 @@ private void setupCreateAccountPreamble() { mBuilder = new SpannableStringBuilder(withTargets); replaceTarget(BTN_TARGET, mButtonText); - replaceUrlTarget(TOS_TARGET, R.string.terms_of_service, mFlowParameters.termsOfServiceUrl); - replaceUrlTarget(PP_TARGET, R.string.privacy_policy, mFlowParameters.privacyPolicyUrl); + replaceUrlTarget(TOS_TARGET, R.string.fui_terms_of_service, mFlowParameters.termsOfServiceUrl); + replaceUrlTarget(PP_TARGET, R.string.fui_privacy_policy, mFlowParameters.privacyPolicyUrl); } private void replaceTarget(String target, @StringRes int replacementRes) { @@ -84,13 +84,13 @@ private String getPreambleStringWithTargets() { boolean hasPp = !TextUtils.isEmpty(mFlowParameters.privacyPolicyUrl); if (hasTos && hasPp) { - return mContext.getString(R.string.create_account_preamble_tos_and_pp, + return mContext.getString(R.string.fui_create_account_preamble_tos_and_pp, BTN_TARGET, TOS_TARGET, PP_TARGET); } else if (hasTos) { - return mContext.getString(R.string.create_account_preamble_tos_only, + return mContext.getString(R.string.fui_create_account_preamble_tos_only, BTN_TARGET, TOS_TARGET); } else if (hasPp) { - return mContext.getString(R.string.create_account_preamble_pp_only, + return mContext.getString(R.string.fui_create_account_preamble_pp_only, BTN_TARGET, PP_TARGET); } else { return null; diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/email/RecoverPasswordActivity.java b/auth/src/main/java/com/firebase/ui/auth/ui/email/RecoverPasswordActivity.java index a13458df0..3c3a7631d 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/email/RecoverPasswordActivity.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/email/RecoverPasswordActivity.java @@ -52,7 +52,7 @@ public static Intent createIntent(Context context, FlowParameters flowParams, St @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.forgot_password_layout); + setContentView(R.layout.fui_forgot_password_layout); mEmailFieldValidator = new EmailFieldValidator((TextInputLayout) findViewById(R.id.email_layout)); @@ -86,7 +86,7 @@ public void onFailure(@NonNull Exception e) { if (e instanceof FirebaseAuthInvalidUserException) { // No FirebaseUser exists with this email address, show error. - mEmailEditText.setError(getString(R.string.error_email_does_not_exist)); + mEmailEditText.setError(getString(R.string.fui_error_email_does_not_exist)); } } }); @@ -96,7 +96,7 @@ public void onFailure(@NonNull Exception e) { public void onClick(View view) { if (view.getId() == R.id.button_done) { if (mEmailFieldValidator.validate(mEmailEditText.getText())) { - getDialogHolder().showLoadingDialog(R.string.progress_dialog_sending); + getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_sending); next(mEmailEditText.getText().toString()); } } diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/email/RecoveryEmailSentDialog.java b/auth/src/main/java/com/firebase/ui/auth/ui/email/RecoveryEmailSentDialog.java index 25f5ee508..41f74336c 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/email/RecoveryEmailSentDialog.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/email/RecoveryEmailSentDialog.java @@ -30,8 +30,8 @@ public static void show(String email, FragmentManager manager) { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { return new AlertDialog.Builder(getContext()) - .setTitle(R.string.title_confirm_recover_password) - .setMessage(getString(R.string.confirm_recovery_body, + .setTitle(R.string.fui_title_confirm_recover_password) + .setMessage(getString(R.string.fui_confirm_recovery_body, getArguments().getString(ExtraConstants.EXTRA_EMAIL))) .setOnDismissListener(new DialogInterface.OnDismissListener() { @Override diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailActivity.java b/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailActivity.java index c9ae9507d..c1ec3fc52 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailActivity.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailActivity.java @@ -55,7 +55,7 @@ public static Intent createIntent(Context context, FlowParameters flowParams, St @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_register_email); + setContentView(R.layout.fui_activity_register_email); if (savedInstanceState != null) { return; @@ -132,12 +132,12 @@ public void onNewUser(User user) { ft.disallowAddToBackStack().commit(); } else { - emailLayout.setError(getString(R.string.error_email_does_not_exist)); + emailLayout.setError(getString(R.string.fui_error_email_does_not_exist)); } } private void setSlideAnimation() { // Make the next activity slide in - overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); + overridePendingTransition(R.anim.fui_slide_in_right, R.anim.fui_slide_out_left); } } diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailFragment.java b/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailFragment.java index c1ed59d94..728c18091 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailFragment.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/email/RegisterEmailFragment.java @@ -94,7 +94,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { - View v = inflater.inflate(R.layout.register_email_layout, container, false); + View v = inflater.inflate(R.layout.fui_register_email_layout, container, false); mEmailEditText = (EditText) v.findViewById(R.id.email); mNameEditText = (EditText) v.findViewById(R.id.name); @@ -105,7 +105,7 @@ public View onCreateView(LayoutInflater inflater, mPasswordFieldValidator = new PasswordFieldValidator( mPasswordInput, - getResources().getInteger(R.integer.min_password_length)); + getResources().getInteger(R.integer.fui_min_password_length)); mNameValidator = new RequiredFieldValidator( (TextInputLayout) v.findViewById(R.id.name_layout)); mEmailFieldValidator = new EmailFieldValidator(mEmailInput); @@ -158,7 +158,7 @@ public void run() { @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - getActivity().setTitle(R.string.title_register_email); + getActivity().setTitle(R.string.fui_title_register_email); if (!(getActivity() instanceof HelperActivityBase)) { throw new RuntimeException("Must be attached to a HelperActivityBase."); @@ -166,7 +166,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) { mActivity = (HelperActivityBase) getActivity(); mSaveSmartLock = getAuthHelper().getSaveSmartLockInstance(mActivity); - new PreambleHandler(getContext(), getFlowParams(), R.string.button_text_save) + new PreambleHandler(getContext(), getFlowParams(), R.string.fui_button_text_save) .setPreamble(mAgreementText); } @@ -215,7 +215,7 @@ private void validateAndRegisterUser() { boolean passwordValid = mPasswordFieldValidator.validate(password); boolean nameValid = mNameValidator.validate(name); if (emailValid && passwordValid && nameValid) { - getDialogHolder().showLoadingDialog(R.string.progress_dialog_signing_up); + getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_signing_up); registerUser(email, name, password); } } @@ -261,10 +261,10 @@ public void onFailure(@NonNull Exception e) { if (e instanceof FirebaseAuthWeakPasswordException) { // Password too weak mPasswordInput.setError(getResources().getQuantityString( - R.plurals.error_weak_password, R.integer.min_password_length)); + R.plurals.fui_error_weak_password, R.integer.fui_min_password_length)); } else if (e instanceof FirebaseAuthInvalidCredentialsException) { // Email address is malformed - mEmailInput.setError(getString(R.string.invalid_email_address)); + mEmailInput.setError(getString(R.string.fui_invalid_email_address)); } else if (e instanceof FirebaseAuthUserCollisionException) { // Collision with existing user email, it should be very hard for // the user to even get to this error due to CheckEmailFragment. @@ -276,7 +276,7 @@ public void onFailure(@NonNull Exception e) { @Override public void onSuccess(String provider) { Toast.makeText(getContext(), - R.string.error_user_collision, + R.string.fui_error_user_collision, Toast.LENGTH_LONG) .show(); @@ -319,7 +319,7 @@ public void onComplete(@NonNull Task task) { } else { // General error message, this branch should not be invoked but // covers future API changes - mEmailInput.setError(getString(R.string.email_account_creation_error)); + mEmailInput.setError(getString(R.string.fui_email_account_creation_error)); } getDialogHolder().dismissDialog(); diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/email/fieldvalidators/EmailFieldValidator.java b/auth/src/main/java/com/firebase/ui/auth/ui/email/fieldvalidators/EmailFieldValidator.java index cb4bf0e00..81403644a 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/email/fieldvalidators/EmailFieldValidator.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/email/fieldvalidators/EmailFieldValidator.java @@ -23,8 +23,8 @@ public class EmailFieldValidator extends BaseValidator { public EmailFieldValidator(TextInputLayout errorContainer) { super(errorContainer); - mErrorMessage = mErrorContainer.getResources().getString(R.string.invalid_email_address); - mEmptyMessage = mErrorContainer.getResources().getString(R.string.missing_email_address); + mErrorMessage = mErrorContainer.getResources().getString(R.string.fui_invalid_email_address); + mEmptyMessage = mErrorContainer.getResources().getString(R.string.fui_missing_email_address); } @Override diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/email/fieldvalidators/PasswordFieldValidator.java b/auth/src/main/java/com/firebase/ui/auth/ui/email/fieldvalidators/PasswordFieldValidator.java index fd60ad720..3316e3385 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/email/fieldvalidators/PasswordFieldValidator.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/email/fieldvalidators/PasswordFieldValidator.java @@ -25,7 +25,7 @@ public PasswordFieldValidator(TextInputLayout errorContainer, int minLength) { super(errorContainer); mMinLength = minLength; mErrorMessage = mErrorContainer.getResources() - .getQuantityString(R.plurals.error_weak_password, mMinLength, mMinLength); + .getQuantityString(R.plurals.fui_error_weak_password, mMinLength, mMinLength); } @Override diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/email/fieldvalidators/RequiredFieldValidator.java b/auth/src/main/java/com/firebase/ui/auth/ui/email/fieldvalidators/RequiredFieldValidator.java index 3a56d7b4e..a6ba4ee0a 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/email/fieldvalidators/RequiredFieldValidator.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/email/fieldvalidators/RequiredFieldValidator.java @@ -21,7 +21,7 @@ public class RequiredFieldValidator extends BaseValidator { public RequiredFieldValidator(TextInputLayout errorContainer) { super(errorContainer); - mErrorMessage = mErrorContainer.getResources().getString(R.string.required_field); + mErrorMessage = mErrorContainer.getResources().getString(R.string.fui_required_field); } @Override diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/idp/AuthMethodPickerActivity.java b/auth/src/main/java/com/firebase/ui/auth/ui/idp/AuthMethodPickerActivity.java index 771d2ad0d..2232bde54 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/idp/AuthMethodPickerActivity.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/idp/AuthMethodPickerActivity.java @@ -72,7 +72,7 @@ public static Intent createIntent(Context context, FlowParameters flowParams) { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.auth_method_picker_layout); + setContentView(R.layout.fui_auth_method_picker_layout); mSaveSmartLock = getAuthHelper().getSaveSmartLockInstance(this); populateIdpList(getFlowParams().providerInfo); @@ -121,7 +121,7 @@ private void populateIdpList(List providers) { @Override public void onClick(View view) { if (provider instanceof IdpProvider) { - getDialogHolder().showLoadingDialog(R.string.progress_dialog_loading); + getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_loading); } provider.startLogin(AuthMethodPickerActivity.this); } diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/phone/CompletableProgressDialog.java b/auth/src/main/java/com/firebase/ui/auth/ui/phone/CompletableProgressDialog.java index 978f8336f..3f46e9149 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/phone/CompletableProgressDialog.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/phone/CompletableProgressDialog.java @@ -41,7 +41,7 @@ public CompletableProgressDialog(Context context, int theme) { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.phone_progress_dialog); + setContentView(R.layout.fui_phone_progress_dialog); mProgress = (ProgressBar) findViewById(R.id.progress_bar); mMessageView = (TextView) findViewById(R.id.progress_msg); diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListAdapter.java b/auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListAdapter.java index 505896928..a657b814f 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListAdapter.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListAdapter.java @@ -38,7 +38,7 @@ final class CountryListAdapter extends ArrayAdapter implements Sect private String[] sections; public CountryListAdapter(Context context) { - super(context, R.layout.dgts__country_row, android.R.id.text1); + super(context, R.layout.fui_dgts_country_row, android.R.id.text1); } // The list of countries should be sorted using locale-sensitive string comparison diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/phone/PhoneVerificationActivity.java b/auth/src/main/java/com/firebase/ui/auth/ui/phone/PhoneVerificationActivity.java index 4d4adc8d8..0a3864dd1 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/phone/PhoneVerificationActivity.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/phone/PhoneVerificationActivity.java @@ -83,7 +83,7 @@ public static Intent createIntent(Context context, FlowParameters flowParams, St @Override protected void onCreate(final Bundle savedInstance) { super.onCreate(savedInstance); - setContentView(R.layout.activity_register_phone); + setContentView(R.layout.fui_activity_register_phone); mHandler = new Handler(); mVerificationState = VerificationState.VERIFICATION_NOT_STARTED; @@ -151,14 +151,14 @@ protected void onDestroy() { void verifyPhoneNumber(String phoneNumber, boolean forceResend) { sendCode(phoneNumber, forceResend); if (forceResend) { - showLoadingDialog(getString(R.string.resending)); + showLoadingDialog(getString(R.string.fui_resending)); } else { - showLoadingDialog(getString(R.string.verifying)); + showLoadingDialog(getString(R.string.fui_verifying)); } } public void submitConfirmationCode(String confirmationCode) { - showLoadingDialog(getString(R.string.verifying)); + showLoadingDialog(getString(R.string.fui_verifying)); signingWithCreds(PhoneAuthProvider.getCredential(mVerificationId, confirmationCode)); } @@ -172,7 +172,7 @@ private void onVerificationSuccess(@NonNull final PhoneAuthCredential phoneAuthC getSubmitConfirmationCodeFragment(); - showLoadingDialog(getString(R.string.retrieving_sms)); + showLoadingDialog(getString(R.string.fui_retrieving_sms)); if (submitConfirmationCodeFragment != null) { submitConfirmationCodeFragment.setConfirmationCode(String.valueOf (phoneAuthCredential.getSmsCode())); @@ -182,7 +182,7 @@ private void onVerificationSuccess(@NonNull final PhoneAuthCredential phoneAuthC } private void onCodeSent() { - completeLoadingDialog(getString(R.string.code_sent)); + completeLoadingDialog(getString(R.string.fui_code_sent)); mHandler.postDelayed(new Runnable() { @Override public void run() { @@ -204,15 +204,15 @@ private void onVerificationFailed(@NonNull FirebaseException ex) { switch (error) { case ERROR_INVALID_PHONE_NUMBER: - verifyPhoneNumberFragment.showError(getString(R.string.invalid_phone_number)); + verifyPhoneNumberFragment.showError(getString(R.string.fui_invalid_phone_number)); dismissLoadingDialog(); break; case ERROR_TOO_MANY_REQUESTS: - showAlertDialog(getString(R.string.error_too_many_attempts), null); + showAlertDialog(getString(R.string.fui_error_too_many_attempts), null); dismissLoadingDialog(); break; case ERROR_QUOTA_EXCEEDED: - showAlertDialog(getString(R.string.error_quota_exceeded), null); + showAlertDialog(getString(R.string.fui_error_quota_exceeded), null); dismissLoadingDialog(); break; default: @@ -301,7 +301,7 @@ private void showAlertDialog(@NonNull String s, DialogInterface.OnClickListener onClickListener) { mAlertDialog = new AlertDialog.Builder(this) .setMessage(s) - .setPositiveButton(R.string.incorrect_code_dialog_positive_button_text, onClickListener) + .setPositiveButton(R.string.fui_incorrect_code_dialog_positive_button_text, onClickListener) .show(); } @@ -312,7 +312,7 @@ private void signingWithCreds(@NonNull PhoneAuthCredential phoneAuthCredential) @Override public void onSuccess(final AuthResult authResult) { mVerificationState = VerificationState.VERIFIED; - completeLoadingDialog(getString(R.string.verified)); + completeLoadingDialog(getString(R.string.fui_verified)); // Activity can be recreated before this message is handled mHandler.postDelayed(new Runnable() { @@ -338,7 +338,7 @@ public void onFailure(@NonNull Exception e) { switch (error) { case ERROR_INVALID_VERIFICATION_CODE: showAlertDialog( - getString(R.string.incorrect_code_dialog_body), + getString(R.string.fui_incorrect_code_dialog_body), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -349,7 +349,7 @@ public void onClick(DialogInterface dialog, int which) { break; case ERROR_SESSION_EXPIRED: showAlertDialog( - getString(R.string.error_session_expired), + getString(R.string.fui_error_session_expired), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/phone/SubmitConfirmationCodeFragment.java b/auth/src/main/java/com/firebase/ui/auth/ui/phone/SubmitConfirmationCodeFragment.java index 974587cf2..12cc1300e 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/phone/SubmitConfirmationCodeFragment.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/phone/SubmitConfirmationCodeFragment.java @@ -71,7 +71,7 @@ public static SubmitConfirmationCodeFragment newInstance(FlowParameters flowPara @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { - View v = inflater.inflate(R.layout.confirmation_code_layout, container, false); + View v = inflater.inflate(R.layout.fui_confirmation_code_layout, container, false); FragmentActivity parentActivity = getActivity(); mEditPhoneTextView = (TextView) v.findViewById(R.id.edit_phone_number); @@ -83,7 +83,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, final String phoneNumber = getArguments().getString(ExtraConstants.EXTRA_PHONE); - parentActivity.setTitle(getString(R.string.verify_your_phone_title)); + parentActivity.setTitle(getString(R.string.fui_verify_your_phone_title)); setupConfirmationCodeEditText(); setupEditPhoneNumberTextView(phoneNumber); setupCountDown(RESEND_WAIT_MILLIS); @@ -129,7 +129,7 @@ public void onSaveInstanceState(Bundle outState) { } private void setTimer(long millisUntilFinished) { - mCountDownTextView.setText(String.format(getString(R.string.resend_code_in), + mCountDownTextView.setText(String.format(getString(R.string.fui_resend_code_in), timeRoundedToSeconds(millisUntilFinished))); } @@ -140,7 +140,7 @@ public void onClick(View v) { mVerifier.verifyPhoneNumber(phoneNumber, true); mResendCodeTextView.setVisibility(View.GONE); mCountDownTextView.setVisibility(View.VISIBLE); - mCountDownTextView.setText(String.format(getString(R.string.resend_code_in), + mCountDownTextView.setText(String.format(getString(R.string.fui_resend_code_in), RESEND_WAIT_MILLIS / 1000)); mCountdownTimer.renew(); } @@ -208,7 +208,7 @@ private void cancelTimer() { } private void setUpTermsOfService() { - new PreambleHandler(getContext(), getFlowParams(), R.string.continue_phone_login) + new PreambleHandler(getContext(), getFlowParams(), R.string.fui_continue_phone_login) .setPreamble(mAgreementText); } diff --git a/auth/src/main/java/com/firebase/ui/auth/ui/phone/VerifyPhoneNumberFragment.java b/auth/src/main/java/com/firebase/ui/auth/ui/phone/VerifyPhoneNumberFragment.java index b963a51fc..7c8ae7850 100644 --- a/auth/src/main/java/com/firebase/ui/auth/ui/phone/VerifyPhoneNumberFragment.java +++ b/auth/src/main/java/com/firebase/ui/auth/ui/phone/VerifyPhoneNumberFragment.java @@ -86,7 +86,7 @@ public void onAttach(Context context) { public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { - View v = inflater.inflate(R.layout.phone_layout, container, false); + View v = inflater.inflate(R.layout.fui_phone_layout, container, false); countryListSpinner = (CountryListSpinner) v.findViewById(R.id.country_list); mPhoneEditText = (EditText) v.findViewById(R.id.phone_number); @@ -95,7 +95,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, mSmsTermsText = (TextView) v.findViewById(R.id.send_sms_tos); FragmentActivity parentActivity = getActivity(); - parentActivity.setTitle(getString(R.string.verify_phone_number_title)); + parentActivity.setTitle(getString(R.string.fui_verify_phone_number_title)); setUpCountrySpinner(); setupSendCodeButton(); setupTerms(); @@ -104,8 +104,8 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, } private void setupTerms() { - final String verifyPhoneButtonText = getString(R.string.verify_phone_number); - final String terms = getString(R.string.sms_terms_of_service, verifyPhoneButtonText); + final String verifyPhoneButtonText = getString(R.string.fui_verify_phone_number); + final String terms = getString(R.string.fui_sms_terms_of_service, verifyPhoneButtonText); mSmsTermsText.setText(terms); } @@ -168,7 +168,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { public void onClick(View v) { String phoneNumber = getPseudoValidPhoneNumber(); if (phoneNumber == null) { - errorEditText.setText(R.string.invalid_phone_number); + errorEditText.setText(R.string.fui_invalid_phone_number); } else { mVerifier.verifyPhoneNumber(phoneNumber, false); } diff --git a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SaveSmartLock.java b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SaveSmartLock.java index 359c38d91..abd68fd18 100644 --- a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SaveSmartLock.java +++ b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SaveSmartLock.java @@ -120,7 +120,7 @@ public void onConnected(Bundle bundle) { @Override public void onConnectionFailed(@NonNull ConnectionResult connectionResult) { - Toast.makeText(getContext(), R.string.general_error, Toast.LENGTH_SHORT).show(); + Toast.makeText(getContext(), R.string.fui_general_error, Toast.LENGTH_SHORT).show(); PendingIntent resolution = PlayServicesHelper.getGoogleApiAvailability() diff --git a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java index 0ea606e7e..c997c8998 100644 --- a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java +++ b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SignInDelegate.java @@ -94,7 +94,7 @@ public void onCreate(Bundle savedInstance) { FlowParameters flowParams = getFlowParams(); if (flowParams.enableCredentials) { - getDialogHolder().showLoadingDialog(R.string.progress_dialog_loading); + getDialogHolder().showLoadingDialog(R.string.fui_progress_dialog_loading); mGoogleApiClient = new GoogleApiClient.Builder(getContext().getApplicationContext()) .addConnectionCallbacks(this) diff --git a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SmartLockBase.java b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SmartLockBase.java index 5e685d8b0..744456793 100644 --- a/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SmartLockBase.java +++ b/auth/src/main/java/com/firebase/ui/auth/util/signincontainer/SmartLockBase.java @@ -123,7 +123,7 @@ public void onStart() { if (mActivityResultPair != null) { finish(mActivityResultPair.first, mActivityResultPair.second); } else if (mWasProgressDialogShowing) { - getDialogHolder().showLoadingDialog(com.firebase.ui.auth.R.string.progress_dialog_loading); + getDialogHolder().showLoadingDialog(com.firebase.ui.auth.R.string.fui_progress_dialog_loading); mWasProgressDialogShowing = false; } } @@ -158,7 +158,7 @@ public void finish(int resultCode, Intent resultIntent) { @Override public void onConnectionFailed(@NonNull ConnectionResult connectionResult) { Toast.makeText(getContext(), - com.firebase.ui.auth.R.string.general_error, + com.firebase.ui.auth.R.string.fui_general_error, Toast.LENGTH_SHORT).show(); } diff --git a/auth/src/main/res/anim/slide_in_right.xml b/auth/src/main/res/anim/fui_slide_in_right.xml similarity index 100% rename from auth/src/main/res/anim/slide_in_right.xml rename to auth/src/main/res/anim/fui_slide_in_right.xml diff --git a/auth/src/main/res/anim/slide_out_left.xml b/auth/src/main/res/anim/fui_slide_out_left.xml similarity index 100% rename from auth/src/main/res/anim/slide_out_left.xml rename to auth/src/main/res/anim/fui_slide_out_left.xml diff --git a/auth/src/main/res/drawable/done_check_mark.xml b/auth/src/main/res/drawable/fui_done_check_mark.xml similarity index 100% rename from auth/src/main/res/drawable/done_check_mark.xml rename to auth/src/main/res/drawable/fui_done_check_mark.xml diff --git a/auth/src/main/res/drawable/ic_facebook_white_22dp.xml b/auth/src/main/res/drawable/fui_ic_facebook_white_22dp.xml similarity index 100% rename from auth/src/main/res/drawable/ic_facebook_white_22dp.xml rename to auth/src/main/res/drawable/fui_ic_facebook_white_22dp.xml diff --git a/auth/src/main/res/drawable/ic_googleg_color_24dp.xml b/auth/src/main/res/drawable/fui_ic_googleg_color_24dp.xml similarity index 100% rename from auth/src/main/res/drawable/ic_googleg_color_24dp.xml rename to auth/src/main/res/drawable/fui_ic_googleg_color_24dp.xml diff --git a/auth/src/main/res/drawable/ic_mail_white_24dp.xml b/auth/src/main/res/drawable/fui_ic_mail_white_24dp.xml similarity index 100% rename from auth/src/main/res/drawable/ic_mail_white_24dp.xml rename to auth/src/main/res/drawable/fui_ic_mail_white_24dp.xml diff --git a/auth/src/main/res/drawable/ic_settings_phone_white_24dp.xml b/auth/src/main/res/drawable/fui_ic_settings_phone_white_24dp.xml similarity index 100% rename from auth/src/main/res/drawable/ic_settings_phone_white_24dp.xml rename to auth/src/main/res/drawable/fui_ic_settings_phone_white_24dp.xml diff --git a/auth/src/main/res/drawable/ic_twitter_bird_white_24dp.xml b/auth/src/main/res/drawable/fui_ic_twitter_bird_white_24dp.xml similarity index 100% rename from auth/src/main/res/drawable/ic_twitter_bird_white_24dp.xml rename to auth/src/main/res/drawable/fui_ic_twitter_bird_white_24dp.xml diff --git a/auth/src/main/res/drawable/idp_button_background_email.xml b/auth/src/main/res/drawable/fui_idp_button_background_email.xml similarity index 100% rename from auth/src/main/res/drawable/idp_button_background_email.xml rename to auth/src/main/res/drawable/fui_idp_button_background_email.xml diff --git a/auth/src/main/res/drawable/idp_button_background_facebook.xml b/auth/src/main/res/drawable/fui_idp_button_background_facebook.xml similarity index 100% rename from auth/src/main/res/drawable/idp_button_background_facebook.xml rename to auth/src/main/res/drawable/fui_idp_button_background_facebook.xml diff --git a/auth/src/main/res/drawable/idp_button_background_google.xml b/auth/src/main/res/drawable/fui_idp_button_background_google.xml similarity index 100% rename from auth/src/main/res/drawable/idp_button_background_google.xml rename to auth/src/main/res/drawable/fui_idp_button_background_google.xml diff --git a/auth/src/main/res/drawable/idp_button_background_phone.xml b/auth/src/main/res/drawable/fui_idp_button_background_phone.xml similarity index 100% rename from auth/src/main/res/drawable/idp_button_background_phone.xml rename to auth/src/main/res/drawable/fui_idp_button_background_phone.xml diff --git a/auth/src/main/res/drawable/idp_button_background_twitter.xml b/auth/src/main/res/drawable/fui_idp_button_background_twitter.xml similarity index 100% rename from auth/src/main/res/drawable/idp_button_background_twitter.xml rename to auth/src/main/res/drawable/fui_idp_button_background_twitter.xml diff --git a/auth/src/main/res/layout-land/auth_method_picker_layout.xml b/auth/src/main/res/layout-land/fui_auth_method_picker_layout.xml similarity index 82% rename from auth/src/main/res/layout-land/auth_method_picker_layout.xml rename to auth/src/main/res/layout-land/fui_auth_method_picker_layout.xml index 93d3b32f4..854299b7f 100644 --- a/auth/src/main/res/layout-land/auth_method_picker_layout.xml +++ b/auth/src/main/res/layout-land/fui_auth_method_picker_layout.xml @@ -10,10 +10,10 @@ android:orientation="horizontal"> + android:layout_weight="1.0" /> + android:paddingTop="@dimen/fui_auth_method_button_marginBottom" /> diff --git a/auth/src/main/res/layout/activity_register_email.xml b/auth/src/main/res/layout/fui_activity_register_email.xml similarity index 100% rename from auth/src/main/res/layout/activity_register_email.xml rename to auth/src/main/res/layout/fui_activity_register_email.xml diff --git a/auth/src/main/res/layout/activity_register_phone.xml b/auth/src/main/res/layout/fui_activity_register_phone.xml similarity index 100% rename from auth/src/main/res/layout/activity_register_phone.xml rename to auth/src/main/res/layout/fui_activity_register_phone.xml diff --git a/auth/src/main/res/layout/auth_method_picker_layout.xml b/auth/src/main/res/layout/fui_auth_method_picker_layout.xml similarity index 88% rename from auth/src/main/res/layout/auth_method_picker_layout.xml rename to auth/src/main/res/layout/fui_auth_method_picker_layout.xml index 0b775db34..909f8d452 100644 --- a/auth/src/main/res/layout/auth_method_picker_layout.xml +++ b/auth/src/main/res/layout/fui_auth_method_picker_layout.xml @@ -8,7 +8,7 @@ android:gravity="center|bottom" android:orientation="vertical"> - + + android:text="@string/fui_next_default" /> diff --git a/auth/src/main/res/layout/confirmation_code_layout.xml b/auth/src/main/res/layout/fui_confirmation_code_layout.xml similarity index 90% rename from auth/src/main/res/layout/confirmation_code_layout.xml rename to auth/src/main/res/layout/fui_confirmation_code_layout.xml index feebef937..0a41198ae 100644 --- a/auth/src/main/res/layout/confirmation_code_layout.xml +++ b/auth/src/main/res/layout/fui_confirmation_code_layout.xml @@ -16,7 +16,7 @@ style="@style/FirebaseUI.Text.T08" android:layout_width="match_parent" android:layout_height="wrap_content" - android:text="@string/enter_confirmation_code" /> + android:text="@string/fui_enter_confirmation_code" /> + android:text="@string/fui_continue_phone_login" /> @@ -95,7 +95,7 @@ style="@style/FirebaseUI.Text.BodyText" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/field_padding_vert" + android:layout_marginTop="@dimen/fui_field_padding_vert" android:layout_below="@id/resend_code_layout" android:textIsSelectable="false" tools:text="@string/create_account_preamble" /> diff --git a/auth/src/main/res/layout/dgts__country_row.xml b/auth/src/main/res/layout/fui_dgts_country_row.xml similarity index 100% rename from auth/src/main/res/layout/dgts__country_row.xml rename to auth/src/main/res/layout/fui_dgts_country_row.xml diff --git a/auth/src/main/res/layout/forgot_password_layout.xml b/auth/src/main/res/layout/fui_forgot_password_layout.xml similarity index 87% rename from auth/src/main/res/layout/forgot_password_layout.xml rename to auth/src/main/res/layout/fui_forgot_password_layout.xml index be7c58cd8..ff0551ca8 100644 --- a/auth/src/main/res/layout/forgot_password_layout.xml +++ b/auth/src/main/res/layout/fui_forgot_password_layout.xml @@ -12,7 +12,7 @@ + android:text="@string/fui_password_recovery_body" />