Using a placeholder icon shape instead of low-res/blurry icon

Bug: 111142970
Change-Id: I867224464ae9c026f4dcb5256ef14fc39c8e751d
This commit is contained in:
Sunny Goyal
2018-08-20 15:01:03 -07:00
parent 018e3c4447
commit 2b787e5bd6
18 changed files with 179 additions and 134 deletions

View File

@@ -256,7 +256,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
}
private void applyIconAndLabel(ItemInfoWithIcon info) {
FastBitmapDrawable iconDrawable = DrawableFactory.get(getContext()).newIcon(info);
FastBitmapDrawable iconDrawable = DrawableFactory.INSTANCE.get(getContext())
.newIcon(getContext(), info);
mBadgeColor = IconPalette.getMutedColor(info.iconColor, 0.54f);
setIcon(iconDrawable);
@@ -527,8 +528,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
preloadDrawable = (PreloadIconDrawable) mIcon;
preloadDrawable.setLevel(progressLevel);
} else {
preloadDrawable = DrawableFactory.get(getContext())
.newPendingIcon(info, getContext());
preloadDrawable = DrawableFactory.INSTANCE.get(getContext())
.newPendingIcon(getContext(), info);
preloadDrawable.setLevel(progressLevel);
setIcon(preloadDrawable);
}
@@ -639,7 +640,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
}
if (getTag() instanceof ItemInfoWithIcon) {
ItemInfoWithIcon info = (ItemInfoWithIcon) getTag();
if (info.usingLowResIcon) {
if (info.usingLowResIcon()) {
mIconLoadRequest = LauncherAppState.getInstance(getContext()).getIconCache()
.updateIconInBackground(BubbleTextView.this, info);
}