Loading packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -561,6 +561,9 @@ <!-- The height of the gap between adjacent notification sections. --> <dimen name="notification_section_divider_height">@dimen/notification_side_paddings</dimen> <!-- The height of the gap between adjacent notification sections on lockscreen. --> <dimen name="notification_section_divider_height_lockscreen">4dp</dimen> <!-- Size of the face pile shown on one-line (children of a group) conversation notifications --> <dimen name="conversation_single_line_face_pile_size">24dp</dimen> Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +2 −11 Original line number Diff line number Diff line Loading @@ -85,9 +85,6 @@ public class NotificationShelf extends ActivatableNotificationView implements private NotificationShelfController mController; private float mActualWidth = -1; /** Fraction of lockscreen to shade animation (on lockscreen swipe down). */ private float mFractionToShade; public NotificationShelf(Context context, AttributeSet attrs) { super(context, attrs); } Loading Loading @@ -233,13 +230,6 @@ public class NotificationShelf extends ActivatableNotificationView implements mActualWidth = actualWidth; } /** * @param fractionToShade Fraction of lockscreen to shade transition */ public void setFractionToShade(float fractionToShade) { mFractionToShade = fractionToShade; } /** * @return Actual width of shelf, accounting for possible ongoing width animation */ Loading Loading @@ -411,7 +401,8 @@ public class NotificationShelf extends ActivatableNotificationView implements || !mShowNotificationShelf || numViewsInShelf < 1f; final float fractionToShade = Interpolators.STANDARD.getInterpolation(mFractionToShade); final float fractionToShade = Interpolators.STANDARD.getInterpolation( mAmbientState.getFractionToShade()); final float shortestWidth = mShelfIcons.calculateWidthFor(numViewsInShelf); updateActualWidth(fractionToShade, shortestWidth); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +17 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,23 @@ public class AmbientState { private boolean mAppearing; private float mPulseHeight = MAX_PULSE_HEIGHT; /** Fraction of lockscreen to shade animation (on lockscreen swipe down). */ private float mFractionToShade; /** * @param fractionToShade Fraction of lockscreen to shade transition */ public void setFractionToShade(float fractionToShade) { mFractionToShade = fractionToShade; } /** * @return fractionToShade Fraction of lockscreen to shade transition */ public float getFractionToShade() { return mFractionToShade; } /** How we much we are sleeping. 1f fully dozing (AOD), 0f fully awake (for all other states) */ private float mDozeAmount = 0.0f; Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +2 −2 Original line number Diff line number Diff line Loading @@ -2295,7 +2295,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable int visibleIndex ) { return mStackScrollAlgorithm.getGapHeightForChild(mSectionsManager, visibleIndex, current, previous); previous, mAmbientState.getFractionToShade(), mAmbientState.isOnKeyguard()); } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) Loading Loading @@ -5501,7 +5501,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable * where it remains until the next lockscreen-to-shade transition. */ public void setFractionToShade(float fraction) { mShelf.setFractionToShade(fraction); mAmbientState.setFractionToShade(fraction); requestChildrenUpdate(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +24 −5 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ public class StackScrollAlgorithm { private int mPaddingBetweenElements; private int mGapHeight; private int mGapHeightOnLockscreen; private int mCollapsedSize; private StackScrollAlgorithmState mTempAlgorithmState = new StackScrollAlgorithmState(); Loading Loading @@ -87,6 +88,8 @@ public class StackScrollAlgorithm { mPinnedZTranslationExtra = res.getDimensionPixelSize( R.dimen.heads_up_pinned_elevation); mGapHeight = res.getDimensionPixelSize(R.dimen.notification_section_divider_height); mGapHeightOnLockscreen = res.getDimensionPixelSize( R.dimen.notification_section_divider_height_lockscreen); mNotificationScrimPadding = res.getDimensionPixelSize(R.dimen.notification_side_paddings); mMarginBottom = res.getDimensionPixelSize(R.dimen.notification_panel_margin_bottom); } Loading Loading @@ -305,7 +308,8 @@ public class StackScrollAlgorithm { ambientState.getSectionProvider(), i, view, getPreviousView(i, state)); if (applyGapHeight) { currentY += mGapHeight; currentY += getGapForLocation( ambientState.getFractionToShade(), ambientState.isOnKeyguard()); } if (ambientState.getShelf() != null) { Loading Loading @@ -454,8 +458,10 @@ public class StackScrollAlgorithm { ambientState.getSectionProvider(), i, view, getPreviousView(i, algorithmState)); if (applyGapHeight) { algorithmState.mCurrentYPosition += expansionFraction * mGapHeight; algorithmState.mCurrentExpandedYPosition += mGapHeight; final float gap = getGapForLocation( ambientState.getFractionToShade(), ambientState.isOnKeyguard()); algorithmState.mCurrentYPosition += expansionFraction * gap; algorithmState.mCurrentExpandedYPosition += gap; } viewState.yTranslation = algorithmState.mCurrentYPosition; Loading Loading @@ -539,16 +545,29 @@ public class StackScrollAlgorithm { SectionProvider sectionProvider, int visibleIndex, View child, View previousChild) { View previousChild, float fractionToShade, boolean onKeyguard) { if (childNeedsGapHeight(sectionProvider, visibleIndex, child, previousChild)) { return mGapHeight; return getGapForLocation(fractionToShade, onKeyguard); } else { return 0; } } @VisibleForTesting float getGapForLocation(float fractionToShade, boolean onKeyguard) { if (fractionToShade > 0f) { return MathUtils.lerp(mGapHeightOnLockscreen, mGapHeight, fractionToShade); } if (onKeyguard) { return mGapHeightOnLockscreen; } return mGapHeight; } /** * Does a given child need a gap, i.e spacing before a view? * Loading Loading
packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Diff line number Diff line Loading @@ -561,6 +561,9 @@ <!-- The height of the gap between adjacent notification sections. --> <dimen name="notification_section_divider_height">@dimen/notification_side_paddings</dimen> <!-- The height of the gap between adjacent notification sections on lockscreen. --> <dimen name="notification_section_divider_height_lockscreen">4dp</dimen> <!-- Size of the face pile shown on one-line (children of a group) conversation notifications --> <dimen name="conversation_single_line_face_pile_size">24dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +2 −11 Original line number Diff line number Diff line Loading @@ -85,9 +85,6 @@ public class NotificationShelf extends ActivatableNotificationView implements private NotificationShelfController mController; private float mActualWidth = -1; /** Fraction of lockscreen to shade animation (on lockscreen swipe down). */ private float mFractionToShade; public NotificationShelf(Context context, AttributeSet attrs) { super(context, attrs); } Loading Loading @@ -233,13 +230,6 @@ public class NotificationShelf extends ActivatableNotificationView implements mActualWidth = actualWidth; } /** * @param fractionToShade Fraction of lockscreen to shade transition */ public void setFractionToShade(float fractionToShade) { mFractionToShade = fractionToShade; } /** * @return Actual width of shelf, accounting for possible ongoing width animation */ Loading Loading @@ -411,7 +401,8 @@ public class NotificationShelf extends ActivatableNotificationView implements || !mShowNotificationShelf || numViewsInShelf < 1f; final float fractionToShade = Interpolators.STANDARD.getInterpolation(mFractionToShade); final float fractionToShade = Interpolators.STANDARD.getInterpolation( mAmbientState.getFractionToShade()); final float shortestWidth = mShelfIcons.calculateWidthFor(numViewsInShelf); updateActualWidth(fractionToShade, shortestWidth); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +17 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,23 @@ public class AmbientState { private boolean mAppearing; private float mPulseHeight = MAX_PULSE_HEIGHT; /** Fraction of lockscreen to shade animation (on lockscreen swipe down). */ private float mFractionToShade; /** * @param fractionToShade Fraction of lockscreen to shade transition */ public void setFractionToShade(float fractionToShade) { mFractionToShade = fractionToShade; } /** * @return fractionToShade Fraction of lockscreen to shade transition */ public float getFractionToShade() { return mFractionToShade; } /** How we much we are sleeping. 1f fully dozing (AOD), 0f fully awake (for all other states) */ private float mDozeAmount = 0.0f; Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +2 −2 Original line number Diff line number Diff line Loading @@ -2295,7 +2295,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable int visibleIndex ) { return mStackScrollAlgorithm.getGapHeightForChild(mSectionsManager, visibleIndex, current, previous); previous, mAmbientState.getFractionToShade(), mAmbientState.isOnKeyguard()); } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) Loading Loading @@ -5501,7 +5501,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable * where it remains until the next lockscreen-to-shade transition. */ public void setFractionToShade(float fraction) { mShelf.setFractionToShade(fraction); mAmbientState.setFractionToShade(fraction); requestChildrenUpdate(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +24 −5 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ public class StackScrollAlgorithm { private int mPaddingBetweenElements; private int mGapHeight; private int mGapHeightOnLockscreen; private int mCollapsedSize; private StackScrollAlgorithmState mTempAlgorithmState = new StackScrollAlgorithmState(); Loading Loading @@ -87,6 +88,8 @@ public class StackScrollAlgorithm { mPinnedZTranslationExtra = res.getDimensionPixelSize( R.dimen.heads_up_pinned_elevation); mGapHeight = res.getDimensionPixelSize(R.dimen.notification_section_divider_height); mGapHeightOnLockscreen = res.getDimensionPixelSize( R.dimen.notification_section_divider_height_lockscreen); mNotificationScrimPadding = res.getDimensionPixelSize(R.dimen.notification_side_paddings); mMarginBottom = res.getDimensionPixelSize(R.dimen.notification_panel_margin_bottom); } Loading Loading @@ -305,7 +308,8 @@ public class StackScrollAlgorithm { ambientState.getSectionProvider(), i, view, getPreviousView(i, state)); if (applyGapHeight) { currentY += mGapHeight; currentY += getGapForLocation( ambientState.getFractionToShade(), ambientState.isOnKeyguard()); } if (ambientState.getShelf() != null) { Loading Loading @@ -454,8 +458,10 @@ public class StackScrollAlgorithm { ambientState.getSectionProvider(), i, view, getPreviousView(i, algorithmState)); if (applyGapHeight) { algorithmState.mCurrentYPosition += expansionFraction * mGapHeight; algorithmState.mCurrentExpandedYPosition += mGapHeight; final float gap = getGapForLocation( ambientState.getFractionToShade(), ambientState.isOnKeyguard()); algorithmState.mCurrentYPosition += expansionFraction * gap; algorithmState.mCurrentExpandedYPosition += gap; } viewState.yTranslation = algorithmState.mCurrentYPosition; Loading Loading @@ -539,16 +545,29 @@ public class StackScrollAlgorithm { SectionProvider sectionProvider, int visibleIndex, View child, View previousChild) { View previousChild, float fractionToShade, boolean onKeyguard) { if (childNeedsGapHeight(sectionProvider, visibleIndex, child, previousChild)) { return mGapHeight; return getGapForLocation(fractionToShade, onKeyguard); } else { return 0; } } @VisibleForTesting float getGapForLocation(float fractionToShade, boolean onKeyguard) { if (fractionToShade > 0f) { return MathUtils.lerp(mGapHeightOnLockscreen, mGapHeight, fractionToShade); } if (onKeyguard) { return mGapHeightOnLockscreen; } return mGapHeight; } /** * Does a given child need a gap, i.e spacing before a view? * Loading