Update strings for screen lock setup

am: 3eb4c8333e

Change-Id: If48e98edbdc3eb7266ca951e23994942f31c2ef4
This commit is contained in:
Maurice Lam
2017-08-12 00:22:14 +00:00
committed by android-build-merger
4 changed files with 59 additions and 23 deletions

View File

@@ -33,11 +33,11 @@
android:orientation="vertical">
<TextView
android:id="@+id/fingerprint_backup_message"
android:id="@+id/message"
style="@style/SuwDescription.Glif"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
android:minLines="2"/>
<LinearLayout
android:id="@+id/password_container"

View File

@@ -23,4 +23,4 @@
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingTop="@dimen/suw_description_glif_margin_top"
android:paddingBottom="@dimen/suw_description_glif_margin_bottom_lists"
android:text="@string/setup_lock_settings_picker_fingerprint_message" />
android:text="@string/lock_settings_picker_fingerprint_added_security_message" />

View File

@@ -1105,8 +1105,8 @@
<!-- Title for security picker in setup wizard to choose the unlock method: None/Pattern/PIN/Password (phone) [CHAR LIMIT=22] -->
<string name="setup_lock_settings_picker_title" product="default">Protect your phone</string>
<!-- Title for screen in setup wizard, prompting user to choose the their backup screen lock method [CHAR LIMIT=NONE] -->
<string name="setup_lock_settings_picker_fingerprint_message">For added security, set up a backup screen lock.</string>
<!-- Message shown when setting up screen lock, prompting user to choose the their backup screen lock method [CHAR LIMIT=NONE] -->
<string name="lock_settings_picker_fingerprint_added_security_message">For added security, set up a backup screen lock.</string>
<!-- Description text for screen in setup wizard asking user to set up screen lock, explaining to the user how setting up a screen lock protect them from losing data. (tablet) [CHAR LIMIT=NONE] -->
<string name="setup_lock_settings_picker_message" product="tablet">Prevent others from using this tablet without your permission by activating device protection features. Choose the screen lock you want to use.</string>
@@ -3429,24 +3429,26 @@
<string name="settings_safetylegal_activity_loading">Loading\u2026</string>
<!-- Lock Pattern settings -->
<!-- Header on first screen of choose password/PIN flow [CHAR LIMIT=30] -->
<string name="lockpassword_choose_your_password_header">Choose your password</string>
<!-- Header on first screen of choose password/PIN flow [CHAR LIMIT=40] -->
<string name="lockpassword_choose_your_screen_lock_header">Set a screen lock</string>
<!-- Message on first screen of choose password flow [CHAR LIMIT=NONE] -->
<string name="lockpassword_choose_your_password_message">For security, set a password</string>
<!-- Header on first screen of choose password/PIN as backup for fingerprint flow [CHAR LIMIT=30] -->
<string name="lockpassword_choose_your_password_header_for_fingerprint">To use fingerprint, set password</string>
<!-- Header on first screen of choose pattern flow [CHAR LIMIT=30] -->
<string name="lockpassword_choose_your_pattern_header">Choose your pattern</string>
<!-- Header on first screen of choose pattern as backup for fingerprint flow [CHAR LIMIT=30] -->
<string name="lockpassword_choose_your_pattern_header_for_fingerprint">To use fingerprint, set pattern</string>
<!-- Header on first screen of choose password/PIN flow [CHAR LIMIT=30] -->
<string name="lockpassword_choose_your_pin_header">Choose your PIN</string>
<!-- Message on first screen of choose PIN flow [CHAR LIMIT=NONE] -->
<string name="lockpassword_choose_your_pin_message">For security, set a PIN</string>
<!-- Header on first screen of choose password/PIN as backup for fingerprint flow [CHAR LIMIT=30] -->
<string name="lockpassword_choose_your_pin_header_for_fingerprint">To use fingerprint, set PIN</string>
<!-- Header on password confirm screen [CHAR LIMIT=30] -->
<string name="lockpassword_confirm_your_password_header">Confirm your password</string>
<!-- Header on password confirm screen [CHAR LIMIT=40] -->
<string name="lockpassword_confirm_your_password_header">Re-enter your password</string>
<!-- Header on pattern confirm screen [CHAR LIMIT=30] -->
<string name="lockpassword_confirm_your_pattern_header">Confirm your pattern</string>
<!-- Header on password confirm screen [CHAR LIMIT=30] -->
<string name="lockpassword_confirm_your_pin_header">Confirm your PIN</string>
<!-- Header on password confirm screen [CHAR LIMIT=40] -->
<string name="lockpassword_confirm_your_pin_header">Re-enter your PIN</string>
<!-- Header on password confirm screen if second password doesn't match the first. [CHAR LIMIT=30] -->
<string name="lockpassword_confirm_passwords_dont_match">Passwords don\u2019t match</string>
<!-- Header on pin confirm screen if second pin doesn't match the first. [CHAR LIMIT=30]-->

