Always tint backgrounds
This commit is contained in:
1 parent
8861289db6
commit
72b0a35cdb
5 files changed
+2
-10
No files matched your search
@@ -158,7 +158,6 @@
|
||||
<string name="app_title_label">Title</string>
|
||||
<string name="hide_from_drawer">Hide from App Drawer</string>
|
||||
<string name="action_lens">Lens</string>
|
||||
<string name="enable_colorful_theme">Tint Backgrounds</string>
|
||||
<string name="force_rounded_widgets">Rounded Corners</string>
|
||||
<string name="suggestion_pref_screen_title">Suggestions</string>
|
||||
<string name="n_percent">%1$d%%</string>
|
||||
|
||||
@@ -91,7 +91,6 @@ class PreferenceManager private constructor(private val context: Context) : Base
|
||||
ColorOption::toString,
|
||||
recreate
|
||||
)
|
||||
val enableColorfulTheme = BoolPref("pref_enableColorfulTheme", true, recreate)
|
||||
val wallpaperScrolling = BoolPref("pref_wallpaperScrolling", true)
|
||||
val showSysUiScrim = BoolPref("pref_showSysUiScrim", true)
|
||||
val showStatusBar = BoolPref("pref_showStatusBar", true, recreate)
|
||||
|
||||
@@ -35,7 +35,6 @@ class ThemeProvider(private val context: Context) {
|
||||
private val prefs = PreferenceManager.getInstance(context)
|
||||
private val wallpaperManager = WallpaperManagerCompat.INSTANCE.get(context)
|
||||
private val accentColor by prefs.accentColor
|
||||
private val enableColorfulTheme by prefs.enableColorfulTheme
|
||||
|
||||
private val targets = MaterialYouTargets(1.0, false, viewingCondition)
|
||||
private val colorSchemeMap = SparseArray<ColorScheme>()
|
||||
@@ -86,7 +85,7 @@ class ThemeProvider(private val context: Context) {
|
||||
getColorScheme(wallpaperPrimary ?: ColorOption.LawnchairBlue.color)
|
||||
}
|
||||
is ColorOption.CustomColor -> getColorScheme(accentColor.color)
|
||||
}.let { if (!enableColorfulTheme) GrayColorScheme(it) else it }
|
||||
}
|
||||
|
||||
private val systemColorScheme get() = when {
|
||||
Utilities.ATLEAST_S -> getColorScheme(0)
|
||||
|
||||
@@ -73,10 +73,6 @@ fun GeneralPreferences() {
|
||||
) {
|
||||
ThemePreference()
|
||||
AccentColorPreference()
|
||||
SwitchPreference(
|
||||
adapter = prefs.enableColorfulTheme.getAdapter(),
|
||||
label = stringResource(id = R.string.enable_colorful_theme)
|
||||
)
|
||||
}
|
||||
val wrapAdaptiveIcons = prefs.wrapAdaptiveIcons.getAdapter()
|
||||
PreferenceGroup(
|
||||
|
||||
@@ -56,8 +56,7 @@ fun getColorScheme(darkTheme: Boolean): ColorScheme {
|
||||
val context = LocalContext.current
|
||||
val prefs = PreferenceManager.getInstance(context)
|
||||
val accentColor = prefs.accentColor.observeAsState().value
|
||||
val enableColorfulTheme = prefs.enableColorfulTheme.observeAsState().value
|
||||
val colorScheme = remember(accentColor, enableColorfulTheme) {
|
||||
val colorScheme = remember(accentColor) {
|
||||
ThemeProvider.INSTANCE.get(context).colorScheme
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user