mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 06:15:58 +00:00
Feat: Adds customizable theme and fix inner gamer theme (#2850)
This commit is contained in:
1 parent
8f34554516
commit
71989b4cdb
38 files changed
+663
-13
No files matched your search
@@ -1534,6 +1534,45 @@ object SessionPrefs {
|
||||
prefs(context).edit().putInt("gradientPrimary", primary).putInt("gradientSecondary", secondary).apply()
|
||||
}
|
||||
|
||||
fun customThemeColors(context: Context): com.droiddeck.launcher.ui.CustomThemeColors =
|
||||
prefs(context).let { p ->
|
||||
val defaults = com.droiddeck.launcher.ui.CustomThemeColors()
|
||||
com.droiddeck.launcher.ui.CustomThemeColors(
|
||||
background = p.getInt("customThemeBackground", defaults.background),
|
||||
surface = p.getInt("customThemeSurface", defaults.surface),
|
||||
surfaceVariant = p.getInt("customThemeSurfaceVariant", defaults.surfaceVariant),
|
||||
line = p.getInt("customThemeLine", defaults.line),
|
||||
line2 = p.getInt("customThemeLine2", defaults.line2),
|
||||
onBackground = p.getInt("customThemeOnBackground", defaults.onBackground),
|
||||
onSurfaceVariant = p.getInt("customThemeOnSurfaceVariant", defaults.onSurfaceVariant),
|
||||
primary = p.getInt("customThemePrimary", defaults.primary),
|
||||
onPrimary = p.getInt("customThemeOnPrimary", defaults.onPrimary),
|
||||
signal = p.getInt("customThemeSignal", defaults.signal),
|
||||
good = p.getInt("customThemeGood", defaults.good),
|
||||
error = p.getInt("customThemeError", defaults.error),
|
||||
)
|
||||
}
|
||||
|
||||
fun setCustomThemeColors(
|
||||
context: Context,
|
||||
colors: com.droiddeck.launcher.ui.CustomThemeColors,
|
||||
) {
|
||||
prefs(context).edit()
|
||||
.putInt("customThemeBackground", colors.background)
|
||||
.putInt("customThemeSurface", colors.surface)
|
||||
.putInt("customThemeSurfaceVariant", colors.surfaceVariant)
|
||||
.putInt("customThemeLine", colors.line)
|
||||
.putInt("customThemeLine2", colors.line2)
|
||||
.putInt("customThemeOnBackground", colors.onBackground)
|
||||
.putInt("customThemeOnSurfaceVariant", colors.onSurfaceVariant)
|
||||
.putInt("customThemePrimary", colors.primary)
|
||||
.putInt("customThemeOnPrimary", colors.onPrimary)
|
||||
.putInt("customThemeSignal", colors.signal)
|
||||
.putInt("customThemeGood", colors.good)
|
||||
.putInt("customThemeError", colors.error)
|
||||
.apply()
|
||||
}
|
||||
|
||||
fun trueBlackHighlight(context: Context): Int =
|
||||
prefs(context).getInt("trueBlackHighlight", com.droiddeck.launcher.ui.Themes.DEFAULT_HIGHLIGHT)
|
||||
|
||||
|
||||
Reference in new issue
Block a user