From c41e408aea1bf2f28160265cdadd7662e626d228 Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Thu, 27 Apr 2017 19:04:46 -0700 Subject: [PATCH] Refactor choose lock password scrolling Replace the negative margin + inset background hack with a overriding call to requestRectangleOnScreen, which will also make a best effort to show all the password requirements if there are multiple of them. Bug: 38236574 Test: Added ScrollToParentEditTextTest Change-Id: Id570652b64434b2d0b25c231540375d93884aaa9 --- res/layout-land/confirm_lock_password.xml | 52 ++++++------ res/layout/choose_lock_password.xml | 35 ++++---- res/layout/confirm_lock_password_base.xml | 50 ++++++----- res/layout/confirm_lock_password_internal.xml | 61 ++++++-------- res/values/dimens.xml | 3 - .../android/settings/ChooseLockPassword.java | 34 +++----- .../android/settings/ConfirmLockPassword.java | 3 + .../widget/ScrollToParentEditText.java | 51 ++++++++++++ .../widget/ScrollToParentEditTextTest.java | 83 +++++++++++++++++++ 9 files changed, 246 insertions(+), 126 deletions(-) create mode 100644 src/com/android/settings/widget/ScrollToParentEditText.java create mode 100644 tests/robotests/src/com/android/settings/widget/ScrollToParentEditTextTest.java diff --git a/res/layout-land/confirm_lock_password.xml b/res/layout-land/confirm_lock_password.xml index 63b7e48dfd8..0cc9339aa2e 100644 --- a/res/layout-land/confirm_lock_password.xml +++ b/res/layout-land/confirm_lock_password.xml @@ -22,7 +22,6 @@ - - + android:layout_height="wrap_content"/> + android:layout_height="0dp" + android:layout_weight="1">