summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robert Snoeberger <snoeberger@google.com> 2019-05-02 16:44:11 -0400
committer Robert Snoeberger <snoeberger@google.com> 2019-05-03 09:34:45 -0400
commit69969c28bc338d03f9bb5fb738a1bf2efd5ec1fe (patch)
tree58b2f62b2aeb93273f87ba1dc29341f180813ab6
parent2c09b3be2360c4b184a96a52951f7089ab9d8e0f (diff)
Consider lock icon when determining minimum top padding.
Otherwise, the clock will be able to overlap with the lock icon in some situations. A side effect of this change is that only 2 notifications will be displayed when the now playing indication is present. Fixes: 131311937 Test: manual - need three visible notifs + now playing indication Change-Id: Ieffa97bc20a45fb82fb258deca7c1f289b0ce003
-rw-r--r--packages/SystemUI/res/values/dimens.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java9
2 files changed, 9 insertions, 2 deletions
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index ce958ab3f739..bb7b6630cb19 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -591,6 +591,8 @@
<dimen name="keyguard_clock_notifications_margin">30dp</dimen>
<!-- Minimum margin between clock and status bar -->
<dimen name="keyguard_clock_top_margin">36dp</dimen>
+ <!-- The margin between top of clock and bottom of lock icon. -->
+ <dimen name="keyguard_clock_lock_margin">16dp</dimen>
<item name="scrim_behind_alpha" format="float" type="dimen">0.62</item>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
index 1b866935250a..bc2d00f53186 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
@@ -117,8 +117,13 @@ public class KeyguardClockPositionAlgorithm {
public void loadDimens(Resources res) {
mClockNotificationsMargin = res.getDimensionPixelSize(
R.dimen.keyguard_clock_notifications_margin);
- mContainerTopPadding = res.getDimensionPixelSize(
- R.dimen.keyguard_clock_top_margin);
+ // Consider the lock icon when determining the minimum top padding between the status bar
+ // and top of the clock.
+ mContainerTopPadding = Math.max(res.getDimensionPixelSize(
+ R.dimen.keyguard_clock_top_margin),
+ res.getDimensionPixelSize(R.dimen.keyguard_lock_height)
+ + res.getDimensionPixelSize(R.dimen.keyguard_lock_padding)
+ + res.getDimensionPixelSize(R.dimen.keyguard_clock_lock_margin));
mBurnInPreventionOffsetX = res.getDimensionPixelSize(
R.dimen.burn_in_prevention_offset_x);
mBurnInPreventionOffsetY = res.getDimensionPixelSize(