Merge "Fix PATTERN UI to align PIN&PASSWORD screen" into pi-dev
am: 644c707590
Change-Id: Ia63f197d24e5055adfadd8c8a4cd09c37f3aa47b
This commit is contained in:
@@ -82,7 +82,7 @@
|
||||
android:minLines="2"
|
||||
android:gravity="center"
|
||||
android:paddingHorizontal="?attr/suwMarginSides"
|
||||
android:textSize="18sp" />
|
||||
android:textSize="12sp" />
|
||||
|
||||
<com.android.setupwizardlib.view.FillContentLayout
|
||||
style="@style/LockPatternContainerStyle"
|
||||
|
@@ -128,5 +128,7 @@
|
||||
<color name="homepage_generic_icon_background">#1A73E8</color>
|
||||
<!-- End of dashboard/homepage icon background colors -->
|
||||
|
||||
<color name="glif_error_color">@*android:color/material_red_A700</color>
|
||||
|
||||
</resources>
|
||||
|
||||
|
@@ -3531,6 +3531,8 @@
|
||||
<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]-->
|
||||
<string name="lockpassword_confirm_pins_dont_match">PINs don\u2019t match</string>
|
||||
<!-- Header on pattern confirm screen [CHAR LIMIT=40] -->
|
||||
<string name="lockpassword_draw_your_pattern_again_header">Draw your pattern again</string>
|
||||
<!-- Header shown to ask the user to select an unlock method [CHAR LIMIT=30] -->
|
||||
<string name="lockpassword_choose_lock_generic_header">Unlock selection</string>
|
||||
<!-- Toast shown if setting password was successful -->
|
||||
|
@@ -53,6 +53,7 @@
|
||||
<item name="preferenceTheme">@style/PreferenceTheme.SetupWizard</item>
|
||||
|
||||
<item name="*android:lockPatternStyle">@style/LockPatternStyle.Setup</item>
|
||||
<item name="*android:colorError">@color/glif_error_color</item>
|
||||
</style>
|
||||
|
||||
<style name="GlifV2Theme" parent="SuwThemeGlifV2">
|
||||
@@ -88,6 +89,7 @@
|
||||
<item name="preferenceTheme">@style/PreferenceTheme.SetupWizard</item>
|
||||
|
||||
<item name="*android:lockPatternStyle">@style/LockPatternStyle.Setup</item>
|
||||
<item name="*android:colorError">@color/glif_error_color</item>
|
||||
</style>
|
||||
|
||||
<style name="GlifV3Theme" parent="SuwThemeGlifV3">
|
||||
@@ -123,6 +125,7 @@
|
||||
<item name="preferenceTheme">@style/PreferenceTheme.SetupWizard</item>
|
||||
|
||||
<item name="*android:lockPatternStyle">@style/LockPatternStyle.Setup</item>
|
||||
<item name="*android:colorError">@color/glif_error_color</item>
|
||||
</style>
|
||||
|
||||
<style name="SetupWizardTheme.Transparent" parent="GlifTheme">
|
||||
|
@@ -20,9 +20,11 @@ import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources.Theme;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -171,6 +173,7 @@ public class ChooseLockPattern extends SettingsActivity {
|
||||
private String mCurrentPattern;
|
||||
private boolean mHasChallenge;
|
||||
private long mChallenge;
|
||||
protected TextView mTitleText;
|
||||
protected TextView mHeaderText;
|
||||
protected TextView mMessageText;
|
||||
protected LockPatternView mLockPatternView;
|
||||
@@ -179,6 +182,7 @@ public class ChooseLockPattern extends SettingsActivity {
|
||||
private TextView mFooterRightButton;
|
||||
protected List<LockPatternView.Cell> mChosenPattern = null;
|
||||
private boolean mHideDrawer = false;
|
||||
private ColorStateList mDefaultHeaderColorList;
|
||||
|
||||
// ScrollView that contains title and header, only exist in land mode
|
||||
private ScrollView mTitleHeaderScrollView;
|
||||
@@ -265,6 +269,9 @@ public class ChooseLockPattern extends SettingsActivity {
|
||||
|
||||
private void patternInProgress() {
|
||||
mHeaderText.setText(R.string.lockpattern_recording_inprogress);
|
||||
if (mDefaultHeaderColorList != null) {
|
||||
mHeaderText.setTextColor(mDefaultHeaderColorList);
|
||||
}
|
||||
mFooterText.setText("");
|
||||
mFooterLeftButton.setEnabled(false);
|
||||
mFooterRightButton.setEnabled(false);
|
||||
@@ -465,10 +472,13 @@ public class ChooseLockPattern extends SettingsActivity {
|
||||
return layout;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mTitleText = view.findViewById(R.id.suw_layout_title);
|
||||
mHeaderText = (TextView) view.findViewById(R.id.headerText);
|
||||
mDefaultHeaderColorList = mHeaderText.getTextColors();
|
||||
mMessageText = view.findViewById(R.id.message);
|
||||
mLockPatternView = (LockPatternView) view.findViewById(R.id.lockPattern);
|
||||
mLockPatternView.setOnPatternListener(mChooseNewLockPatternListener);
|
||||
@@ -664,6 +674,23 @@ public class ChooseLockPattern extends SettingsActivity {
|
||||
mFooterText.setText(stage.footerMessage);
|
||||
}
|
||||
|
||||
if (stage == Stage.ConfirmWrong || stage == Stage.ChoiceTooShort) {
|
||||
TypedValue typedValue = new TypedValue();
|
||||
Theme theme = getActivity().getTheme();
|
||||
theme.resolveAttribute(R.attr.colorError, typedValue, true);
|
||||
mHeaderText.setTextColor(typedValue.data);
|
||||
|
||||
} else {
|
||||
if (mDefaultHeaderColorList != null) {
|
||||
mHeaderText.setTextColor(mDefaultHeaderColorList);
|
||||
}
|
||||
|
||||
if (stage == Stage.NeedToConfirm && mForFingerprint) {
|
||||
mHeaderText.setText("");
|
||||
mTitleText.setText(R.string.lockpassword_draw_your_pattern_again_header);
|
||||
}
|
||||
}
|
||||
|
||||
updateFooterLeftButton(stage, mFooterLeftButton);
|
||||
|
||||
setRightButtonText(stage.rightMode.text);
|
||||
|
Reference in New Issue
Block a user