Merge "Update scaled padding for all devices" into tm-dev am: 56e26a9e4d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18320872 Change-Id: I8a0f8d6b51126e4e35a85dac9e86f945ab37cc5f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -123,7 +123,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
|
|||||||
private float mHeightPixels;
|
private float mHeightPixels;
|
||||||
private float mWidthPixels;
|
private float mWidthPixels;
|
||||||
private int mBottomPaddingPx;
|
private int mBottomPaddingPx;
|
||||||
private int mScaledPaddingPx;
|
private int mDefaultPaddingPx;
|
||||||
|
|
||||||
private boolean mShowUnlockIcon;
|
private boolean mShowUnlockIcon;
|
||||||
private boolean mShowLockIcon;
|
private boolean mShowLockIcon;
|
||||||
@@ -340,6 +340,8 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
|
|||||||
mWidthPixels = bounds.right;
|
mWidthPixels = bounds.right;
|
||||||
mHeightPixels = bounds.bottom;
|
mHeightPixels = bounds.bottom;
|
||||||
mBottomPaddingPx = getResources().getDimensionPixelSize(R.dimen.lock_icon_margin_bottom);
|
mBottomPaddingPx = getResources().getDimensionPixelSize(R.dimen.lock_icon_margin_bottom);
|
||||||
|
mDefaultPaddingPx =
|
||||||
|
getResources().getDimensionPixelSize(R.dimen.lock_icon_padding);
|
||||||
|
|
||||||
mUnlockedLabel = mView.getContext().getResources().getString(
|
mUnlockedLabel = mView.getContext().getResources().getString(
|
||||||
R.string.accessibility_unlock_button);
|
R.string.accessibility_unlock_button);
|
||||||
@@ -348,17 +350,16 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateLockIconLocation() {
|
private void updateLockIconLocation() {
|
||||||
|
final float scaleFactor = mAuthController.getScaleFactor();
|
||||||
|
final int scaledPadding = (int) (mDefaultPaddingPx * scaleFactor);
|
||||||
if (mUdfpsSupported) {
|
if (mUdfpsSupported) {
|
||||||
final int defaultPaddingPx =
|
|
||||||
getResources().getDimensionPixelSize(R.dimen.lock_icon_padding);
|
|
||||||
mScaledPaddingPx = (int) (defaultPaddingPx * mAuthController.getScaleFactor());
|
|
||||||
mView.setCenterLocation(mAuthController.getUdfpsLocation(),
|
mView.setCenterLocation(mAuthController.getUdfpsLocation(),
|
||||||
mAuthController.getUdfpsRadius(), mScaledPaddingPx);
|
mAuthController.getUdfpsRadius(), scaledPadding);
|
||||||
} else {
|
} else {
|
||||||
mView.setCenterLocation(
|
mView.setCenterLocation(
|
||||||
new PointF(mWidthPixels / 2,
|
new PointF(mWidthPixels / 2,
|
||||||
mHeightPixels - mBottomPaddingPx - sLockIconRadiusPx),
|
mHeightPixels - ((mBottomPaddingPx + sLockIconRadiusPx) * scaleFactor)),
|
||||||
sLockIconRadiusPx, mScaledPaddingPx);
|
sLockIconRadiusPx * scaleFactor, scaledPadding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user