mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-18 02:08:20 +00:00
Allow setting default accent color from config.xml
Co-authored-by: Daria Hamrah Paytakht <info@dariarnd.ir>
This commit is contained in:
@@ -47,6 +47,9 @@
|
||||
<!-- Which calendar to use on smartspace by default -->
|
||||
<string name="config_default_smart_space_calendar" translatable="false">gregorian</string>
|
||||
|
||||
<!-- which accent color to use by default -->
|
||||
<string name="config_default_accent_color" translatable="false"></string>
|
||||
|
||||
<bool name="config_default_dark_status_bar">false</bool>
|
||||
<bool name="config_default_dock_search_bar">true</bool>
|
||||
<bool name="config_default_show_notification_count">false</bool>
|
||||
|
||||
@@ -114,11 +114,7 @@ class PreferenceManager2(private val context: Context) : PreferenceManager {
|
||||
parse = ColorOption::fromString,
|
||||
save = ColorOption::toString,
|
||||
onSet = { reloadHelper.recreate() },
|
||||
defaultValue = when {
|
||||
Utilities.ATLEAST_S -> ColorOption.SystemAccent
|
||||
Utilities.ATLEAST_O_MR1 -> ColorOption.WallpaperPrimary
|
||||
else -> ColorOption.LawnchairBlue
|
||||
},
|
||||
defaultValue = ColorOption.fromString(context.getString(R.string.config_default_accent_color)),
|
||||
)
|
||||
|
||||
val hiddenApps = preference(
|
||||
|
||||
@@ -80,7 +80,11 @@ sealed class ColorOption {
|
||||
} catch (e: IllegalArgumentException) {
|
||||
// ignore
|
||||
}
|
||||
return SystemAccent
|
||||
return when {
|
||||
Utilities.ATLEAST_S -> SystemAccent
|
||||
Utilities.ATLEAST_O_MR1 -> WallpaperPrimary
|
||||
else -> LawnchairBlue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user