Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +15 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ public class AmbientState implements Dumpable { private float mAppearFraction; private float mOverExpansion; private int mStackTopMargin; private boolean mUseSplitShade; /** Distance of top of notifications panel from top of screen. */ private float mStackY = 0; Loading Loading @@ -227,6 +228,20 @@ public class AmbientState implements Dumpable { mIsFlinging = isFlinging; } /** * @param useSplitShade True if we are showing split shade. */ public void setUseSplitShade(boolean useSplitShade) { mUseSplitShade = useSplitShade; } /** * @return True if we are showing split shade. */ public boolean getUseSplitShade() { return mUseSplitShade; } /** * @return Fraction of shade expansion. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +1 −0 Original line number Diff line number Diff line Loading @@ -5690,6 +5690,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable boolean split = mSplitShadeStateController.shouldUseSplitNotificationShade(getResources()); if (split != mShouldUseSplitNotificationShade) { mShouldUseSplitNotificationShade = split; mAmbientState.setUseSplitShade(split); updateDismissBehavior(); updateUseRoundedRectClipping(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +10 −5 Original line number Diff line number Diff line Loading @@ -572,7 +572,8 @@ public class StackScrollAlgorithm { float viewEnd = viewState.getYTranslation() + viewState.height + ambientState.getStackY(); maybeUpdateHeadsUpIsVisible(viewState, ambientState.isShadeExpanded(), view.mustStayOnScreen(), /* topVisible */ viewState.getYTranslation() >= 0, view.mustStayOnScreen(), /* topVisible= */ viewState.getYTranslation() >= mNotificationScrimPadding, viewEnd, /* hunMax */ ambientState.getMaxHeadsUpTranslation() ); if (view instanceof FooterView) { Loading Loading @@ -777,8 +778,12 @@ public class StackScrollAlgorithm { if (shouldHunBeVisibleWhenScrolled(row.mustStayOnScreen(), childState.headsUpIsVisible, row.showingPulsing(), ambientState.isOnKeyguard(), row.getEntry().isStickyAndNotDemoted())) { // Ensure that the heads up is always visible even when scrolled off clampHunToTop(mQuickQsOffsetHeight, ambientState.getStackTranslation(), // Ensure that the heads up is always visible even when scrolled off. // NSSL y starts at top of screen in non-split-shade, but below the qs offset // in split shade, so we only need to inset by the scrim padding in split shade. final float clampInset = ambientState.getUseSplitShade() ? mNotificationScrimPadding : mQuickQsOffsetHeight; clampHunToTop(clampInset, ambientState.getStackTranslation(), row.getCollapsedHeight(), childState); if (isTopEntry && row.isAboveShelf()) { // the first hun can't get off screen. Loading Loading @@ -838,10 +843,10 @@ public class StackScrollAlgorithm { * Transition pinned collapsed HUN to full height when scrolling back up. */ @VisibleForTesting void clampHunToTop(float quickQsOffsetHeight, float stackTranslation, float collapsedHeight, void clampHunToTop(float clampInset, float stackTranslation, float collapsedHeight, ExpandableViewState viewState) { final float newTranslation = Math.max(quickQsOffsetHeight + stackTranslation, final float newTranslation = Math.max(clampInset + stackTranslation, viewState.getYTranslation()); // Transition from collapsed pinned state to fully expanded state Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +15 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ public class AmbientState implements Dumpable { private float mAppearFraction; private float mOverExpansion; private int mStackTopMargin; private boolean mUseSplitShade; /** Distance of top of notifications panel from top of screen. */ private float mStackY = 0; Loading Loading @@ -227,6 +228,20 @@ public class AmbientState implements Dumpable { mIsFlinging = isFlinging; } /** * @param useSplitShade True if we are showing split shade. */ public void setUseSplitShade(boolean useSplitShade) { mUseSplitShade = useSplitShade; } /** * @return True if we are showing split shade. */ public boolean getUseSplitShade() { return mUseSplitShade; } /** * @return Fraction of shade expansion. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +1 −0 Original line number Diff line number Diff line Loading @@ -5690,6 +5690,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable boolean split = mSplitShadeStateController.shouldUseSplitNotificationShade(getResources()); if (split != mShouldUseSplitNotificationShade) { mShouldUseSplitNotificationShade = split; mAmbientState.setUseSplitShade(split); updateDismissBehavior(); updateUseRoundedRectClipping(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +10 −5 Original line number Diff line number Diff line Loading @@ -572,7 +572,8 @@ public class StackScrollAlgorithm { float viewEnd = viewState.getYTranslation() + viewState.height + ambientState.getStackY(); maybeUpdateHeadsUpIsVisible(viewState, ambientState.isShadeExpanded(), view.mustStayOnScreen(), /* topVisible */ viewState.getYTranslation() >= 0, view.mustStayOnScreen(), /* topVisible= */ viewState.getYTranslation() >= mNotificationScrimPadding, viewEnd, /* hunMax */ ambientState.getMaxHeadsUpTranslation() ); if (view instanceof FooterView) { Loading Loading @@ -777,8 +778,12 @@ public class StackScrollAlgorithm { if (shouldHunBeVisibleWhenScrolled(row.mustStayOnScreen(), childState.headsUpIsVisible, row.showingPulsing(), ambientState.isOnKeyguard(), row.getEntry().isStickyAndNotDemoted())) { // Ensure that the heads up is always visible even when scrolled off clampHunToTop(mQuickQsOffsetHeight, ambientState.getStackTranslation(), // Ensure that the heads up is always visible even when scrolled off. // NSSL y starts at top of screen in non-split-shade, but below the qs offset // in split shade, so we only need to inset by the scrim padding in split shade. final float clampInset = ambientState.getUseSplitShade() ? mNotificationScrimPadding : mQuickQsOffsetHeight; clampHunToTop(clampInset, ambientState.getStackTranslation(), row.getCollapsedHeight(), childState); if (isTopEntry && row.isAboveShelf()) { // the first hun can't get off screen. Loading Loading @@ -838,10 +843,10 @@ public class StackScrollAlgorithm { * Transition pinned collapsed HUN to full height when scrolling back up. */ @VisibleForTesting void clampHunToTop(float quickQsOffsetHeight, float stackTranslation, float collapsedHeight, void clampHunToTop(float clampInset, float stackTranslation, float collapsedHeight, ExpandableViewState viewState) { final float newTranslation = Math.max(quickQsOffsetHeight + stackTranslation, final float newTranslation = Math.max(clampInset + stackTranslation, viewState.getYTranslation()); // Transition from collapsed pinned state to fully expanded state Loading