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

Commit e0677abe authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Animate shade blur fallback

Instead of dispatch and apply state in ScrimController, we call startAnimation on each scrim with the current scrim tints saved before repreparing the states (to update colors based on blur state).

The transition works well in the unlocked state but more work possibly needs to be done for the bouncer.

Bug: 388891313
Test: manual
Flag: com.android.systemui.notification_shade_blur
Change-Id: I95d7dd0b5207f392620cf1d624b193bf3594e84b
parent c9aa38fc
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -533,7 +533,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
    private void handleBlurSupportedChanged(boolean isBlurSupported) {
        this.mIsBlurSupported = isBlurSupported;
        if (Flags.bouncerUiRevamp()) {
            updateDefaultScrimAlphas();
            // TODO: animate blur fallback when the bouncer is pulled up.
            for (ScrimState state : ScrimState.values()) {
                state.setDefaultScrimAlpha(getDefaultScrimAlpha(true));
            }
            if (isBlurSupported) {
                ScrimState.BOUNCER_SCRIMMED.setNotifBlurRadius(mBlurConfig.getMaxBlurRadiusPx());
            } else {
@@ -541,7 +544,17 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
            }
        }
        if (Flags.notificationShadeBlur()) {
            float inFrontAlpha = mInFrontAlpha;
            float behindAlpha = mBehindAlpha;
            float notifAlpha = mNotificationsAlpha;

            mState.prepare(mState);
            applyState();
            startScrimAnimation(mScrimBehind, behindAlpha);
            startScrimAnimation(mNotificationsScrim, notifAlpha);
            startScrimAnimation(mScrimInFront, inFrontAlpha);
            dispatchBackScrimState(mScrimBehind.getViewAlpha());
        } else if (Flags.bouncerUiRevamp()) {
            applyAndDispatchState();
        }
    }