Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fe03850 authored by Steve Elliott's avatar Steve Elliott Committed by Android (Google) Code Review
Browse files

Merge "[flexiglass] Disable NSSL height updates for some Lockscreen transitions" into main

parents 2cda5d2e 5b9b1936
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -224,6 +224,7 @@ public class AmbientState implements Dumpable {
     * @param isSwipingUp Whether we are swiping up.
     */
    public void setSwipingUp(boolean isSwipingUp) {
        SceneContainerFlag.assertInLegacyMode();
        if (!isSwipingUp && mIsSwipingUp) {
            // Just stopped swiping up.
            mIsFlingRequiredAfterLockScreenSwipeUp = true;
@@ -242,6 +243,7 @@ public class AmbientState implements Dumpable {
     * @param isFlinging Whether we are flinging the shade open or closed.
     */
    public void setFlinging(boolean isFlinging) {
        SceneContainerFlag.assertInLegacyMode();
        if (isOnKeyguard() && !isFlinging && mIsFlinging) {
            // Just stopped flinging.
            mIsFlingRequiredAfterLockScreenSwipeUp = false;
@@ -717,6 +719,7 @@ public class AmbientState implements Dumpable {
     * @return Whether we need to do a fling down after swiping up on lockscreen.
     */
    public boolean isFlingingAfterSwipeUpOnLockscreen() {
        SceneContainerFlag.assertInLegacyMode();
        return mIsFlinging && mIsFlingRequiredAfterLockScreenSwipeUp;
    }

+15 −3
Original line number Diff line number Diff line
@@ -568,6 +568,7 @@ public class NotificationStackScrollLayout
    private boolean mHasFilteredOutSeenNotifications;
    @Nullable private SplitShadeStateController mSplitShadeStateController = null;
    private boolean mIsSmallLandscapeLockscreenEnabled = false;
    private boolean mSuppressHeightUpdates;

    /** Pass splitShadeStateController to view and update split shade */
    public void passSplitShadeStateController(SplitShadeStateController splitShadeStateController) {
@@ -1458,10 +1459,14 @@ public class NotificationStackScrollLayout
     * 2) Swiping up on lockscreen or flinging down after swipe up
     */
    private boolean shouldSkipHeightUpdate() {
        if (SceneContainerFlag.isEnabled()) {
            return mSuppressHeightUpdates;
        } else {
            return mAmbientState.isOnKeyguard()
                    && (mAmbientState.isSwipingUp()
                    || mAmbientState.isFlingingAfterSwipeUpOnLockscreen());
        }
    }

    /**
     * Apply expansion fraction to the y position and height of the notifications panel.
@@ -5399,6 +5404,7 @@ public class NotificationStackScrollLayout
    }

    public void setPanelFlinging(boolean flinging) {
        SceneContainerFlag.assertInLegacyMode();
        mAmbientState.setFlinging(flinging);
        if (!flinging) {
            // re-calculate the stack height which was frozen while flinging
@@ -5406,6 +5412,12 @@ public class NotificationStackScrollLayout
        }
    }

    @Override
    public void suppressHeightUpdates(boolean suppress) {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        mSuppressHeightUpdates = suppress;
    }

    public void setHeadsUpGoingAwayAnimationsAllowed(boolean headsUpGoingAwayAnimationsAllowed) {
        mHeadsUpGoingAwayAnimationsAllowed = headsUpGoingAwayAnimationsAllowed;
    }
+1 −0
Original line number Diff line number Diff line
@@ -1439,6 +1439,7 @@ public class NotificationStackScrollLayoutController implements Dumpable {
    }

    public void setPanelFlinging(boolean flinging) {
        SceneContainerFlag.assertInLegacyMode();
        mView.setPanelFlinging(flinging);
    }

+3 −0
Original line number Diff line number Diff line
@@ -124,4 +124,7 @@ interface NotificationScrollView {

    /** @see addHeadsUpHeightChangedListener */
    fun removeHeadsUpHeightChangedListener(runnable: Runnable)

    /** Sets whether updates to the stack are are suppressed. */
    fun suppressHeightUpdates(suppress: Boolean)
}
+1 −0
Original line number Diff line number Diff line
@@ -111,6 +111,7 @@ constructor(
            launch {
                viewModel.shouldCloseGuts.filter { it }.collect { view.closeGutsOnSceneTouch() }
            }
            launch { viewModel.suppressHeightUpdates.collect { view.suppressHeightUpdates(it) } }

            launchAndDispose {
                view.setSyntheticScrollConsumer(viewModel.syntheticScrollConsumer)
Loading