Loading aconfig/systemui.aconfig +17 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,16 @@ flag { bug: "389741821" } flag { name: "smartspace_weather_use_monochrome_font_icons" namespace: "systemui" description: "Update Smartspace to use monochrome font icons for weather" bug: "389957594" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "smartspace_ui_update_resources" namespace: "systemui" Loading Loading @@ -179,3 +189,10 @@ flag { } } flag { name: "extendible_theme_manager" namespace: "launcher" description: "Enables custom theme manager in Launcher and Customization Picker" bug: "381897614" } iconloaderlib/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ android_library { static_libs: [ "androidx.core_core", "com_android_launcher3_flags_lib", "com_android_systemui_shared_flags_lib", ], resource_dirs: [ "res", Loading @@ -40,6 +41,7 @@ android_library { static_libs: [ "androidx.core_core", "com_android_launcher3_flags_lib", "com_android_systemui_shared_flags_lib", ], resource_dirs: [ "res", Loading iconloaderlib/build.gradle.kts +1 −0 Original line number Diff line number Diff line Loading @@ -17,4 +17,5 @@ android { dependencies { implementation("androidx.core:core") api(project(":NexusLauncher:Flags")) api(project(":frameworks:base:packages:SystemUI:SystemUISharedFlags")) } iconloaderlib/src/com/android/launcher3/icons/BitmapInfo.java +38 −13 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import android.graphics.Canvas; import android.graphics.Path; import android.graphics.drawable.Drawable; import androidx.annotation.ColorRes; import androidx.annotation.DrawableRes; import androidx.annotation.IntDef; import androidx.annotation.NonNull; import androidx.annotation.Nullable; Loading Loading @@ -211,7 +213,6 @@ public class BitmapInfo { return getBadgeDrawable(context, isThemed, false, badgeShape); } /** * Creates a Drawable for an icon badge for this BitmapInfo * @param context Context Loading @@ -232,18 +233,12 @@ public class BitmapInfo { } if (skipUserBadge) { return null; } else if ((flags & FLAG_INSTANT) != 0) { return new UserBadgeDrawable(context, R.drawable.ic_instant_app_badge, R.color.badge_tint_instant, isThemed, badgeShape); } else if ((flags & FLAG_WORK) != 0) { return new UserBadgeDrawable(context, R.drawable.ic_work_app_badge, R.color.badge_tint_work, isThemed, badgeShape); } else if ((flags & FLAG_CLONE) != 0) { return new UserBadgeDrawable(context, R.drawable.ic_clone_app_badge, R.color.badge_tint_clone, isThemed, badgeShape); } else if ((flags & FLAG_PRIVATE) != 0) { return new UserBadgeDrawable(context, R.drawable.ic_private_profile_app_badge, R.color.badge_tint_private, isThemed, badgeShape); } else { BadgeDrawableInfo drawableInfo = getBadgeDrawableInfo(); if (drawableInfo != null) { return new UserBadgeDrawable(context, drawableInfo.drawableRes, drawableInfo.colorRes, isThemed, badgeShape); } } return null; } Loading @@ -256,6 +251,26 @@ public class BitmapInfo { return new BitmapInfo(bitmap, color); } /** * Returns information about the badge to apply based on current flags. */ @Nullable public BadgeDrawableInfo getBadgeDrawableInfo() { if ((flags & FLAG_INSTANT) != 0) { return new BadgeDrawableInfo(R.drawable.ic_instant_app_badge, R.color.badge_tint_instant); } else if ((flags & FLAG_WORK) != 0) { return new BadgeDrawableInfo(R.drawable.ic_work_app_badge, R.color.badge_tint_work); } else if ((flags & FLAG_CLONE) != 0) { return new BadgeDrawableInfo(R.drawable.ic_clone_app_badge, R.color.badge_tint_clone); } else if ((flags & FLAG_PRIVATE) != 0) { return new BadgeDrawableInfo(R.drawable.ic_private_profile_app_badge, R.color.badge_tint_private); } else { return null; } } /** * Interface to be implemented by drawables to provide a custom BitmapInfo */ Loading @@ -272,4 +287,14 @@ public class BitmapInfo { */ void drawForPersistence(Canvas canvas); } /** * Drawables backing a specific badge shown on app icons. * @param drawableRes Drawable resource for the badge. * @param colorRes Color resource to tint the badge. */ public record BadgeDrawableInfo( @DrawableRes int drawableRes, @ColorRes int colorRes ) {} } iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.kt +4 −3 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import com.android.launcher3.icons.cache.CacheLookupFlag.Companion.DEFAULT_LOOKU import com.android.launcher3.util.ComponentKey import com.android.launcher3.util.FlagOp import com.android.launcher3.util.SQLiteCacheHelper import com.android.systemui.shared.Flags.extendibleThemeManager import java.util.function.Supplier import kotlin.collections.MutableMap.MutableEntry Loading Loading @@ -549,7 +550,7 @@ constructor( return false } if (!Flags.extendibleThemeManager() || lookupFlags.hasThemeIcon()) { if (!extendibleThemeManager() || lookupFlags.hasThemeIcon()) { // Always set a non-null theme bitmap if theming was requested entry.bitmap.themedBitmap = ThemedBitmap.NOT_SUPPORTED Loading Loading @@ -695,14 +696,14 @@ constructor( fun CacheLookupFlag.toLookupColumns() = when { useLowRes() -> COLUMNS_LOW_RES Flags.extendibleThemeManager() && !hasThemeIcon() -> COLUMNS_HIGH_RES_NO_THEME extendibleThemeManager() && !hasThemeIcon() -> COLUMNS_HIGH_RES_NO_THEME else -> COLUMNS_HIGH_RES } @JvmStatic protected fun BitmapInfo.downSampleToLookupFlag(flag: CacheLookupFlag) = when { !Flags.extendibleThemeManager() -> this !extendibleThemeManager() -> this flag.useLowRes() -> BitmapInfo.of(LOW_RES_ICON, color) !flag.hasThemeIcon() && themedBitmap != null -> clone().apply { themedBitmap = null } Loading Loading
aconfig/systemui.aconfig +17 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,16 @@ flag { bug: "389741821" } flag { name: "smartspace_weather_use_monochrome_font_icons" namespace: "systemui" description: "Update Smartspace to use monochrome font icons for weather" bug: "389957594" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "smartspace_ui_update_resources" namespace: "systemui" Loading Loading @@ -179,3 +189,10 @@ flag { } } flag { name: "extendible_theme_manager" namespace: "launcher" description: "Enables custom theme manager in Launcher and Customization Picker" bug: "381897614" }
iconloaderlib/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ android_library { static_libs: [ "androidx.core_core", "com_android_launcher3_flags_lib", "com_android_systemui_shared_flags_lib", ], resource_dirs: [ "res", Loading @@ -40,6 +41,7 @@ android_library { static_libs: [ "androidx.core_core", "com_android_launcher3_flags_lib", "com_android_systemui_shared_flags_lib", ], resource_dirs: [ "res", Loading
iconloaderlib/build.gradle.kts +1 −0 Original line number Diff line number Diff line Loading @@ -17,4 +17,5 @@ android { dependencies { implementation("androidx.core:core") api(project(":NexusLauncher:Flags")) api(project(":frameworks:base:packages:SystemUI:SystemUISharedFlags")) }
iconloaderlib/src/com/android/launcher3/icons/BitmapInfo.java +38 −13 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import android.graphics.Canvas; import android.graphics.Path; import android.graphics.drawable.Drawable; import androidx.annotation.ColorRes; import androidx.annotation.DrawableRes; import androidx.annotation.IntDef; import androidx.annotation.NonNull; import androidx.annotation.Nullable; Loading Loading @@ -211,7 +213,6 @@ public class BitmapInfo { return getBadgeDrawable(context, isThemed, false, badgeShape); } /** * Creates a Drawable for an icon badge for this BitmapInfo * @param context Context Loading @@ -232,18 +233,12 @@ public class BitmapInfo { } if (skipUserBadge) { return null; } else if ((flags & FLAG_INSTANT) != 0) { return new UserBadgeDrawable(context, R.drawable.ic_instant_app_badge, R.color.badge_tint_instant, isThemed, badgeShape); } else if ((flags & FLAG_WORK) != 0) { return new UserBadgeDrawable(context, R.drawable.ic_work_app_badge, R.color.badge_tint_work, isThemed, badgeShape); } else if ((flags & FLAG_CLONE) != 0) { return new UserBadgeDrawable(context, R.drawable.ic_clone_app_badge, R.color.badge_tint_clone, isThemed, badgeShape); } else if ((flags & FLAG_PRIVATE) != 0) { return new UserBadgeDrawable(context, R.drawable.ic_private_profile_app_badge, R.color.badge_tint_private, isThemed, badgeShape); } else { BadgeDrawableInfo drawableInfo = getBadgeDrawableInfo(); if (drawableInfo != null) { return new UserBadgeDrawable(context, drawableInfo.drawableRes, drawableInfo.colorRes, isThemed, badgeShape); } } return null; } Loading @@ -256,6 +251,26 @@ public class BitmapInfo { return new BitmapInfo(bitmap, color); } /** * Returns information about the badge to apply based on current flags. */ @Nullable public BadgeDrawableInfo getBadgeDrawableInfo() { if ((flags & FLAG_INSTANT) != 0) { return new BadgeDrawableInfo(R.drawable.ic_instant_app_badge, R.color.badge_tint_instant); } else if ((flags & FLAG_WORK) != 0) { return new BadgeDrawableInfo(R.drawable.ic_work_app_badge, R.color.badge_tint_work); } else if ((flags & FLAG_CLONE) != 0) { return new BadgeDrawableInfo(R.drawable.ic_clone_app_badge, R.color.badge_tint_clone); } else if ((flags & FLAG_PRIVATE) != 0) { return new BadgeDrawableInfo(R.drawable.ic_private_profile_app_badge, R.color.badge_tint_private); } else { return null; } } /** * Interface to be implemented by drawables to provide a custom BitmapInfo */ Loading @@ -272,4 +287,14 @@ public class BitmapInfo { */ void drawForPersistence(Canvas canvas); } /** * Drawables backing a specific badge shown on app icons. * @param drawableRes Drawable resource for the badge. * @param colorRes Color resource to tint the badge. */ public record BadgeDrawableInfo( @DrawableRes int drawableRes, @ColorRes int colorRes ) {} }
iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.kt +4 −3 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import com.android.launcher3.icons.cache.CacheLookupFlag.Companion.DEFAULT_LOOKU import com.android.launcher3.util.ComponentKey import com.android.launcher3.util.FlagOp import com.android.launcher3.util.SQLiteCacheHelper import com.android.systemui.shared.Flags.extendibleThemeManager import java.util.function.Supplier import kotlin.collections.MutableMap.MutableEntry Loading Loading @@ -549,7 +550,7 @@ constructor( return false } if (!Flags.extendibleThemeManager() || lookupFlags.hasThemeIcon()) { if (!extendibleThemeManager() || lookupFlags.hasThemeIcon()) { // Always set a non-null theme bitmap if theming was requested entry.bitmap.themedBitmap = ThemedBitmap.NOT_SUPPORTED Loading Loading @@ -695,14 +696,14 @@ constructor( fun CacheLookupFlag.toLookupColumns() = when { useLowRes() -> COLUMNS_LOW_RES Flags.extendibleThemeManager() && !hasThemeIcon() -> COLUMNS_HIGH_RES_NO_THEME extendibleThemeManager() && !hasThemeIcon() -> COLUMNS_HIGH_RES_NO_THEME else -> COLUMNS_HIGH_RES } @JvmStatic protected fun BitmapInfo.downSampleToLookupFlag(flag: CacheLookupFlag) = when { !Flags.extendibleThemeManager() -> this !extendibleThemeManager() -> this flag.useLowRes() -> BitmapInfo.of(LOW_RES_ICON, color) !flag.hasThemeIcon() && themedBitmap != null -> clone().apply { themedBitmap = null } Loading