diff options
author | Jamie Garside <jgarside@google.com> | 2021-04-16 15:15:32 +0100 |
---|---|---|
committer | Jamie Garside <jgarside@google.com> | 2021-04-16 16:36:04 +0100 |
commit | 82f1652e350befb64cd3bcc6bdc6035b0da8c1ed (patch) | |
tree | 9eefe877e259b41bd547e54fbd408441d8fe9830 /packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java | |
parent | 3d41ec9b4575c50ed6bf5281e0ddf6cfbde1e042 (diff) |
Move bouncer to bottom of screen when in one handed mode.
If one handed bouncer is enabled, both in the SysUI config (i.e.
sw600dp-land) and in the device config, then use a different gravity for
the keyguard host view. This is used to move the bouncer to the bottom
of the screen when the bouncer is one handed.
Of course, password entry isn't one-handed, but we don't bother checking
which security mode is in use. In that mode, the password line is just
on top of the keyboard anyway, so even using gravity = BOTTOM, it
doesn't render differently.
Bug: 170858298
Test: atest
SystemUITests: com.android.keyguard.KeyguardHostViewControllerTest
Change-Id: Ia24d74ca1993d667c46b8ebb8bde6ea4888a0f97
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java index 31f1332b265c..d06c8bc6bffe 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java @@ -475,7 +475,18 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView> * configuration. */ public void updateResources() { - int gravity = mView.getResources().getInteger(R.integer.keyguard_host_view_gravity); + int gravity; + + Resources resources = mView.getResources(); + + if (resources.getBoolean(R.bool.can_use_one_handed_bouncer) + && resources.getBoolean( + com.android.internal.R.bool.config_enableOneHandedKeyguard)) { + gravity = resources.getInteger( + R.integer.keyguard_host_view_one_handed_gravity); + } else { + gravity = resources.getInteger(R.integer.keyguard_host_view_gravity); + } // Android SysUI uses a FrameLayout as the top-level, but Auto uses RelativeLayout. // We're just changing the gravity here though (which can't be applied to RelativeLayout), |