Update the layout of Pattern/PIN/Password confirmation
- Using the SUW library API to enable the new style - Removing some obsolete layouts which are using in landscape mode - Verifying that these pages are using the new style Fix: 188438375 Test: visual verified 1) Register a screen lock 2) Navigate to Settings > Security > Screen lock 2) See and check if the Pattern/PIN/Password confirmation page is using the new style Change-Id: I076dbf36388fa3badf4da409bcda83a5b368f13c
This commit is contained in:
@@ -53,6 +53,8 @@ import com.android.settings.R;
|
||||
import com.android.settingslib.animation.AppearAnimationUtils;
|
||||
import com.android.settingslib.animation.DisappearAnimationUtils;
|
||||
|
||||
import com.google.android.setupdesign.GlifLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
@@ -103,14 +105,13 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
private AsyncTask<?, ?, ?> mPendingLockCheck;
|
||||
private CredentialCheckResultTracker mCredentialCheckResultTracker;
|
||||
private boolean mDisappearing = false;
|
||||
private TextView mHeaderTextView;
|
||||
private TextView mDetailsTextView;
|
||||
private CountDownTimer mCountdownTimer;
|
||||
private boolean mIsAlpha;
|
||||
private InputMethodManager mImm;
|
||||
private AppearAnimationUtils mAppearAnimationUtils;
|
||||
private DisappearAnimationUtils mDisappearAnimationUtils;
|
||||
private boolean mIsManagedProfile;
|
||||
private GlifLayout mGlifLayout;
|
||||
|
||||
// required constructor for fragments
|
||||
public ConfirmLockPasswordFragment() {
|
||||
@@ -130,18 +131,12 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
: R.layout.confirm_lock_password,
|
||||
container,
|
||||
false);
|
||||
|
||||
mGlifLayout = view.findViewById(R.id.setup_wizard_layout);
|
||||
mPasswordEntry = (ImeAwareEditText) view.findViewById(R.id.password_entry);
|
||||
mPasswordEntry.setOnEditorActionListener(this);
|
||||
// EditText inside ScrollView doesn't automatically get focus.
|
||||
mPasswordEntry.requestFocus();
|
||||
mPasswordEntryInputDisabler = new TextViewInputDisabler(mPasswordEntry);
|
||||
|
||||
mHeaderTextView = (TextView) view.findViewById(R.id.headerText);
|
||||
if (mHeaderTextView == null) {
|
||||
mHeaderTextView = view.findViewById(R.id.suc_layout_title);
|
||||
}
|
||||
mDetailsTextView = (TextView) view.findViewById(R.id.sud_layout_description);
|
||||
mErrorTextView = (TextView) view.findViewById(R.id.errorText);
|
||||
mIsAlpha = DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC == storedQuality
|
||||
|| DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC == storedQuality
|
||||
@@ -168,8 +163,8 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
if (TextUtils.isEmpty(detailsMessage)) {
|
||||
detailsMessage = getString(getDefaultDetails());
|
||||
}
|
||||
mHeaderTextView.setText(headerMessage);
|
||||
mDetailsTextView.setText(detailsMessage);
|
||||
mGlifLayout.setHeaderText(headerMessage);
|
||||
mGlifLayout.setDescriptionText(detailsMessage);
|
||||
}
|
||||
int currentType = mPasswordEntry.getInputType();
|
||||
if (mIsAlpha) {
|
||||
@@ -194,7 +189,7 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
110, 1f /* translationScale */,
|
||||
0.5f /* delayScale */, AnimationUtils.loadInterpolator(
|
||||
getContext(), android.R.interpolator.fast_out_linear_in));
|
||||
setAccessibilityTitle(mHeaderTextView.getText());
|
||||
setAccessibilityTitle(mGlifLayout.getHeaderText());
|
||||
|
||||
mCredentialCheckResultTracker = (CredentialCheckResultTracker) getFragmentManager()
|
||||
.findFragmentByTag(FRAGMENT_TAG_CHECK_LOCK_RESULT);
|
||||
@@ -278,8 +273,8 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
@Override
|
||||
public void prepareEnterAnimation() {
|
||||
super.prepareEnterAnimation();
|
||||
mHeaderTextView.setAlpha(0f);
|
||||
mDetailsTextView.setAlpha(0f);
|
||||
mGlifLayout.getHeaderTextView().setAlpha(0f);
|
||||
mGlifLayout.getDescriptionTextView().setAlpha(0f);
|
||||
mCancelButton.setAlpha(0f);
|
||||
if (mForgotButton != null) {
|
||||
mForgotButton.setAlpha(0f);
|
||||
@@ -290,8 +285,8 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
|
||||
private View[] getActiveViews() {
|
||||
ArrayList<View> result = new ArrayList<>();
|
||||
result.add(mHeaderTextView);
|
||||
result.add(mDetailsTextView);
|
||||
result.add(mGlifLayout.getHeaderTextView());
|
||||
result.add(mGlifLayout.getDescriptionTextView());
|
||||
if (mCancelButton.getVisibility() == View.VISIBLE) {
|
||||
result.add(mCancelButton);
|
||||
}
|
||||
|
Reference in New Issue
Block a user