mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +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
+16
-11
@@ -8,10 +8,7 @@ A theme is a `Palette` (`ui/Theme.kt`): a dark background scale (`background`, `
|
||||
|
||||
## Gradient theme
|
||||
|
||||
`Themes.GRADIENT` is the one theme whose colours the person picks: a primary and a secondary,
|
||||
kept in `SessionPrefs.gradientColors` and in `Themes.gradientColors`, a Compose state, so a change
|
||||
restyles the whole app at once. `App.onCreate` loads the saved colours; code outside a composition
|
||||
uses `Themes.current(context)`.
|
||||
`Themes.GRADIENT` is the one of the theme whose colours the person picks: a primary and a secondary, kept in `SessionPrefs.gradientColors` and in `Themes.gradientColors`, a Compose state, so a change restyles the whole app at once. `App.onCreate` loads the saved colours; code outside a composition uses `Themes.current(context)`.
|
||||
|
||||
`ThemeColors.palette` builds the full palette from the two colours: primary becomes
|
||||
`primary` / `signal`, secondary becomes `primary2`, the background scale is a dark neutral tinted with
|
||||
@@ -24,16 +21,24 @@ square. It opens `ColorPickerDialog`: a wheel (hue and saturation, touch), hue /
|
||||
brightness sliders (they work with a controller) and a hex box, with the old and new colour side by
|
||||
side. OK applies it.
|
||||
|
||||
## Custom theme
|
||||
|
||||
`Themes.CUSTOM` stores a separate preference for every configurable palette colour:
|
||||
background, surfaces, borders, text, accent, button text, signals, success and error.
|
||||
`SessionPrefs.customThemeColors` restores the saved values, while `Themes.customColors`
|
||||
is Compose state so changes update the interface immediately.
|
||||
|
||||
The custom palette does not derive its surfaces from the accent. `primary2` intentionally
|
||||
equals `primary`, keeping components that use the existing two-stop button and launch
|
||||
effects visually solid. The colour picker reused from Gradient supports the wheel, sliders
|
||||
and hexadecimal input.
|
||||
|
||||
## Inner Gamer theme
|
||||
|
||||
`Themes.INNER_GAMER` is an RGB theme: the accent walks round the colour wheel. It sits just above
|
||||
Gradient in the list, and Setup shows a Speed slider (1 to 10, `SessionPrefs.rgbSpeed`) under the
|
||||
theme while it is chosen.
|
||||
Gradient in the list, and Setup shows a Speed slider (1 to 10, `SessionPrefs.rgbSpeed`) under the theme while it is chosen.
|
||||
|
||||
`Themes.innerGamer(hue)` builds the palette for one hue through `ThemeColors.palette`, so button text
|
||||
keeps the same contrast along the gradient at every hue. `DroidDeckTheme` runs one
|
||||
`rememberInfiniteTransition` while Inner Gamer is chosen, so the system's animation clock drives it.
|
||||
Compose applies Android's animator scale to it, and the colour holds still when animations are off
|
||||
in the app (`Motion.scale`) or in Android's own settings. The hue is written to `Themes.rgbHue` in 3° steps, which restyles the
|
||||
`Themes.innerGamer(hue)` builds the palette for one hue through `ThemeColors.palette`, so button text keeps the same contrast along the gradient at every hue. `DroidDeckTheme` runs one `rememberInfiniteTransition` while Inner Gamer is chosen, so the system's animation clock drives it.
|
||||
Compose applies Android's animator scale to it, and the colour holds still when animations are off in the app (`Motion.scale`) or in Android's own settings. The hue is written to `Themes.rgbHue` in 3° steps, which restyles the
|
||||
app only when the colour visibly moves; a slow cycle costs few recompositions.
|
||||
|
||||
Reference in new issue
Block a user