View File

@@ -213,6 +213,7 @@ public class ChooseLockPassword extends SettingsActivity {
protected Button mCancelButton;
private Button mClearButton;
private Button mNextButton;
private TextView mMessage;
private TextChangedHandler mTextChangedHandler;
@@ -247,10 +248,14 @@ public class ChooseLockPassword extends SettingsActivity {
protected enum Stage {
Introduction(
R.string.lockpassword_choose_your_password_header,
R.string.lockpassword_choose_your_screen_lock_header,
R.string.lockpassword_choose_your_password_header_for_fingerprint,
R.string.lockpassword_choose_your_pin_header,
R.string.lockpassword_choose_your_screen_lock_header,
R.string.lockpassword_choose_your_pin_header_for_fingerprint,
R.string.lockpassword_choose_your_password_message,
R.string.lock_settings_picker_fingerprint_added_security_message,
R.string.lockpassword_choose_your_pin_message,
R.string.lock_settings_picker_fingerprint_added_security_message,
R.string.next_label),
NeedToConfirm(
@@ -258,6 +263,10 @@ public class ChooseLockPassword extends SettingsActivity {
R.string.lockpassword_confirm_your_password_header,
R.string.lockpassword_confirm_your_pin_header,
R.string.lockpassword_confirm_your_pin_header,
0,
0,
0,
0,
R.string.lockpassword_ok_label),
ConfirmWrong(
@@ -265,14 +274,25 @@ public class ChooseLockPassword extends SettingsActivity {
R.string.lockpassword_confirm_passwords_dont_match,
R.string.lockpassword_confirm_pins_dont_match,
R.string.lockpassword_confirm_pins_dont_match,
0,
0,
0,
0,
R.string.next_label);
Stage(int hintInAlpha, int hintInAlphaForFingerprint,
int hintInNumeric, int hintInNumericForFingerprint, int nextButtonText) {
int hintInNumeric, int hintInNumericForFingerprint,
int messageInAlpha, int messageInAlphaForFingerprint,
int messageInNumeric, int messageInNumericForFingerprint,
int nextButtonText) {
this.alphaHint = hintInAlpha;
this.alphaHintForFingerprint = hintInAlphaForFingerprint;
this.numericHint = hintInNumeric;
this.numericHintForFingerprint = hintInNumericForFingerprint;
this.alphaMessage = messageInAlpha;
this.alphaMessageForFingerprint = messageInAlphaForFingerprint;
this.numericMessage = messageInNumeric;
this.numericMessageForFingerprint = messageInNumericForFingerprint;
this.buttonText = nextButtonText;
}
@@ -280,6 +300,10 @@ public class ChooseLockPassword extends SettingsActivity {
public final int alphaHintForFingerprint;
public final int numericHint;
public final int numericHintForFingerprint;
public final int alphaMessage;
public final int alphaMessageForFingerprint;
public final int numericMessage;
public final int numericMessageForFingerprint;
public final int buttonText;
public @StringRes int getHint(boolean isAlpha, boolean isFingerprint) {
@@ -289,6 +313,14 @@ public class ChooseLockPassword extends SettingsActivity {
return isFingerprint ? numericHintForFingerprint : numericHint;
}
}
public @StringRes int getMessage(boolean isAlpha, boolean isFingerprint) {
if (isAlpha) {
return isFingerprint ? alphaMessageForFingerprint : alphaMessage;
} else {
return isFingerprint ? numericMessageForFingerprint : numericMessage;
}
}
}
// required constructor for fragments
@@ -351,14 +383,9 @@ public class ChooseLockPassword extends SettingsActivity {
mClearButton = view.findViewById(R.id.clear_button);
mClearButton.setOnClickListener(this);
mMessage = view.findViewById(R.id.message);
if (mForFingerprint) {
TextView fingerprintBackupMessage =
view.findViewById(R.id.fingerprint_backup_message);
if (fingerprintBackupMessage != null) {
fingerprintBackupMessage.setVisibility(View.VISIBLE);
fingerprintBackupMessage
.setText(R.string.setup_lock_settings_picker_fingerprint_message);
}
mLayout.setIcon(getActivity().getDrawable(R.drawable.ic_fingerprint_header));
}
@@ -848,6 +875,13 @@ public class ChooseLockPassword extends SettingsActivity {
setNextEnabled(canInput && length > 0);
mClearButton.setEnabled(canInput && length > 0);
}
int message = mUiStage.getMessage(mIsAlphaMode, mForFingerprint);
if (message != 0) {
mMessage.setVisibility(View.VISIBLE);
mMessage.setText(message);
} else {
mMessage.setVisibility(View.INVISIBLE);
}
mClearButton.setVisibility(toVisibility(mUiStage != Stage.Introduction));
mCancelButton.setVisibility(toVisibility(mUiStage == Stage.Introduction));