Skip to content

Commit 7d3d0b0

Browse files
author
Aaron Mandle
committed
update strings to the latest from the doc
Change-Id: I8e36ce73e96b5d5e21d5b656bf258e8056f2c155
1 parent 8df2f11 commit 7d3d0b0

File tree

6 files changed

+22
-20
lines changed

6 files changed

+22
-20
lines changed

auth/src/main/java/com/firebase/ui/auth/ui/account_link/WelcomeBackPasswordPrompt.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@ protected void onCreate(Bundle savedInstanceState) {
5454
setContentView(R.layout.welcome_back_password_prompt_layout);
5555
mPasswordLayout = (TextInputLayout) findViewById(R.id.password_layout);
5656
mEmail = getIntent().getStringExtra(ControllerConstants.EXTRA_EMAIL);
57-
String appName = getIntent().getStringExtra(ControllerConstants.EXTRA_APP_NAME);
5857
TextView bodyTextView = (TextView) findViewById(R.id.welcome_back_password_body);
5958
String bodyText = getResources().getString(R.string.welcome_back_password_prompt_body);
60-
bodyText = String.format(bodyText, mEmail, appName);
59+
bodyText = String.format(bodyText, mEmail);
6160
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(bodyText);
6261
int emailStart = bodyText.indexOf(mEmail);
6362
spannableStringBuilder.setSpan(bold, emailStart, emailStart + mEmail.length(), Spannable

auth/src/main/java/com/firebase/ui/auth/ui/email/field_validators/BaseValidator.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
public class BaseValidator {
2020
protected TextInputLayout mErrorContainer;
2121
protected String mErrorMessage = "";
22+
protected String mEmptyMessage = null;
2223

2324
public BaseValidator(TextInputLayout errorContainer) {
2425
mErrorContainer = errorContainer;
@@ -29,7 +30,10 @@ protected boolean isValid(CharSequence charSequence) {
2930
}
3031

3132
public boolean validate(CharSequence charSequence) {
32-
if (isValid(charSequence)) {
33+
if (mEmptyMessage != null && (charSequence == null || charSequence.length() == 0)) {
34+
mErrorContainer.setError(mEmptyMessage);
35+
return false;
36+
} else if (isValid(charSequence)) {
3337
mErrorContainer.setError("");
3438
return true;
3539
} else {

auth/src/main/java/com/firebase/ui/auth/ui/email/field_validators/EmailFieldValidator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ public class EmailFieldValidator extends BaseValidator {
2323

2424
public EmailFieldValidator(TextInputLayout errorContainer) {
2525
super(errorContainer);
26-
mErrorMessage = mErrorContainer.getContext().getResources().getString(R.string
27-
.invalid_email_address);
26+
mErrorMessage = mErrorContainer.getContext().getResources().getString(
27+
R.string.invalid_email_address);
28+
mEmptyMessage = mErrorContainer.getResources().getString(R.string.missing_email_address);
2829
}
2930

3031
@Override

auth/src/main/res/layout/welcome_back_password_prompt_layout.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
/>
5959
<Button
6060
style="@style/FirebaseUI.Button"
61-
android:text="@string/button_text_next"
61+
android:text="@string/button_text_sign_in"
6262
android:id="@+id/button_done"/>
6363
</LinearLayout>
6464
</LinearLayout>

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,18 @@
1313
reset your password.</string>
1414
<string name="create_account_title">Create account</string>
1515
<string name="required_field">You can\'t leave this empty.</string>
16-
<string name="password_length">Short passwords are easy to guess. Try one with at least
17-
%1$d characters.</string>
18-
<string name="invalid_email_address">Please enter a valid email address.</string>
16+
<string name="password_length">Strong passwords have at least %1$d characters and a mix of letters
17+
and numbers</string>
18+
<string name="invalid_email_address">That email address isn\'t correct</string>
19+
<string name="missing_email_address">Enter your email address to continue</string>
1920
<string name="button_text_next">Next</string>
2021
<string name="button_text_send">Send</string>
2122
<string name="button_text_save">Save</string>
23+
<string name="button_text_sign_in">Sign in</string>
2224
<string name="require_email_text">Please input email address</string>
2325
<string name="confirm_recovery_body">Follow the instructions sent to %1$s to recover your
2426
password.</string>
25-
<string name="recovery_fail_body">Sorry, we are unable to find your email. Please start the flow again with another email.</string>
27+
<string name="recovery_fail_body">That email address doesn\'t match an existing account</string>
2628
<string name="account_welcomeback">Welcome back</string>
2729
<string name="finding_credential">Finding a credential…</string>
2830
<string name="do_delete">Delete</string>
@@ -38,17 +40,13 @@
3840
<string name="recover_password_title">Recover password</string>
3941
<string name="welcome_back_idp_header">You already have an account</string>
4042
<string name="welcome_back_idp_prompt">
41-
Good news! You\'ve already used
42-
<xliff:g id="email_addr" example="[email protected]">%1$s</xliff:g>.
43-
Sign in with <xliff:g id="provider_name" example="Google">%2$s</xliff:g>
44-
to continue to <xliff:g id="app_name" example="SuperApp">%3$s</xliff:g>.
43+
You've already used <xliff:g id="email_addr" example="[email protected]">%1$s</xliff:g>.
44+
Sign in with <xliff:g id="provider_name" example="Google">%2$s</xliff:g> to continue.
4545
</string>
4646
<string name="welcome_back_idp_button">Sign in</string>
47-
<string name="welcome_back_password_prompt_body">You\'ve previously used this email address:
48-
<xliff:g id="email_addr" example="[email protected]">%1$s</xliff:g> for
49-
<xliff:g id="app_name" example="SuperApp">%2$s</xliff:g>, but signed in with a password.
50-
Enter your <xliff:g id="app_name" example="SuperApp">%2$s</xliff:g> password to remember
51-
this account.</string>
47+
<string name="welcome_back_password_prompt_body">You\'ve already used
48+
<xliff:g id="email_addr" example="[email protected]">%1$s</xliff:g> to sign in. Enter
49+
your password for that account.</string>
5250
<string name="password_word">Password</string>
5351
<string name="idp_name_google">Google</string>
5452
<string name="idp_name_facebook">Facebook</string>

auth/src/main/res/values/values.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<integer name="min_password_length">8</integer>
3+
<integer name="min_password_length">6</integer>
44
<item name="visible_icon" type="dimen" format="float">1.0</item>
55
<item name="slightly_visible_icon" type="dimen" format="float">0.4</item>
66
</resources>

0 commit comments

Comments
 (0)