summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
diff options
context:
space:
mode:
authorScott Lobdell <slobdell@google.com>2021-04-08 04:27:11 +0000
committerScott Lobdell <slobdell@google.com>2021-04-09 17:32:37 +0000
commit5f1da148b08c14445ce83ca151a84f75e489d274 (patch)
treedf59b2056d1fe2dbe09f6c85463ddf1769daf4e6 /packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
parent702f04add003ce3e490a2f0bdff083a7e6f5979e (diff)
parent851218af5f83cdb89c02d680fb22212318150068 (diff)
Merge SP1A.210407.002
Change-Id: Iaad2b7cc2aeba166f003d0d460bc8ce29d1caab3
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
index 708b2d55b75a..7ed63375a334 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
@@ -267,6 +267,13 @@ public class KeyguardSecurityContainer extends FrameLayout {
updateSecurityViewLocation(false);
}
+ /** Update keyguard position based on a tapped X coordinate. */
+ public void updateKeyguardPosition(float x) {
+ if (mOneHandedMode) {
+ moveBouncerForXCoordinate(x, /* animate= */false);
+ }
+ }
+
/** Return whether the one-handed keyguard should be enabled. */
private boolean canUseOneHandedBouncer() {
// Is it enabled?
@@ -488,9 +495,13 @@ public class KeyguardSecurityContainer extends FrameLayout {
return;
}
+ moveBouncerForXCoordinate(event.getX(), /* animate= */true);
+ }
+
+ private void moveBouncerForXCoordinate(float x, boolean animate) {
// Did the tap hit the "other" side of the bouncer?
- if ((mIsSecurityViewLeftAligned && (event.getX() > getWidth() / 2f))
- || (!mIsSecurityViewLeftAligned && (event.getX() < getWidth() / 2f))) {
+ if ((mIsSecurityViewLeftAligned && (x > getWidth() / 2f))
+ || (!mIsSecurityViewLeftAligned && (x < getWidth() / 2f))) {
mIsSecurityViewLeftAligned = !mIsSecurityViewLeftAligned;
Settings.Global.putInt(
@@ -499,7 +510,7 @@ public class KeyguardSecurityContainer extends FrameLayout {
mIsSecurityViewLeftAligned ? Settings.Global.ONE_HANDED_KEYGUARD_SIDE_LEFT
: Settings.Global.ONE_HANDED_KEYGUARD_SIDE_RIGHT);
- updateSecurityViewLocation(true);
+ updateSecurityViewLocation(animate);
}
}