Files
DroidDeck/docs/development/themes.md
T
FX192 f7acb7fcd7 Inner Gamer RGB theme with a speed slider; keep the colour picker's hex box in view above the keyboard
The hex box sat at the bottom of the picker, so with the keyboard up the dialog
was cut off and the field could not be seen. While the box has focus the dialog
now scrolls to its end, and again whenever the visible height changes, so the
hex box and OK / Cancel stay above the keyboard.

Inner Gamer is a new theme just above Gradient. Its accent walks round the
colour wheel on a Compose infinite transition, so Android's animation clock
drives it and it holds still when animations are off. The hue moves in 3 degree
steps so the app restyles only when the colour visibly changes. Setup shows a
Speed slider (1 to 10) while it is selected. The palette comes from
ThemeColors.palette, so button text stays readable at every hue.
2026-10-23 11:20:34 -04:00

2.3 KiB
Raw Blame History

Themes

A theme is a Palette (ui/Theme.kt): a dark background scale (background, surface, surfaceVariant, line, line2), two text colours, and the accent: primary / signal (flat accent, also Material's primary), primary2 (the darker or second accent) and onPrimary. PrimaryButton and the launch flood already draw a gradient from primary to primary2. The choice is stored as an id (SessionPrefs.theme) and picked in Setup › Launcher.

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).

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 the primary's hue (plain grey for a grey primary), and onPrimary is dark or white by the luminance of the pair. A colour too dark to show on the dark background is lifted (ThemeColors.readable) rather than refused.

Setup shows Primary and Secondary under the theme when Gradient is chosen, each a small colour square. It opens ColorPickerDialog: a wheel (hue and saturation, touch), hue / saturation / brightness sliders (they work with a controller) and a hex box, with the old and new colour side by side. OK applies it.

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.

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. The duration goes through Motion.ms, so the colour holds still when animations are off in the app 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.