Align one handed bouncer to the right edge of the screen.

Bug: 197741850
Test: atest KeyguardSecurityContainerTest
Change-Id: I3469c108f24e1d03f89057af86df6c0060561f7c
This commit is contained in:
Ben Murdoch
2021-08-26 16:43:25 +01:00
parent 2907230d91
commit b5b1e54f23
2 changed files with 4 additions and 2 deletions

View File

@@ -317,7 +317,8 @@ public class KeyguardSecurityContainer extends FrameLayout {
mRunningOneHandedAnimator = null;
}
int targetTranslation = mIsSecurityViewLeftAligned ? 0 : (int) (getMeasuredWidth() / 2f);
int targetTranslation = mIsSecurityViewLeftAligned
? 0 : (int) (getMeasuredWidth() - mSecurityViewFlipper.getWidth());
if (animate) {
mRunningOneHandedAnimator =

View File

@@ -165,7 +165,8 @@ public class KeyguardSecurityContainerTest extends SysuiTestCase {
mKeyguardSecurityContainer.setOneHandedModeLeftAligned(
/* leftAligned= */false, /* animate= */false);
verify(mSecurityViewFlipper).setTranslationX(SCREEN_WIDTH / 2.0f);
verify(mSecurityViewFlipper).setTranslationX(
mKeyguardSecurityContainer.getWidth() - mSecurityViewFlipper.getWidth());
mKeyguardSecurityContainer.setOneHandedModeLeftAligned(
/* leftAligned= */true, /* animate= */false);