Use unthemed icon for drawer transition

This commit is contained in:
Suphon Thanakornpakapong committed 2022-05-16 22:59:01 +07:00
1 parent f8b4fab0b8
commit cbaf1bfddd
3 files changed
+17 -3

No files matched your search

@@ -365,10 +365,13 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
mBubbleTextHolder = bubbleTextHolder;
}
public boolean shouldUseTheme() {
return mDisplay == DISPLAY_WORKSPACE || mDisplay == DISPLAY_FOLDER || mDisplay == DISPLAY_TASKBAR;
}
@UiThread
protected void applyIconAndLabel(ItemInfoWithIcon info) {
boolean useTheme = mDisplay == DISPLAY_WORKSPACE || mDisplay == DISPLAY_FOLDER
|| mDisplay == DISPLAY_TASKBAR;
boolean useTheme = shouldUseTheme();
FastBitmapDrawable iconDrawable = info.newIcon(getContext(), useTheme);
mDotParams.color = IconPalette.getMutedColor(iconDrawable.getIconColor(), 0.54f);
+9
View File
@@ -702,6 +702,15 @@ public final class Utilities {
return icon;
}
public static Drawable getFullDrawable(Context context, ItemInfo info, int width, int height,
Object[] outObj, boolean useTheme) {
Drawable icon = loadFullDrawableWithoutTheme(context, info, width, height, outObj);
if (useTheme && icon instanceof BitmapInfo.Extender) {
icon = ((BitmapInfo.Extender) icon).getThemedDrawable(context);
}
return icon;
}
public static Drawable loadFullDrawableWithoutTheme(Context context, ItemInfo info,
int width, int height, Object[] outObj) {
ActivityContext activity = ActivityContext.lookupContext(context);
@@ -273,7 +273,9 @@ public class FloatingIconView extends FrameLayout implements
int width = (int) pos.width();
int height = (int) pos.height();
if (supportsAdaptiveIcons) {
drawable = getFullDrawable(l, info, width, height, sTmpObjArray);
boolean useTheme = originalView instanceof BubbleTextView
&& ((BubbleTextView) originalView).shouldUseTheme();
drawable = getFullDrawable(l, info, width, height, sTmpObjArray, useTheme);
if (drawable instanceof AdaptiveIconDrawable) {
badge = getBadge(l, info, sTmpObjArray[0]);
} else {