Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +7 −1 Original line number Diff line number Diff line Loading @@ -224,8 +224,14 @@ public class AmbientState { return mScrollY; } /** * Set the new Scroll Y position. */ public void setScrollY(int scrollY) { this.mScrollY = scrollY; // Because we're dealing with an overscroller, scrollY could sometimes become smaller than // 0. However this is only for internal purposes and the scroll position when read // should never be smaller than 0, otherwise it can lead to flickers. this.mScrollY = Math.max(scrollY, 0); } /** Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +3 −1 Original line number Diff line number Diff line Loading @@ -1185,7 +1185,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable private void updateStackPosition(boolean listenerNeedsAnimation) { // Consider interpolating from an mExpansionStartY for use on lockscreen and AOD float endTopPosition = mTopPadding + mExtraTopInsetForFullShadeTransition + mAmbientState.getOverExpansion(); + mAmbientState.getOverExpansion() - getCurrentOverScrollAmount(false /* top */); final float fraction = mAmbientState.getExpansionFraction(); final float stackY = MathUtils.lerp(0, endTopPosition, fraction); mAmbientState.setStackY(stackY); Loading Loading @@ -1907,6 +1908,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable if (onTop) { notifyOverscrollTopListener(amount, isRubberbanded); } updateStackPosition(); requestChildrenUpdate(); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +0 −4 Original line number Diff line number Diff line Loading @@ -1071,10 +1071,6 @@ public class NotificationStackScrollLayoutController { mView.setAlpha(alpha); } public float getCurrentOverScrollAmount(boolean top) { return mView.getCurrentOverScrollAmount(top); } public float calculateAppearFraction(float height) { return mView.calculateAppearFraction(height); } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +2 −8 Original line number Diff line number Diff line Loading @@ -218,13 +218,7 @@ public class StackScrollAlgorithm { */ private void initAlgorithmState(ViewGroup hostView, StackScrollAlgorithmState state, AmbientState ambientState) { float bottomOverScroll = ambientState.getOverScrollAmount(false /* onTop */); int scrollY = ambientState.getScrollY(); // Due to the overScroller, the stackscroller can have negative scroll state. This is // already accounted for by the top padding and doesn't need an additional adaption scrollY = Math.max(0, scrollY); state.scrollY = (int) (scrollY + bottomOverScroll); state.scrollY = ambientState.getScrollY(); state.mCurrentYPosition = -state.scrollY; state.mCurrentExpandedYPosition = -state.scrollY; Loading Loading @@ -261,7 +255,7 @@ public class StackScrollAlgorithm { // Save the index of first view in shelf from when shade is fully // expanded. Consider updating these states in updateContentView instead so that we don't // have to recalculate in every frame. float currentY = -scrollY; float currentY = -ambientState.getScrollY(); if (!ambientState.isOnKeyguard()) { currentY += mNotificationScrimPadding; } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +7 −1 Original line number Diff line number Diff line Loading @@ -224,8 +224,14 @@ public class AmbientState { return mScrollY; } /** * Set the new Scroll Y position. */ public void setScrollY(int scrollY) { this.mScrollY = scrollY; // Because we're dealing with an overscroller, scrollY could sometimes become smaller than // 0. However this is only for internal purposes and the scroll position when read // should never be smaller than 0, otherwise it can lead to flickers. this.mScrollY = Math.max(scrollY, 0); } /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +3 −1 Original line number Diff line number Diff line Loading @@ -1185,7 +1185,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable private void updateStackPosition(boolean listenerNeedsAnimation) { // Consider interpolating from an mExpansionStartY for use on lockscreen and AOD float endTopPosition = mTopPadding + mExtraTopInsetForFullShadeTransition + mAmbientState.getOverExpansion(); + mAmbientState.getOverExpansion() - getCurrentOverScrollAmount(false /* top */); final float fraction = mAmbientState.getExpansionFraction(); final float stackY = MathUtils.lerp(0, endTopPosition, fraction); mAmbientState.setStackY(stackY); Loading Loading @@ -1907,6 +1908,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable if (onTop) { notifyOverscrollTopListener(amount, isRubberbanded); } updateStackPosition(); requestChildrenUpdate(); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +0 −4 Original line number Diff line number Diff line Loading @@ -1071,10 +1071,6 @@ public class NotificationStackScrollLayoutController { mView.setAlpha(alpha); } public float getCurrentOverScrollAmount(boolean top) { return mView.getCurrentOverScrollAmount(top); } public float calculateAppearFraction(float height) { return mView.calculateAppearFraction(height); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +2 −8 Original line number Diff line number Diff line Loading @@ -218,13 +218,7 @@ public class StackScrollAlgorithm { */ private void initAlgorithmState(ViewGroup hostView, StackScrollAlgorithmState state, AmbientState ambientState) { float bottomOverScroll = ambientState.getOverScrollAmount(false /* onTop */); int scrollY = ambientState.getScrollY(); // Due to the overScroller, the stackscroller can have negative scroll state. This is // already accounted for by the top padding and doesn't need an additional adaption scrollY = Math.max(0, scrollY); state.scrollY = (int) (scrollY + bottomOverScroll); state.scrollY = ambientState.getScrollY(); state.mCurrentYPosition = -state.scrollY; state.mCurrentExpandedYPosition = -state.scrollY; Loading Loading @@ -261,7 +255,7 @@ public class StackScrollAlgorithm { // Save the index of first view in shelf from when shade is fully // expanded. Consider updating these states in updateContentView instead so that we don't // have to recalculate in every frame. float currentY = -scrollY; float currentY = -ambientState.getScrollY(); if (!ambientState.isOnKeyguard()) { currentY += mNotificationScrimPadding; } Loading