Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +15 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ public class AmbientState { private int mExpandAnimationTopChange; private ExpandableNotificationRow mExpandingNotification; private float mHideAmount; private float mNotificationScrimTop; private boolean mAppearing; private float mPulseHeight = MAX_PULSE_HEIGHT; private float mDozeAmount = 0.0f; Loading Loading @@ -255,6 +256,20 @@ public class AmbientState { return mHideAmount; } /** * Set y position of top of notifications background scrim, relative to top of screen. */ public void setNotificationScrimTop(float notificationScrimTop) { mNotificationScrimTop = notificationScrimTop; } /** * @return Y position of top of notifications background scrim, relative to top of screen. */ public float getNotificationScrimTop() { return mNotificationScrimTop; } public void setHideSensitive(boolean hideSensitive) { mHideSensitive = hideSensitive; } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +3 −4 Original line number Diff line number Diff line Loading @@ -1008,9 +1008,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) private void updateClippingToTopRoundedCorner() { Float clipStart = (float) mTopPadding + mStackTranslation + mAmbientState.getExpandAnimationTopChange(); Float clipStart = mAmbientState.getNotificationScrimTop(); Float clipEnd = clipStart + mCornerRadius; boolean first = true; for (int i = 0; i < getChildCount(); i++) { Loading @@ -1023,7 +1021,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable boolean clip = clipStart > start && clipStart < end || clipEnd >= start && clipEnd <= end; clip &= !(first && mScrollAdapter.isScrolledToTop()); child.setDistanceToTopRoundness(ExpandableView.NO_ROUNDNESS); child.setDistanceToTopRoundness(clip ? Math.max(start - clipStart, 0) : ExpandableView.NO_ROUNDNESS); first = false; } } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +3 −3 Original line number Diff line number Diff line Loading @@ -156,9 +156,9 @@ public class StackScrollAlgorithm { private void updateClipping(StackScrollAlgorithmState algorithmState, AmbientState ambientState) { float drawStart = !ambientState.isOnKeyguard() ? ambientState.getStackY() - ambientState.getScrollY() : 0; float clipStart = 0; float drawStart = ambientState.isOnKeyguard() ? 0 : ambientState.getStackY() - ambientState.getScrollY(); float clipStart = ambientState.getNotificationScrimTop(); int childCount = algorithmState.visibleChildren.size(); boolean firstHeadsUp = true; for (int i = 0; i < childCount; i++) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +7 −3 Original line number Diff line number Diff line Loading @@ -331,7 +331,7 @@ public class NotificationPanelViewController extends PanelViewController { private LockIconViewController mLockIconViewController; private NotificationsQuickSettingsContainer mNotificationContainerParent; private boolean mAnimateNextPositionUpdate; private float mQuickQsOffsetHeight; private int mTrackingPointer; private VelocityTracker mQsVelocityTracker; private boolean mQsTracking; Loading Loading @@ -943,6 +943,8 @@ public class NotificationPanelViewController extends PanelViewController { } public void updateResources() { mQuickQsOffsetHeight = mResources.getDimensionPixelSize( com.android.internal.R.dimen.quick_qs_offset_height); mSplitShadeNotificationsTopPadding = mResources.getDimensionPixelSize(R.dimen.notifications_top_padding_split_shade); int qsWidth = mResources.getDimensionPixelSize(R.dimen.qs_panel_width); Loading Loading @@ -2170,7 +2172,8 @@ public class NotificationPanelViewController extends PanelViewController { // can be wrong during transitions when waiting for the keyguard to unlock top = mTransitionToFullShadeQSPosition; } else { float notificationTop = getQSEdgePosition(); final float notificationTop = getQSEdgePosition(); mAmbientState.setNotificationScrimTop(notificationTop); top = (int) (isOnKeyguard() ? Math.min(qsPanelBottomY, notificationTop) : notificationTop); } Loading Loading @@ -2252,7 +2255,8 @@ public class NotificationPanelViewController extends PanelViewController { private float getQSEdgePosition() { // TODO: replace StackY with unified calculation return mAmbientState.getStackY() - mAmbientState.getScrollY(); return Math.max(mQuickQsOffsetHeight * mAmbientState.getExpansionFraction(), mAmbientState.getStackY() - mAmbientState.getScrollY()); } private int calculateQsBottomPosition(float qsExpansionFraction) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +15 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ public class AmbientState { private int mExpandAnimationTopChange; private ExpandableNotificationRow mExpandingNotification; private float mHideAmount; private float mNotificationScrimTop; private boolean mAppearing; private float mPulseHeight = MAX_PULSE_HEIGHT; private float mDozeAmount = 0.0f; Loading Loading @@ -255,6 +256,20 @@ public class AmbientState { return mHideAmount; } /** * Set y position of top of notifications background scrim, relative to top of screen. */ public void setNotificationScrimTop(float notificationScrimTop) { mNotificationScrimTop = notificationScrimTop; } /** * @return Y position of top of notifications background scrim, relative to top of screen. */ public float getNotificationScrimTop() { return mNotificationScrimTop; } public void setHideSensitive(boolean hideSensitive) { mHideSensitive = hideSensitive; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +3 −4 Original line number Diff line number Diff line Loading @@ -1008,9 +1008,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) private void updateClippingToTopRoundedCorner() { Float clipStart = (float) mTopPadding + mStackTranslation + mAmbientState.getExpandAnimationTopChange(); Float clipStart = mAmbientState.getNotificationScrimTop(); Float clipEnd = clipStart + mCornerRadius; boolean first = true; for (int i = 0; i < getChildCount(); i++) { Loading @@ -1023,7 +1021,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable boolean clip = clipStart > start && clipStart < end || clipEnd >= start && clipEnd <= end; clip &= !(first && mScrollAdapter.isScrolledToTop()); child.setDistanceToTopRoundness(ExpandableView.NO_ROUNDNESS); child.setDistanceToTopRoundness(clip ? Math.max(start - clipStart, 0) : ExpandableView.NO_ROUNDNESS); first = false; } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +3 −3 Original line number Diff line number Diff line Loading @@ -156,9 +156,9 @@ public class StackScrollAlgorithm { private void updateClipping(StackScrollAlgorithmState algorithmState, AmbientState ambientState) { float drawStart = !ambientState.isOnKeyguard() ? ambientState.getStackY() - ambientState.getScrollY() : 0; float clipStart = 0; float drawStart = ambientState.isOnKeyguard() ? 0 : ambientState.getStackY() - ambientState.getScrollY(); float clipStart = ambientState.getNotificationScrimTop(); int childCount = algorithmState.visibleChildren.size(); boolean firstHeadsUp = true; for (int i = 0; i < childCount; i++) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +7 −3 Original line number Diff line number Diff line Loading @@ -331,7 +331,7 @@ public class NotificationPanelViewController extends PanelViewController { private LockIconViewController mLockIconViewController; private NotificationsQuickSettingsContainer mNotificationContainerParent; private boolean mAnimateNextPositionUpdate; private float mQuickQsOffsetHeight; private int mTrackingPointer; private VelocityTracker mQsVelocityTracker; private boolean mQsTracking; Loading Loading @@ -943,6 +943,8 @@ public class NotificationPanelViewController extends PanelViewController { } public void updateResources() { mQuickQsOffsetHeight = mResources.getDimensionPixelSize( com.android.internal.R.dimen.quick_qs_offset_height); mSplitShadeNotificationsTopPadding = mResources.getDimensionPixelSize(R.dimen.notifications_top_padding_split_shade); int qsWidth = mResources.getDimensionPixelSize(R.dimen.qs_panel_width); Loading Loading @@ -2170,7 +2172,8 @@ public class NotificationPanelViewController extends PanelViewController { // can be wrong during transitions when waiting for the keyguard to unlock top = mTransitionToFullShadeQSPosition; } else { float notificationTop = getQSEdgePosition(); final float notificationTop = getQSEdgePosition(); mAmbientState.setNotificationScrimTop(notificationTop); top = (int) (isOnKeyguard() ? Math.min(qsPanelBottomY, notificationTop) : notificationTop); } Loading Loading @@ -2252,7 +2255,8 @@ public class NotificationPanelViewController extends PanelViewController { private float getQSEdgePosition() { // TODO: replace StackY with unified calculation return mAmbientState.getStackY() - mAmbientState.getScrollY(); return Math.max(mQuickQsOffsetHeight * mAmbientState.getExpansionFraction(), mAmbientState.getStackY() - mAmbientState.getScrollY()); } private int calculateQsBottomPosition(float qsExpansionFraction) { Loading