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

Commit 5031523f authored by Selim Cinek's avatar Selim Cinek Committed by android-build-merger
Browse files

Merge "Fixed a bug where notification icons were not animating when dozing" into nyc-dev

am: e001805c

* commit 'e001805c':
  Fixed a bug where notification icons were not animating when dozing
parents b4bb6d5f e001805c
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -4494,7 +4494,20 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        }

        private void handlePulseWhileDozing(@NonNull PulseCallback callback, int reason) {
            mDozeScrimController.pulse(callback, reason);
            mDozeScrimController.pulse(new PulseCallback() {

                @Override
                public void onPulseStarted() {
                    callback.onPulseStarted();
                    mStackScroller.setPulsing(true);
                }

                @Override
                public void onPulseFinished() {
                    callback.onPulseFinished();
                    mStackScroller.setPulsing(false);
                }
            }, reason);
        }

        private void handleStopDozing() {
+9 −2
Original line number Diff line number Diff line
@@ -324,6 +324,7 @@ public class NotificationStackScrollLayout extends ViewGroup
        }
    };
    private PorterDuffXfermode mSrcMode = new PorterDuffXfermode(PorterDuff.Mode.SRC);
    private boolean mPulsing;

    public NotificationStackScrollLayout(Context context) {
        this(context, null);
@@ -2194,7 +2195,7 @@ public class NotificationStackScrollLayout extends ViewGroup
    }

    private void updateNotificationAnimationStates() {
        boolean running = mAnimationsEnabled;
        boolean running = mAnimationsEnabled || mPulsing;
        int childCount = getChildCount();
        for (int i = 0; i < childCount; i++) {
            View child = getChildAt(i);
@@ -2204,7 +2205,8 @@ public class NotificationStackScrollLayout extends ViewGroup
    }

    private void updateAnimationState(View child) {
        updateAnimationState(mAnimationsEnabled && (mIsExpanded || isPinnedHeadsUp(child)), child);
        updateAnimationState((mAnimationsEnabled || mPulsing)
                && (mIsExpanded || isPinnedHeadsUp(child)), child);
    }


@@ -3322,6 +3324,11 @@ public class NotificationStackScrollLayout extends ViewGroup
        return mIsExpanded;
    }

    public void setPulsing(boolean pulsing) {
        mPulsing = pulsing;
        updateNotificationAnimationStates();
    }

    /**
     * A listener that is notified when some child locations might have changed.
     */