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

Commit 228f818f 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: df20a016

parents f42185d0 df20a016
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;