Merge changes from topic "lock_icon_move" into sc-v2-dev am: cdae07870c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16214439 Change-Id: I65cba0cfb7b15b05b51543447fac7ca125b9424e
This commit is contained in:
@@ -21,4 +21,8 @@
|
|||||||
<dimen name="keyguard_indication_margin_bottom">25dp</dimen>
|
<dimen name="keyguard_indication_margin_bottom">25dp</dimen>
|
||||||
<dimen name="ambient_indication_margin_bottom">115dp</dimen>
|
<dimen name="ambient_indication_margin_bottom">115dp</dimen>
|
||||||
<dimen name="lock_icon_margin_bottom">60dp</dimen>
|
<dimen name="lock_icon_margin_bottom">60dp</dimen>
|
||||||
|
|
||||||
|
<!-- margin from keyguard status bar to clock. For split shade it should be
|
||||||
|
keyguard_split_shade_top_margin - status_bar_header_height_keyguard = 8dp -->
|
||||||
|
<dimen name="keyguard_clock_top_margin">8dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -753,6 +753,9 @@
|
|||||||
<!-- 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 from the top of the screen to notifications and keyguard status view in
|
||||||
|
split shade on keyguard-->
|
||||||
|
<dimen name="keyguard_split_shade_top_margin">68dp</dimen>
|
||||||
<!-- The margin between the status view and the notifications on Keyguard.-->
|
<!-- The margin between the status view and the notifications on Keyguard.-->
|
||||||
<dimen name="keyguard_status_view_bottom_margin">20dp</dimen>
|
<dimen name="keyguard_status_view_bottom_margin">20dp</dimen>
|
||||||
<!-- Minimum margin between clock and status bar -->
|
<!-- Minimum margin between clock and status bar -->
|
||||||
|
|||||||
@@ -56,21 +56,6 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
*/
|
*/
|
||||||
private int mUserSwitchPreferredY;
|
private int mUserSwitchPreferredY;
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether or not there is a custom clock face on keyguard.
|
|
||||||
*/
|
|
||||||
private boolean mHasCustomClock;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether or not the NSSL contains any visible notifications.
|
|
||||||
*/
|
|
||||||
private boolean mHasVisibleNotifs;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Height of notification stack: Sum of height of each notification.
|
|
||||||
*/
|
|
||||||
private int mNotificationStackHeight;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Minimum top margin to avoid overlap with status bar, lock icon, or multi-user switcher
|
* Minimum top margin to avoid overlap with status bar, lock icon, or multi-user switcher
|
||||||
* avatar.
|
* avatar.
|
||||||
@@ -87,6 +72,16 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
*/
|
*/
|
||||||
private int mContainerTopPadding;
|
private int mContainerTopPadding;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Top margin of notifications introduced by presence of split shade header / status bar
|
||||||
|
*/
|
||||||
|
private int mSplitShadeTopNotificationsMargin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Target margin for notifications and clock from the top of the screen in split shade
|
||||||
|
*/
|
||||||
|
private int mSplitShadeTargetTopMargin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see NotificationPanelViewController#getExpandedFraction()
|
* @see NotificationPanelViewController#getExpandedFraction()
|
||||||
*/
|
*/
|
||||||
@@ -152,6 +147,10 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
public void loadDimens(Resources res) {
|
public void loadDimens(Resources res) {
|
||||||
mStatusViewBottomMargin = res.getDimensionPixelSize(
|
mStatusViewBottomMargin = res.getDimensionPixelSize(
|
||||||
R.dimen.keyguard_status_view_bottom_margin);
|
R.dimen.keyguard_status_view_bottom_margin);
|
||||||
|
mSplitShadeTopNotificationsMargin =
|
||||||
|
res.getDimensionPixelSize(R.dimen.split_shade_header_height);
|
||||||
|
mSplitShadeTargetTopMargin =
|
||||||
|
res.getDimensionPixelSize(R.dimen.keyguard_split_shade_top_margin);
|
||||||
|
|
||||||
mContainerTopPadding =
|
mContainerTopPadding =
|
||||||
res.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin);
|
res.getDimensionPixelSize(R.dimen.keyguard_clock_top_margin);
|
||||||
@@ -214,7 +213,7 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
if (mBypassEnabled) {
|
if (mBypassEnabled) {
|
||||||
return (int) (mUnlockedStackScrollerPadding + mOverStretchAmount);
|
return (int) (mUnlockedStackScrollerPadding + mOverStretchAmount);
|
||||||
} else if (mIsSplitShade) {
|
} else if (mIsSplitShade) {
|
||||||
return clockYPosition;
|
return Math.max(0, clockYPosition - mSplitShadeTopNotificationsMargin);
|
||||||
} else {
|
} else {
|
||||||
return clockYPosition + mKeyguardStatusHeight;
|
return clockYPosition + mKeyguardStatusHeight;
|
||||||
}
|
}
|
||||||
@@ -224,14 +223,18 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
if (mBypassEnabled) {
|
if (mBypassEnabled) {
|
||||||
return mUnlockedStackScrollerPadding;
|
return mUnlockedStackScrollerPadding;
|
||||||
} else if (mIsSplitShade) {
|
} else if (mIsSplitShade) {
|
||||||
return mMinTopMargin;
|
return Math.max(mSplitShadeTargetTopMargin, mMinTopMargin);
|
||||||
} else {
|
} else {
|
||||||
return mMinTopMargin + mKeyguardStatusHeight;
|
return mMinTopMargin + mKeyguardStatusHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getExpandedPreferredClockY() {
|
private int getExpandedPreferredClockY() {
|
||||||
return mMinTopMargin + mUserSwitchHeight;
|
if (mIsSplitShade) {
|
||||||
|
return Math.max(mSplitShadeTargetTopMargin, mMinTopMargin);
|
||||||
|
} else {
|
||||||
|
return mMinTopMargin;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLockscreenStatusViewHeight() {
|
public int getLockscreenStatusViewHeight() {
|
||||||
|
|||||||
@@ -262,6 +262,34 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
|||||||
assertThat(mClockPosition.stackScrollerPadding).isEqualTo(0);
|
assertThat(mClockPosition.stackScrollerPadding).isEqualTo(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clockPositionedDependingOnMarginInSplitShade() {
|
||||||
|
when(mResources.getDimensionPixelSize(R.dimen.keyguard_split_shade_top_margin))
|
||||||
|
.thenReturn(400);
|
||||||
|
mClockPositionAlgorithm.loadDimens(mResources);
|
||||||
|
givenLockScreen();
|
||||||
|
mIsSplitShade = true;
|
||||||
|
// WHEN the position algorithm is run
|
||||||
|
positionClock();
|
||||||
|
|
||||||
|
assertThat(mClockPosition.clockY).isEqualTo(400);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void notifPaddingMakesUpToFullMarginInSplitShade() {
|
||||||
|
when(mResources.getDimensionPixelSize(R.dimen.keyguard_split_shade_top_margin))
|
||||||
|
.thenReturn(100);
|
||||||
|
when(mResources.getDimensionPixelSize(R.dimen.split_shade_header_height))
|
||||||
|
.thenReturn(70);
|
||||||
|
mClockPositionAlgorithm.loadDimens(mResources);
|
||||||
|
givenLockScreen();
|
||||||
|
mIsSplitShade = true;
|
||||||
|
// WHEN the position algorithm is run
|
||||||
|
positionClock();
|
||||||
|
// THEN the notif padding makes up lacking margin (margin - header height = 30).
|
||||||
|
assertThat(mClockPosition.stackScrollerPadding).isEqualTo(30);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void notifPaddingExpandedAlignedWithClockInSplitShadeMode() {
|
public void notifPaddingExpandedAlignedWithClockInSplitShadeMode() {
|
||||||
givenLockScreen();
|
givenLockScreen();
|
||||||
@@ -271,7 +299,7 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
|
|||||||
positionClock();
|
positionClock();
|
||||||
// THEN the padding DOESN'T adjust for keyguard status height.
|
// THEN the padding DOESN'T adjust for keyguard status height.
|
||||||
assertThat(mClockPosition.stackScrollerPaddingExpanded)
|
assertThat(mClockPosition.stackScrollerPaddingExpanded)
|
||||||
.isEqualTo(mClockPosition.clockYFullyDozing);
|
.isEqualTo(mClockPosition.clockY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user