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

Commit dabdab01 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Adjust notification scrim tint interpolator

The scrim was fading too fast on foldables, we should time it better
with the content fade in.

Test: manual
Test: atest ScrimControllerTest
Fixes: 213303985
Change-Id: I2a3a5a173de52cfbd2248d5a8f2f0cf824010743
parent feb567fa
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -707,7 +707,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
                    mNotificationsAlpha = behindFraction * mDefaultScrimAlpha;
                } else {
                    mBehindAlpha = behindFraction * mDefaultScrimAlpha;
                    mNotificationsAlpha = mBehindAlpha;
                    // Delay fade-in of notification scrim a bit further, to coincide with the
                    // view fade in. Otherwise the empty panel can be quite jarring.
                    mNotificationsAlpha = MathUtils.constrainedMap(0f, 1f, 0.3f, 0.75f,
                            mPanelExpansionFraction);
                }
                mInFrontAlpha = 0;
            }
+9 −1
Original line number Diff line number Diff line
@@ -647,8 +647,15 @@ public class ScrimControllerTest extends SysuiTestCase {
        mScrimController.setRawPanelExpansionFraction(0.3f);
        assertScrimAlpha(Map.of(
                mScrimInFront, TRANSPARENT,
                mNotificationsScrim, SEMI_TRANSPARENT,
                mNotificationsScrim, TRANSPARENT,
                mScrimBehind, SEMI_TRANSPARENT));

        // Then, notification scrim should fade in
        mScrimController.setRawPanelExpansionFraction(0.7f);
        assertScrimAlpha(Map.of(
                mScrimInFront, TRANSPARENT,
                mNotificationsScrim, SEMI_TRANSPARENT,
                mScrimBehind, OPAQUE));
    }


@@ -1132,6 +1139,7 @@ public class ScrimControllerTest extends SysuiTestCase {

    @Test
    public void testScrimsVisible_whenShadeVisible() {
        mScrimController.setClipsQsScrim(true);
        mScrimController.transitionTo(ScrimState.UNLOCKED);
        mScrimController.setRawPanelExpansionFraction(0.3f);
        // notifications scrim alpha change require calling setQsPosition