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

Commit 1a1cc614 authored by Stefan Andonian's avatar Stefan Andonian Committed by Automerger Merge Worker
Browse files

Stop clock icon from jankily changing on user tap. am: c37ae1c5 am: 75264649 am: 82f9b141

parents f42185d0 82f9b141
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -422,6 +422,18 @@ public class ClockDrawableWrapper extends AdaptiveIconDrawable implements Bitmap
            reschedule();
        }

        @Override
        public boolean setState(int[] stateSet) {
            // If the user has just pressed the clock icon, and the clock app is launching,
            // we don't want to change the time shown. Doing so can result in jank.
            for (int state: stateSet) {
                if (state == android.R.attr.state_pressed) {
                    return false;
                }
            }
            return super.setState(stateSet);
        }

        @Override
        public boolean isThemed() {
            return mBgPaint.getColorFilter() != null;