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

Commit 0bc291be authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Tune notifcation panel alpha in/out durations from brightness slider

Fixes: 402146162
Test: video in bug
Flag: com.android.systemui.notification_shade_blur
Change-Id: Ie4f4c8113b6e564e9c2ed729bf26dc1c9f325793
parent 1735ebc7
Loading
Loading
Loading
Loading
+16 −9
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.view.View.VISIBLE;

import static com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE;
import static com.android.systemui.Flags.msdlFeedback;
import static com.android.systemui.Flags.notificationShadeBlur;
import static com.android.systemui.Flags.predictiveBackAnimateShade;
import static com.android.systemui.classifier.Classifier.BOUNCER_UNLOCK;
import static com.android.systemui.classifier.Classifier.GENERIC;
@@ -247,6 +248,10 @@ public final class NotificationPanelViewController implements
     */
    private static final int MAX_TIME_TO_OPEN_WHEN_FLINGING_FROM_LAUNCHER = 300;
    private static final int MAX_DOWN_EVENT_BUFFER_SIZE = 50;

    private static final int PANEL_ALPHA_OUT_DURATION = notificationShadeBlur() ? 120 : 150;
    private static final int PANEL_ALPHA_IN_DURATION = notificationShadeBlur() ? 140 : 200;

    private static final String COUNTER_PANEL_OPEN = "panel_open";
    public static final String COUNTER_PANEL_OPEN_QS = "panel_open_qs";
    private static final String COUNTER_PANEL_OPEN_PEEK = "panel_open_peek";
@@ -438,14 +443,16 @@ public final class NotificationPanelViewController implements
            R.id.panel_alpha_animator_tag, R.id.panel_alpha_animator_start_tag,
            R.id.panel_alpha_animator_end_tag);
    private final AnimationProperties mPanelAlphaOutPropertiesAnimator =
            new AnimationProperties().setDuration(150).setCustomInterpolator(
            new AnimationProperties().setDuration(PANEL_ALPHA_OUT_DURATION).setCustomInterpolator(
                    mPanelAlphaAnimator.getProperty(), Interpolators.ALPHA_OUT);
    private final AnimationProperties mPanelAlphaInPropertiesAnimator =
            new AnimationProperties().setDuration(200).setAnimationEndAction((property) -> {
            new AnimationProperties().setDuration(PANEL_ALPHA_IN_DURATION).setAnimationEndAction(
                    (property) -> {
                        if (mPanelAlphaEndAction != null) {
                            mPanelAlphaEndAction.run();
                        }
                // Once the animation for the alpha has finished (NPV is visible again), dismiss
                        // Once the animation for the alpha has finished (NPV is visible again),
                        // dismiss
                        // the mirror
                        postToView(() -> mIsBrightnessMirrorShowing.setValue(false));
                    }).setCustomInterpolator(