Adding ThemeManager as a centralized place for controlling icon theming
Bug: 381897614 Flag: EXEMPT refactor Test: atest ThemeManagerTest Change-Id: Ib1dafdcc303f05f78cf586741c3d35243ab06e69
This commit is contained in:
1 parent
239745aae9
commit
c369d1e4af
19 files changed
+325
-145
No files matched your search
@@ -19,8 +19,6 @@ package com.android.launcher3.util;
|
||||
import static android.app.WallpaperColors.HINT_SUPPORTS_DARK_TEXT;
|
||||
import static android.app.WallpaperColors.HINT_SUPPORTS_DARK_THEME;
|
||||
|
||||
import static com.android.launcher3.LauncherPrefs.THEMED_ICONS;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
@@ -32,7 +30,6 @@ import android.util.TypedValue;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
|
||||
import com.android.launcher3.LauncherPrefs;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.icons.GraphicsUtils;
|
||||
@@ -44,8 +41,6 @@ import com.android.launcher3.views.ActivityContext;
|
||||
@SuppressWarnings("NewApi")
|
||||
public class Themes {
|
||||
|
||||
public static final String KEY_THEMED_ICONS = "themed_icons";
|
||||
|
||||
/** Gets the WallpaperColorHints and then uses those to get the correct activity theme res. */
|
||||
public static int getActivityThemeRes(Context context) {
|
||||
return getActivityThemeRes(context, WallpaperColorHints.get(context).getHints());
|
||||
@@ -64,13 +59,6 @@ public class Themes {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if workspace icon theming is enabled
|
||||
*/
|
||||
public static boolean isThemedIconEnabled(Context context) {
|
||||
return LauncherPrefs.get(context).get(THEMED_ICONS);
|
||||
}
|
||||
|
||||
public static String getDefaultBodyFont(Context context) {
|
||||
TypedArray ta = context.obtainStyledAttributes(android.R.style.TextAppearance_DeviceDefault,
|
||||
new int[]{android.R.attr.fontFamily});
|
||||
|
||||
Reference in new issue
Block a user