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

Commit 19a01e22 authored by Stefan Andonian's avatar Stefan Andonian Committed by Automerger Merge Worker
Browse files

Apply the clockIconDrawable's time in its constructor. am: e6284008 am: 8cc9b842

parents 94f63dc4 8cc9b842
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
@@ -389,6 +389,10 @@ public class ClockDrawableWrapper extends AdaptiveIconDrawable implements Bitmap

            mFullDrawable = (AdaptiveIconDrawable) mAnimInfo.baseDrawableState.newDrawable();
            mFG = (LayerDrawable) mFullDrawable.getForeground();

            // Time needs to be applied here since drawInternal is NOT guaranteed to be called
            // before this foreground drawable is shown on the screen.
            mAnimInfo.applyTime(mTime, mFG);
            mCanvasScale = 1 - 2 * mBoundsOffset;
        }

@@ -421,18 +425,6 @@ 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;