mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
fixed 3p themed icons not applying
- closes : #4799 - closes : #4752 - closes : #4267 - closes : #4248 - closes : #4179 - closes : #4157 - closes : #3960 - closes : #3943 - closes : #3408 - closes : #2882
This commit is contained in:
Submodule platform_frameworks_libs_systemui updated: ba5c27f104...cc37c52766
@@ -764,6 +764,10 @@ public final class Utilities {
|
||||
badge = icon.getBadge();
|
||||
}
|
||||
|
||||
if (useTheme && mainIcon instanceof BitmapInfo.Extender) {
|
||||
mainIcon = ((BitmapInfo.Extender) mainIcon).getThemedDrawable(context);
|
||||
}
|
||||
|
||||
if (mainIcon == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -44,14 +44,14 @@ public interface ComponentWithLabelAndIcon extends ComponentWithLabel {
|
||||
@NonNull
|
||||
@Override
|
||||
public BitmapInfo loadIcon(@NonNull Context context,
|
||||
@NonNull ComponentWithLabelAndIcon object) {
|
||||
@NonNull ComponentWithLabelAndIcon object) {
|
||||
Drawable d = object.getFullResIcon(LauncherAppState.getInstance(context)
|
||||
.getIconCache());
|
||||
.getIconCache());
|
||||
if (d == null) {
|
||||
return super.loadIcon(context, object);
|
||||
}
|
||||
try (LauncherIcons li = LauncherIcons.obtain(context)) {
|
||||
return li.createBadgedIconBitmap(d);
|
||||
return li.createBadgedIconBitmap(d, new BaseIconFactory.IconOptions().setUser(object.getUser()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,8 @@ public class LauncherActivityCachingLogic
|
||||
public BitmapInfo loadIcon(@NonNull Context context, @NonNull LauncherActivityInfo object) {
|
||||
try (LauncherIcons li = LauncherIcons.obtain(context)) {
|
||||
return li.createBadgedIconBitmap(LauncherAppState.getInstance(context)
|
||||
.getIconProvider().getIcon(object, li.mFillResIconDpi));
|
||||
.getIconProvider().getIcon(object, li.mFillResIconDpi),
|
||||
new BaseIconFactory.IconOptions().setUser(object.getUser()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class WidgetItem extends ComponentKey {
|
||||
super(info.provider, info.getProfile());
|
||||
|
||||
label = iconCache.getTitleNoCache(info);
|
||||
description = ATLEAST_S ? info.loadDescription(context) : null;
|
||||
description = ATLEAST_S && info.loadDescription(context) != null ? info.loadDescription(context) : "";
|
||||
widgetInfo = info;
|
||||
activityInfo = null;
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import android.os.Process;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.Flags;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.icons.BitmapInfo;
|
||||
import com.android.launcher3.icons.FastBitmapDrawable;
|
||||
import com.android.launcher3.logging.FileLog;
|
||||
@@ -328,7 +327,7 @@ public abstract class ItemInfoWithIcon extends ItemInfo {
|
||||
* Returns a FastBitmapDrawable with the icon and context theme applied
|
||||
*/
|
||||
public FastBitmapDrawable newIcon(Context context, @BitmapInfo.DrawableCreationFlags int creationFlags) {
|
||||
FastBitmapDrawable drawable = bitmap.newIcon(context, creationFlags);
|
||||
FastBitmapDrawable drawable = (creationFlags & BitmapInfo.FLAG_THEMED) != 0 ? bitmap.newThemedIcon(context) : bitmap.newIcon(context, creationFlags);
|
||||
drawable.setIsDisabled(isDisabled());
|
||||
return drawable;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user