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

Commit 0b3053c9 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Extracting icon caching logic into a base class.

This will allow using the cache cache for other type of objects,
like shortcuts and widgets.

Change-Id: I38616d031cb051f93e724d9cc0e8fe9a822b9e3a
parent d65f5f7f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -37,6 +37,10 @@ public class BitmapInfo {
        info.color = color;
    }

    public final boolean isLowRes() {
        return LOW_RES_ICON == icon;
    }

    public static BitmapInfo fromBitmap(Bitmap bitmap) {
        return fromBitmap(bitmap, null);
    }
+2 −2
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ public class DrawableFactory implements ResourceBasedOverride {
     * Returns a FastBitmapDrawable with the icon.
     */
    public FastBitmapDrawable newIcon(Context context, ItemInfoWithIcon info) {
        FastBitmapDrawable drawable = info.iconBitmap == LOW_RES_ICON
        FastBitmapDrawable drawable = info.usingLowResIcon()
                ? new PlaceHolderIconDrawable(info, getPreloadProgressPath(), context)
                : new FastBitmapDrawable(info);
        drawable.setIsDisabled(info.isDisabled());
@@ -74,7 +74,7 @@ public class DrawableFactory implements ResourceBasedOverride {
    }

    public FastBitmapDrawable newIcon(Context context, BitmapInfo info, ActivityInfo target) {
        return info.icon == LOW_RES_ICON
        return info.isLowRes()
                ? new PlaceHolderIconDrawable(info, getPreloadProgressPath(), context)
                : new FastBitmapDrawable(info);
    }
+531 −0

File added.

Preview size limit exceeded, changes collapsed.

+63 −0

File added.

Preview size limit exceeded, changes collapsed.

+7 −517

File changed.

Preview size limit exceeded, changes collapsed.

Loading