From 0cbd13d0dfbcd9872a5ae11bfd9ecd1633a0c5ce Mon Sep 17 00:00:00 2001 From: Mill Chen Date: Tue, 30 Mar 2021 03:12:10 +0800 Subject: [PATCH] Update lock pattern for landscape - Using GlifLayout api to set title and description - Hide the header area for landscape mode Bug: 179317709 Test: visual verified 1) Settings -> Security -> Screen lock -> Pattern 2) Try setting screen lock if there's no pattern 3) Rotate the screen during the settings flow and see if there's an empty space leaving in the left side 4) Settings -> Security -> Fingerprint 5) Device will display a confirm lock pattern page 6) Rotate the screen and see if there's an empty space left Change-Id: I16f614eceb873f40b7c48583223aedcbcbd7447d --- res/layout-land/confirm_lock_pattern.xml | 4 +-- .../confirm_lock_pattern_normal.xml | 4 +-- res/layout/confirm_lock_pattern_base.xml | 4 +-- .../confirm_lock_pattern_normal_base.xml | 4 +-- .../settings/password/ChooseLockPattern.java | 7 ++++ .../settings/password/ConfirmLockPattern.java | 36 +++++++++++-------- 6 files changed, 37 insertions(+), 22 deletions(-) diff --git a/res/layout-land/confirm_lock_pattern.xml b/res/layout-land/confirm_lock_pattern.xml index 1fd6824ae5f..1126052df47 100644 --- a/res/layout-land/confirm_lock_pattern.xml +++ b/res/layout-land/confirm_lock_pattern.xml @@ -48,13 +48,13 @@ android:src="@drawable/ic_enterprise" /> > result = new ArrayList<>(); - result.add(new ArrayList<>(Collections.singletonList(mHeaderTextView))); - result.add(new ArrayList<>(Collections.singletonList(mDetailsTextView))); + result.add(new ArrayList<>(Collections.singletonList(mGlifLayout.getHeaderTextView()))); + result.add(new ArrayList<>( + Collections.singletonList(mGlifLayout.getDescriptionTextView()))); if (mCancelButton.getVisibility() == View.VISIBLE) { result.add(new ArrayList<>(Collections.singletonList(mCancelButton))); } @@ -306,14 +314,14 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity { switch (stage) { case NeedToUnlock: if (mHeaderText != null) { - mHeaderTextView.setText(mHeaderText); + mGlifLayout.setHeaderText(mHeaderText); } else { - mHeaderTextView.setText(getDefaultHeader()); + mGlifLayout.setHeaderText(getDefaultHeader()); } if (mDetailsText != null) { - mDetailsTextView.setText(mDetailsText); + mGlifLayout.setDescriptionText(mDetailsText); } else { - mDetailsTextView.setText(getDefaultDetails()); + mGlifLayout.setDescriptionText(getDefaultDetails()); } mErrorTextView.setText(""); updateErrorMessage( @@ -341,7 +349,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity { // Always announce the header for accessibility. This is a no-op // when accessibility is disabled. - mHeaderTextView.announceForAccessibility(mHeaderTextView.getText()); + mGlifLayout.getHeaderTextView().announceForAccessibility(mGlifLayout.getHeaderText()); } private int getDefaultHeader() {