summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matt Pietal <mpietal@google.com> 2021-04-16 11:41:14 -0400
committer Matt Pietal <mpietal@google.com> 2021-04-16 11:41:14 -0400
commitdcbfcc592833152a963c86ee30c4a83c1411d658 (patch)
tree59b0b890aeb06ff432f1b3257ea4878973081437
parent650a27bf2a505f6c7075f0db0728100f6fc5223d (diff)
Indication area text running into wallet
If the wallet affordance is enabled, add padding to both sides of the indication area to keep it centered and let the text wrap to the 2nd line. Fixes: 185467117 Test: manual (seeing charging message + wallet) Change-Id: Id44b473faab2acb0f5446cf0ea890c2b2cc74e71
-rw-r--r--packages/SystemUI/res/values/dimens.xml4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java11
2 files changed, 14 insertions, 1 deletions
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 5d9c909ef4c7..210efd86d453 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -871,7 +871,9 @@
<dimen name="keyguard_affordance_width">48dp</dimen>
<dimen name="keyguard_affordance_horizontal_offset">32dp</dimen>
<dimen name="keyguard_affordance_vertical_offset">32dp</dimen>
-
+ <!-- Value should be at least sum of 'keyguard_affordance_width' +
+ 'keyguard_affordance_horizontal_offset' -->
+ <dimen name="keyguard_indication_area_padding">82dp</dimen>
<!-- The width/height of the unlock icon view on keyguard. -->
<dimen name="keyguard_lock_height">42dp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
index b83039b9f7f3..8cef23f21383 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -183,6 +183,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
private String mLeftButtonStr;
private boolean mDozing;
private int mIndicationBottomMargin;
+ private int mIndicationPadding;
private float mDarkAmount;
private int mBurnInXOffset;
private int mBurnInYOffset;
@@ -276,6 +277,10 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
mAccessibilityController = Dependency.get(AccessibilityController.class);
mActivityIntentHelper = new ActivityIntentHelper(getContext());
updateLeftAffordance();
+
+ mIndicationPadding = getResources().getDimensionPixelSize(
+ R.dimen.keyguard_indication_area_padding);
+ updateWalletVisibility();
}
@Override
@@ -358,6 +363,10 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
lp.width = getResources().getDimensionPixelSize(R.dimen.keyguard_affordance_width);
lp.height = getResources().getDimensionPixelSize(R.dimen.keyguard_affordance_height);
mWalletButton.setLayoutParams(lp);
+
+ mIndicationPadding = getResources().getDimensionPixelSize(
+ R.dimen.keyguard_indication_area_padding);
+ updateWalletVisibility();
}
private void updateRightAffordanceIcon() {
@@ -433,9 +442,11 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
private void updateWalletVisibility() {
if (mDozing || !mWalletEnabled || !mHasCard) {
mWalletButton.setVisibility(GONE);
+ mIndicationArea.setPadding(0, 0, 0, 0);
} else {
mWalletButton.setVisibility(VISIBLE);
mWalletButton.setOnClickListener(this::onWalletClick);
+ mIndicationArea.setPadding(mIndicationPadding, 0, mIndicationPadding, 0);
}
}