summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Beverly Tai <beverlyt@google.com> 2021-07-07 13:22:33 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-07-07 13:22:33 +0000
commit315a26781c9557fa0dbdae9c5d273102de3d8e6c (patch)
tree425bd8151e4ed85c4a5f1cd8cd0e85a76f1e0c66
parent34d05933ccfc152b3b932b4d5abab8f6a71cd1d1 (diff)
parent82d46f2b02f50202dffd18ede9144d3601542693 (diff)
Merge "Update spacing for lock icon with udfps" into sc-dev
-rw-r--r--packages/SystemUI/res/layout/keyguard_bottom_area.xml2
-rw-r--r--packages/SystemUI/src/com/android/keyguard/LockIconView.java2
-rw-r--r--packages/SystemUI/src/com/android/keyguard/LockIconViewController.java14
3 files changed, 11 insertions, 7 deletions
diff --git a/packages/SystemUI/res/layout/keyguard_bottom_area.xml b/packages/SystemUI/res/layout/keyguard_bottom_area.xml
index e40138e1f49c..9ce83a789f59 100644
--- a/packages/SystemUI/res/layout/keyguard_bottom_area.xml
+++ b/packages/SystemUI/res/layout/keyguard_bottom_area.xml
@@ -52,6 +52,8 @@
android:paddingStart="@dimen/keyguard_indication_text_padding"
android:paddingEnd="@dimen/keyguard_indication_text_padding"
android:textAppearance="@style/TextAppearance.Keyguard.BottomArea"
+ android:maxLines="2"
+ android:ellipsize="end"
android:alpha=".8"
android:accessibilityLiveRegion="polite"
android:visibility="gone"/>
diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconView.java b/packages/SystemUI/src/com/android/keyguard/LockIconView.java
index c425ddf7eeb1..c1d448db1e63 100644
--- a/packages/SystemUI/src/com/android/keyguard/LockIconView.java
+++ b/packages/SystemUI/src/com/android/keyguard/LockIconView.java
@@ -43,7 +43,7 @@ public class LockIconView extends ImageView implements Dumpable {
mSensorRect = new RectF();
}
- void setLocation(@NonNull PointF center, int radius) {
+ void setCenterLocation(@NonNull PointF center, int radius) {
mLockIconCenter = center;
mRadius = radius;
diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
index f3fbc50f560d..62cb4b9a33f5 100644
--- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
@@ -98,7 +98,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
private float mHeightPixels;
private float mWidthPixels;
private float mDensity;
- private int mIndicationBottomPadding;
+ private int mKgBottomAreaHeight;
private boolean mShowUnlockIcon;
private boolean mShowLockIcon;
@@ -280,7 +280,9 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
mWidthPixels = metrics.widthPixels;
mHeightPixels = metrics.heightPixels;
mDensity = metrics.density;
- mIndicationBottomPadding = mView.getContext().getResources().getDimensionPixelSize(
+ mKgBottomAreaHeight = mView.getContext().getResources().getDimensionPixelSize(
+ R.dimen.keyguard_indication_margin_bottom)
+ + mView.getContext().getResources().getDimensionPixelSize(
R.dimen.keyguard_indication_bottom_padding);
updateLockIconLocation();
}
@@ -288,15 +290,15 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
private void updateLockIconLocation() {
if (mHasUdfps) {
FingerprintSensorPropertiesInternal props = mAuthController.getUdfpsProps().get(0);
- mView.setLocation(new PointF(props.sensorLocationX, props.sensorLocationY),
+ mView.setCenterLocation(new PointF(props.sensorLocationX, props.sensorLocationY),
props.sensorRadius);
} else {
final float distAboveKgBottomArea = 12 * mDensity;
final float radius = 36 * mDensity;
- mView.setLocation(
+ mView.setCenterLocation(
new PointF(mWidthPixels / 2,
- mHeightPixels - mIndicationBottomPadding - distAboveKgBottomArea - radius),
- (int) radius);
+ mHeightPixels - mKgBottomAreaHeight - distAboveKgBottomArea
+ - radius / 2), (int) radius);
}
mView.getHitRect(mSensorTouchLocation);