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

Commit 94224af8 authored by Pat Manning's avatar Pat Manning Committed by Automerger Merge Worker
Browse files

Set alpha on background paint and foreground layers, include foreground when...

Set alpha on background paint and foreground layers, include foreground when mutating drawable. am: 47ed514b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/libs/systemui/+/18752001



Change-Id: I0e2e8b18209ae200da123098372fe5fa185b3cbc
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0e9139e3 47ed514b
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -387,7 +387,8 @@ public class ClockDrawableWrapper extends AdaptiveIconDrawable implements Bitmap
            mBgPaint.setColorFilter(cs.mBgFilter);
            mThemedFgColor = cs.mThemedFgColor;

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

            // Time needs to be applied here since drawInternal is NOT guaranteed to be called
@@ -396,6 +397,13 @@ public class ClockDrawableWrapper extends AdaptiveIconDrawable implements Bitmap
            mCanvasScale = 1 - 2 * mBoundsOffset;
        }

        @Override
        public void setAlpha(int alpha) {
            super.setAlpha(alpha);
            mBgPaint.setAlpha(alpha);
            mFG.setAlpha(alpha);
        }

        @Override
        protected void onBoundsChange(Rect bounds) {
            super.onBoundsChange(bounds);
@@ -434,8 +442,7 @@ public class ClockDrawableWrapper extends AdaptiveIconDrawable implements Bitmap
        protected void updateFilter() {
            super.updateFilter();
            int alpha = mIsDisabled ? (int) (mDisabledAlpha * FULLY_OPAQUE) : FULLY_OPAQUE;
            mBgPaint.setAlpha(alpha);
            mFG.setAlpha(alpha);
            setAlpha(alpha);
            mBgPaint.setColorFilter(mIsDisabled ? getDisabledColorFilter() : mBgFilter);
            mFG.setColorFilter(mIsDisabled ? getDisabledColorFilter() : null);
        }