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

Commit 1e23fac1 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "AOD: Update wakeup animation" into oc-dev am: 40b34460 am: a6ca1c47"

parents a73ee841 5a81ac81
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,8 @@ public interface DozeHost {
    void abortPulsing();
    void abortPulsing();
    void extendPulse();
    void extendPulse();


    void setAnimateWakeup(boolean animateWakeup);

    interface Callback {
    interface Callback {
        default void onNotificationHeadsUp() {}
        default void onNotificationHeadsUp() {}
        default void onPowerSaveChanged(boolean active) {}
        default void onPowerSaveChanged(boolean active) {}
+13 −0
Original line number Original line Diff line number Diff line
@@ -96,6 +96,19 @@ public class DozeUi implements DozeMachine.Part {
                unscheduleTimeTick();
                unscheduleTimeTick();
                break;
                break;
        }
        }
        mHost.setAnimateWakeup(shouldAnimateWakeup(newState));
    }

    private boolean shouldAnimateWakeup(DozeMachine.State state) {
        switch (state) {
            case DOZE_AOD:
            case DOZE_REQUEST_PULSE:
            case DOZE_PULSING:
            case DOZE_PULSE_DONE:
                return true;
            default:
                return false;
        }
    }
    }


    private void scheduleTimeTick() {
    private void scheduleTimeTick() {
+3 −11
Original line number Original line Diff line number Diff line
@@ -50,7 +50,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView


    private static final int BACKGROUND_ANIMATION_LENGTH_MS = 220;
    private static final int BACKGROUND_ANIMATION_LENGTH_MS = 220;
    private static final int ACTIVATE_ANIMATION_LENGTH = 220;
    private static final int ACTIVATE_ANIMATION_LENGTH = 220;
    private static final int DARK_ANIMATION_LENGTH = 170;
    private static final long DARK_ANIMATION_LENGTH = StackStateAnimator.ANIMATION_DURATION_WAKEUP;


    /**
    /**
     * The amount of width, which is kept in the end when performing a disappear animation (also
     * The amount of width, which is kept in the end when performing a disappear animation (also
@@ -418,7 +418,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        }
        }
        mDark = dark;
        mDark = dark;
        updateBackground();
        updateBackground();
        updateBackgroundTint(fade);
        updateBackgroundTint(false);
        if (!dark && fade && !shouldHideBackground()) {
        if (!dark && fade && !shouldHideBackground()) {
            fadeInFromDark(delay);
            fadeInFromDark(delay);
        }
        }
@@ -555,23 +555,15 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        final View background = mDimmed ? mBackgroundDimmed : mBackgroundNormal;
        final View background = mDimmed ? mBackgroundDimmed : mBackgroundNormal;
        background.setAlpha(0f);
        background.setAlpha(0f);
        mBackgroundVisibilityUpdater.onAnimationUpdate(null);
        mBackgroundVisibilityUpdater.onAnimationUpdate(null);
        background.setPivotX(mBackgroundDimmed.getWidth() / 2f);
        background.setPivotY(getActualHeight() / 2f);
        background.setScaleX(DARK_EXIT_SCALE_START);
        background.setScaleY(DARK_EXIT_SCALE_START);
        background.animate()
        background.animate()
                .alpha(1f)
                .alpha(1f)
                .scaleX(1f)
                .scaleY(1f)
                .setDuration(DARK_ANIMATION_LENGTH)
                .setDuration(DARK_ANIMATION_LENGTH)
                .setStartDelay(delay)
                .setStartDelay(delay)
                .setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN)
                .setInterpolator(Interpolators.ALPHA_IN)
                .setListener(new AnimatorListenerAdapter() {
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    @Override
                    public void onAnimationCancel(Animator animation) {
                    public void onAnimationCancel(Animator animation) {
                        // Jump state if we are cancelled
                        // Jump state if we are cancelled
                        background.setScaleX(1f);
                        background.setScaleY(1f);
                        background.setAlpha(1f);
                        background.setAlpha(1f);
                    }
                    }
                })
                })
+4 −0
Original line number Original line Diff line number Diff line
@@ -1406,6 +1406,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
    @Override
    @Override
    public void setDark(boolean dark, boolean fade, long delay) {
    public void setDark(boolean dark, boolean fade, long delay) {
        super.setDark(dark, fade, delay);
        super.setDark(dark, fade, delay);
        if (!mIsHeadsUp) {
            // Only fade the showing view of the pulsing notification.
            fade = false;
        }
        final NotificationContentView showing = getShowingLayout();
        final NotificationContentView showing = getShowingLayout();
        if (showing != null) {
        if (showing != null) {
            showing.setDark(dark, fade, delay);
            showing.setDark(dark, fade, delay);
+1 −1
Original line number Original line Diff line number Diff line
@@ -437,7 +437,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
        if (iconState != null) {
        if (iconState != null) {
            iconState.scaleX = newSize / icon.getHeight() / icon.getIconScale();
            iconState.scaleX = newSize / icon.getHeight() / icon.getIconScale();
            iconState.scaleY = iconState.scaleX;
            iconState.scaleY = iconState.scaleX;
            iconState.hidden = transitionAmount == 0.0f;
            iconState.hidden = transitionAmount == 0.0f && !iconState.isAnimating(icon);
            iconState.alpha = alpha;
            iconState.alpha = alpha;
            iconState.yTranslation = iconYTranslation;
            iconState.yTranslation = iconYTranslation;
            if (stayingInShelf) {
            if (stayingInShelf) {
Loading