From 65b9b13465571c1d0b31d94914a633b8ab5cba67 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Mon, 21 Jun 2021 15:31:07 -0400 Subject: [PATCH] Lockscreen spacing to UX specs Reduce spacing between smartspace and notification area. Remove concept of 'expanded clock position' from KeyguardClockPositionAlgorithm, as it was only used when content was vertically centered. Similarly, remove difference between bypass/non-bypass height as the two layouts now match. Fixes: 183008450 Fixes: 190831603 Test: atest KeyguardClockPositionAlgorithmTest Change-Id: Ie274e34eb61a876166c11e4f4fa3b9d95ef49888 --- .../SystemUI/res/values-sw600dp/dimens.xml | 4 -- packages/SystemUI/res/values/dimens.xml | 4 +- .../KeyguardClockSwitchController.java | 4 ++ .../KeyguardStatusViewController.java | 7 ++-- .../phone/KeyguardClockPositionAlgorithm.java | 41 ++++--------------- .../phone/NotificationIconAreaController.java | 4 ++ .../NotificationPanelViewController.java | 29 ++----------- 7 files changed, 26 insertions(+), 67 deletions(-) diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml index 9f8e6364e55d3..da80b85b38bf0 100644 --- a/packages/SystemUI/res/values-sw600dp/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp/dimens.xml @@ -36,10 +36,6 @@ @dimen/close_handle_height - - 44dp - 60dp diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 3e4684c9b2d62..7525a9b1c19c3 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -735,8 +735,8 @@ 100dp - - 30dp + + 20dp 36dp diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java index ef6212d4f3547..a28d1747f2fec 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java @@ -205,6 +205,10 @@ public class KeyguardClockSwitchController extends ViewController maxClockY) { - y = maxClockY; - } - - return (int) y; + public int getLockscreenStatusViewHeight() { + return mKeyguardStatusHeight; } private int getClockY(float panelExpansion, float darkAmount) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java index 6b864c9c35df2..41af80e02b5a4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java @@ -602,6 +602,10 @@ public class NotificationIconAreaController implements updateAodIconColors(); } + public int getHeight() { + return mAodIcons == null ? 0 : mAodIcons.getHeight(); + } + public void appearAodIcons() { if (mAodIcons == null) { return; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index aaddfca4b6850..f461d944d2c29 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -1260,7 +1260,7 @@ public class NotificationPanelViewController extends PanelViewController { mNotificationStackScrollLayoutController.getIntrinsicContentHeight(), expandedFraction, totalHeight, - mKeyguardStatusViewController.getHeight(), + mKeyguardStatusViewController.getLockscreenHeight(), userIconHeight, userSwitcherPreferredY, hasCustomClock(), hasVisibleNotifications, darkamount, mOverStretchAmount, @@ -2669,14 +2669,6 @@ public class NotificationPanelViewController extends PanelViewController { @Override protected int getMaxPanelHeight() { - if (mKeyguardBypassController.getBypassEnabled() && mBarState == KEYGUARD) { - return getMaxPanelHeightBypass(); - } else { - return getMaxPanelHeightNonBypass(); - } - } - - private int getMaxPanelHeightNonBypass() { int min = mStatusBarMinHeight; if (!(mBarState == KEYGUARD) && mNotificationStackScrollLayoutController.getNotGoneChildCount() == 0) { @@ -2701,16 +2693,6 @@ public class NotificationPanelViewController extends PanelViewController { return maxHeight; } - private int getMaxPanelHeightBypass() { - int position = - mClockPositionAlgorithm.getExpandedClockPosition() - + mKeyguardStatusViewController.getHeight(); - if (mNotificationStackScrollLayoutController.getVisibleNotificationCount() != 0) { - position += mShelfHeight / 2.0f + mDarkIconSize / 2.0f; - } - return position; - } - public boolean isInSettings() { return mQsExpanded; } @@ -2782,11 +2764,8 @@ public class NotificationPanelViewController extends PanelViewController { maxHeight += mNotificationStackScrollLayoutController.getTopPaddingOverflow(); if (mBarState == KEYGUARD) { - int - minKeyguardPanelBottom = - mClockPositionAlgorithm.getExpandedClockPosition() - + mKeyguardStatusViewController.getHeight() - + mNotificationStackScrollLayoutController.getIntrinsicContentHeight(); + int minKeyguardPanelBottom = mClockPositionAlgorithm.getLockscreenStatusViewHeight() + + mNotificationStackScrollLayoutController.getIntrinsicContentHeight(); return Math.max(maxHeight, minKeyguardPanelBottom); } else { return maxHeight; @@ -3336,7 +3315,7 @@ public class NotificationPanelViewController extends PanelViewController { } if (mKeyguardBypassController.getBypassEnabled() && isOnKeyguard()) { // The expandedHeight is always the full panel Height when bypassing - expandedHeight = getMaxPanelHeightNonBypass(); + expandedHeight = getMaxPanelHeight(); } mNotificationStackScrollLayoutController.setExpandedHeight(expandedHeight); updateKeyguardBottomAreaAlpha();