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

Commit 799e1207 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Updating Drawables as per GraphicsUtils changes

Bug: 266661614
Test: Presubmit
Change-Id: Ia3d0e0bc7a2b019d234e3bca71e893d5c4c54ca8
parent 25606600
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView {
        int shadowSize = context.getResources().getDimensionPixelSize(
                R.dimen.blur_size_thin_outline);
        mShadowFilter = new BlurMaskFilter(shadowSize, BlurMaskFilter.Blur.OUTER);
        mShapePath = GraphicsUtils.getShapePath(mNormalizedIconSize);
        mShapePath = GraphicsUtils.getShapePath(context, mNormalizedIconSize);
    }

    @Override
+5 −4
Original line number Diff line number Diff line
@@ -577,15 +577,16 @@ public class DeviceProfile {
        dimensionOverrideProvider.accept(this);

        // This is done last, after iconSizePx is calculated above.
        mDotRendererWorkSpace = createDotRenderer(iconSizePx, dotRendererCache);
        mDotRendererAllApps = createDotRenderer(allAppsIconSizePx, dotRendererCache);
        mDotRendererWorkSpace = createDotRenderer(context, iconSizePx, dotRendererCache);
        mDotRendererAllApps = createDotRenderer(context, allAppsIconSizePx, dotRendererCache);
    }

    private static DotRenderer createDotRenderer(
            int size, @NonNull SparseArray<DotRenderer> cache) {
            @NonNull Context context, int size, @NonNull SparseArray<DotRenderer> cache) {
        DotRenderer renderer = cache.get(size);
        if (renderer == null) {
            renderer = new DotRenderer(size, getShapePath(DEFAULT_DOT_SIZE), DEFAULT_DOT_SIZE);
            renderer = new DotRenderer(size, getShapePath(context, DEFAULT_DOT_SIZE),
                    DEFAULT_DOT_SIZE);
            cache.put(size, renderer);
        }
        return renderer;
+13 −6
Original line number Diff line number Diff line
@@ -138,7 +138,8 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
                IconPalette.getPreloadProgressColor(context, info.bitmap.color),
                getPreloadColors(context),
                Utilities.isDarkTheme(context),
                getRefreshRateMillis(context));
                getRefreshRateMillis(context),
                GraphicsUtils.getShapePath(context, DEFAULT_PATH_SIZE));
    }

    public PreloadIconDrawable(
@@ -146,10 +147,11 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
            int indicatorColor,
            int[] preloadColors,
            boolean isDarkMode,
            int refreshRateMillis) {
            int refreshRateMillis,
            Path shapePath) {
        super(info.bitmap);
        mItem = info;
        mShapePath = GraphicsUtils.getShapePath(DEFAULT_PATH_SIZE);
        mShapePath = shapePath;
        mScaledTrackPath = new Path();
        mScaledProgressPath = new Path();

@@ -386,7 +388,8 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
                mIndicatorColor,
                new int[] {mSystemAccentColor, mSystemBackgroundColor},
                mIsDarkMode,
                mRefreshRateMillis);
                mRefreshRateMillis,
                mShapePath);
    }

    @Override
@@ -442,6 +445,7 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
        protected final boolean mIsDarkMode;
        protected final int mLevel;
        protected final int mRefreshRateMillis;
        private final Path mShapePath;

        public PreloadIconConstantState(
                Bitmap bitmap,
@@ -450,7 +454,8 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
                int indicatorColor,
                int[] preloadColors,
                boolean isDarkMode,
                int refreshRateMillis) {
                int refreshRateMillis,
                Path shapePath) {
            super(bitmap, iconColor);
            mInfo = info;
            mIndicatorColor = indicatorColor;
@@ -458,6 +463,7 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
            mIsDarkMode = isDarkMode;
            mLevel = info.getProgressLevel();
            mRefreshRateMillis = refreshRateMillis;
            mShapePath = shapePath;
        }

        @Override
@@ -467,7 +473,8 @@ public class PreloadIconDrawable extends FastBitmapDrawable {
                    mIndicatorColor,
                    mPreloadColors,
                    mIsDarkMode,
                    mRefreshRateMillis);
                    mRefreshRateMillis,
                    mShapePath);
        }
    }
}