Merge "Lockscreen spacing to UX specs" into sc-dev am: e1ae3b743e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15049505 Change-Id: I8f933678620d12db0d62275ea237f80aa8610642
This commit is contained in:
@@ -36,10 +36,6 @@
|
|||||||
<!-- On tablets this is just the close_handle_height -->
|
<!-- On tablets this is just the close_handle_height -->
|
||||||
<dimen name="peek_height">@dimen/close_handle_height</dimen>
|
<dimen name="peek_height">@dimen/close_handle_height</dimen>
|
||||||
|
|
||||||
<!-- The margin between the clock and the notifications on Keyguard. See
|
|
||||||
keyguard_clock_height_fraction_* for the difference between min and max.-->
|
|
||||||
<dimen name="keyguard_clock_notifications_margin">44dp</dimen>
|
|
||||||
|
|
||||||
<!-- Height of the status bar header bar when on Keyguard -->
|
<!-- Height of the status bar header bar when on Keyguard -->
|
||||||
<dimen name="status_bar_header_height_keyguard">60dp</dimen>
|
<dimen name="status_bar_header_height_keyguard">60dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -735,8 +735,8 @@
|
|||||||
<!-- Minimum distance the user has to drag down to go to the full shade. -->
|
<!-- Minimum distance the user has to drag down to go to the full shade. -->
|
||||||
<dimen name="keyguard_drag_down_min_distance">100dp</dimen>
|
<dimen name="keyguard_drag_down_min_distance">100dp</dimen>
|
||||||
|
|
||||||
<!-- The margin between the clock and the notifications on Keyguard.-->
|
<!-- The margin between the status view and the notifications on Keyguard.-->
|
||||||
<dimen name="keyguard_clock_notifications_margin">30dp</dimen>
|
<dimen name="keyguard_status_view_bottom_margin">20dp</dimen>
|
||||||
<!-- Minimum margin between clock and status bar -->
|
<!-- Minimum margin between clock and status bar -->
|
||||||
<dimen name="keyguard_clock_top_margin">36dp</dimen>
|
<dimen name="keyguard_clock_top_margin">36dp</dimen>
|
||||||
<!-- The margin between top of clock and bottom of lock icon. -->
|
<!-- The margin between top of clock and bottom of lock icon. -->
|
||||||
|
|||||||
@@ -205,6 +205,10 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getNotificationIconAreaHeight() {
|
||||||
|
return mNotificationIconAreaController.getHeight();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onViewDetached() {
|
protected void onViewDetached() {
|
||||||
if (CUSTOM_CLOCKS_ENABLED) {
|
if (CUSTOM_CLOCKS_ENABLED) {
|
||||||
|
|||||||
@@ -187,10 +187,11 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the height of the keyguard status view.
|
* Get the height of the keyguard status view without the notification icon area, as that's
|
||||||
|
* only visible on AOD.
|
||||||
*/
|
*/
|
||||||
public int getHeight() {
|
public int getLockscreenHeight() {
|
||||||
return mView.getHeight();
|
return mView.getHeight() - mKeyguardClockSwitchController.getNotificationIconAreaHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
private static float CLOCK_HEIGHT_WEIGHT = 0.7f;
|
private static float CLOCK_HEIGHT_WEIGHT = 0.7f;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Margin between the bottom of the clock and the notification shade.
|
* Margin between the bottom of the status view and the notification shade.
|
||||||
*/
|
*/
|
||||||
private int mClockNotificationsMargin;
|
private int mStatusViewBottomMargin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Height of the parent view - display size in px.
|
* Height of the parent view - display size in px.
|
||||||
@@ -153,8 +153,8 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
* Refreshes the dimension values.
|
* Refreshes the dimension values.
|
||||||
*/
|
*/
|
||||||
public void loadDimens(Resources res) {
|
public void loadDimens(Resources res) {
|
||||||
mClockNotificationsMargin = res.getDimensionPixelSize(
|
mStatusViewBottomMargin = res.getDimensionPixelSize(
|
||||||
R.dimen.keyguard_clock_notifications_margin);
|
R.dimen.keyguard_status_view_bottom_margin);
|
||||||
|
|
||||||
mContainerTopPadding =
|
mContainerTopPadding =
|
||||||
res.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin) / 2;
|
res.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin) / 2;
|
||||||
@@ -181,7 +181,7 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
mNotificationStackHeight = notificationStackHeight;
|
mNotificationStackHeight = notificationStackHeight;
|
||||||
mPanelExpansion = panelExpansion;
|
mPanelExpansion = panelExpansion;
|
||||||
mHeight = parentHeight;
|
mHeight = parentHeight;
|
||||||
mKeyguardStatusHeight = keyguardStatusHeight;
|
mKeyguardStatusHeight = keyguardStatusHeight + mStatusViewBottomMargin;
|
||||||
mUserSwitchHeight = userSwitchHeight;
|
mUserSwitchHeight = userSwitchHeight;
|
||||||
mUserSwitchPreferredY = userSwitchPreferredY;
|
mUserSwitchPreferredY = userSwitchPreferredY;
|
||||||
mHasCustomClock = hasCustomClock;
|
mHasCustomClock = hasCustomClock;
|
||||||
@@ -221,40 +221,15 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
|
|
||||||
public float getMinStackScrollerPadding() {
|
public float getMinStackScrollerPadding() {
|
||||||
return mBypassEnabled ? mUnlockedStackScrollerPadding
|
return mBypassEnabled ? mUnlockedStackScrollerPadding
|
||||||
: mMinTopMargin + mKeyguardStatusHeight + mClockNotificationsMargin;
|
: mMinTopMargin + mKeyguardStatusHeight;
|
||||||
}
|
|
||||||
|
|
||||||
private int getMaxClockY() {
|
|
||||||
return mHeight / 2 - mKeyguardStatusHeight - mClockNotificationsMargin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getExpandedPreferredClockY() {
|
private int getExpandedPreferredClockY() {
|
||||||
return mMinTopMargin + mUserSwitchHeight;
|
return mMinTopMargin + mUserSwitchHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public int getLockscreenStatusViewHeight() {
|
||||||
* Vertically align the clock and the shade in the available space considering only
|
return mKeyguardStatusHeight;
|
||||||
* a percentage of the clock height defined by {@code CLOCK_HEIGHT_WEIGHT}.
|
|
||||||
* @return Clock Y in pixels.
|
|
||||||
*/
|
|
||||||
public int getExpandedClockPosition() {
|
|
||||||
final int availableHeight = mMaxShadeBottom - mMinTopMargin;
|
|
||||||
final int containerCenter = mMinTopMargin + availableHeight / 2;
|
|
||||||
|
|
||||||
float y = containerCenter
|
|
||||||
- (mKeyguardStatusHeight + mUserSwitchHeight) * CLOCK_HEIGHT_WEIGHT
|
|
||||||
- mClockNotificationsMargin - mNotificationStackHeight / 2;
|
|
||||||
if (y < mMinTopMargin) {
|
|
||||||
y = mMinTopMargin;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't allow the clock base to be under half of the screen
|
|
||||||
final float maxClockY = getMaxClockY();
|
|
||||||
if (y > maxClockY) {
|
|
||||||
y = maxClockY;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (int) y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getClockY(float panelExpansion, float darkAmount) {
|
private int getClockY(float panelExpansion, float darkAmount) {
|
||||||
|
|||||||
@@ -602,6 +602,10 @@ public class NotificationIconAreaController implements
|
|||||||
updateAodIconColors();
|
updateAodIconColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getHeight() {
|
||||||
|
return mAodIcons == null ? 0 : mAodIcons.getHeight();
|
||||||
|
}
|
||||||
|
|
||||||
public void appearAodIcons() {
|
public void appearAodIcons() {
|
||||||
if (mAodIcons == null) {
|
if (mAodIcons == null) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1260,7 +1260,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
mNotificationStackScrollLayoutController.getIntrinsicContentHeight(),
|
mNotificationStackScrollLayoutController.getIntrinsicContentHeight(),
|
||||||
expandedFraction,
|
expandedFraction,
|
||||||
totalHeight,
|
totalHeight,
|
||||||
mKeyguardStatusViewController.getHeight(),
|
mKeyguardStatusViewController.getLockscreenHeight(),
|
||||||
userIconHeight,
|
userIconHeight,
|
||||||
userSwitcherPreferredY, hasCustomClock(),
|
userSwitcherPreferredY, hasCustomClock(),
|
||||||
hasVisibleNotifications, darkamount, mOverStretchAmount,
|
hasVisibleNotifications, darkamount, mOverStretchAmount,
|
||||||
@@ -2669,14 +2669,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getMaxPanelHeight() {
|
protected int getMaxPanelHeight() {
|
||||||
if (mKeyguardBypassController.getBypassEnabled() && mBarState == KEYGUARD) {
|
|
||||||
return getMaxPanelHeightBypass();
|
|
||||||
} else {
|
|
||||||
return getMaxPanelHeightNonBypass();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int getMaxPanelHeightNonBypass() {
|
|
||||||
int min = mStatusBarMinHeight;
|
int min = mStatusBarMinHeight;
|
||||||
if (!(mBarState == KEYGUARD)
|
if (!(mBarState == KEYGUARD)
|
||||||
&& mNotificationStackScrollLayoutController.getNotGoneChildCount() == 0) {
|
&& mNotificationStackScrollLayoutController.getNotGoneChildCount() == 0) {
|
||||||
@@ -2701,16 +2693,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
return maxHeight;
|
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() {
|
public boolean isInSettings() {
|
||||||
return mQsExpanded;
|
return mQsExpanded;
|
||||||
}
|
}
|
||||||
@@ -2782,11 +2764,8 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
maxHeight += mNotificationStackScrollLayoutController.getTopPaddingOverflow();
|
maxHeight += mNotificationStackScrollLayoutController.getTopPaddingOverflow();
|
||||||
|
|
||||||
if (mBarState == KEYGUARD) {
|
if (mBarState == KEYGUARD) {
|
||||||
int
|
int minKeyguardPanelBottom = mClockPositionAlgorithm.getLockscreenStatusViewHeight()
|
||||||
minKeyguardPanelBottom =
|
+ mNotificationStackScrollLayoutController.getIntrinsicContentHeight();
|
||||||
mClockPositionAlgorithm.getExpandedClockPosition()
|
|
||||||
+ mKeyguardStatusViewController.getHeight()
|
|
||||||
+ mNotificationStackScrollLayoutController.getIntrinsicContentHeight();
|
|
||||||
return Math.max(maxHeight, minKeyguardPanelBottom);
|
return Math.max(maxHeight, minKeyguardPanelBottom);
|
||||||
} else {
|
} else {
|
||||||
return maxHeight;
|
return maxHeight;
|
||||||
@@ -3336,7 +3315,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
}
|
}
|
||||||
if (mKeyguardBypassController.getBypassEnabled() && isOnKeyguard()) {
|
if (mKeyguardBypassController.getBypassEnabled() && isOnKeyguard()) {
|
||||||
// The expandedHeight is always the full panel Height when bypassing
|
// The expandedHeight is always the full panel Height when bypassing
|
||||||
expandedHeight = getMaxPanelHeightNonBypass();
|
expandedHeight = getMaxPanelHeight();
|
||||||
}
|
}
|
||||||
mNotificationStackScrollLayoutController.setExpandedHeight(expandedHeight);
|
mNotificationStackScrollLayoutController.setExpandedHeight(expandedHeight);
|
||||||
updateKeyguardBottomAreaAlpha();
|
updateKeyguardBottomAreaAlpha();
|
||||||
|
|||||||
Reference in New Issue
Block a user