Skip to content

Add more color themes with a small preview in the theme list - #1037

Open
4di-hello wants to merge 1 commit into
LeanBitLab:mainfrom
4di-hello:pr/more-themes
Open

4di-hello wants to merge 1 commit into
LeanBitLab:mainfrom
4di-hello:pr/more-themes

Conversation

@4di-hello

Copy link
Copy Markdown
Contributor

Adds 15 built-in color themes and a compact color preview for each entry in the theme picker:

  • 15 new themes:
    • 2 Material You dynamic variants (Android 12+): Dynamic colors (subtle) (neutral functional keys) and Dynamic colors (vivid) (accent-tinted background and keys), both with distinct normal and pressed functional key colors in night mode and colored auto-correction/typed-word suggestions.
    • 13 curated palettes: Clean Light, Clean Dark, Graphite, Pure Black (dimmed), Warm Night, High Contrast Light, High Contrast Dark, Arctic, Solar Light, Solar Dark, Ocean, Deep Sea, and Pastel, with dedicated suggestion strip colors (autoCorrect, typedWord) and verified WCAG contrast (text ≥ 7.0 on letter keys, ≥ 4.5 on functional keys and suggestions, hints ≥ 3.0, accent ≥ 3.0 against background, keys, and action key icon).
    • English and German theme names (tools:keep in values/strings.xml).
  • Theme picker improvements (ColorThemePickerDialog):
    • Compact 3-chip swatch preview (key, functional key, and accent color on keyboard background) for every theme row, built via Settings.getDayNightContext without loading background images from disk.
    • Stacked delete/edit buttons below user theme rows so long names are not squeezed next to the swatch.
    • Unique LazyColumn keys (add / user:<name> / default:<name>) so existing user themes sharing a new built-in name cannot crash the list, and prevents creating new user themes with built-in names while keeping the standard color editor.

Tested

  • ./gradlew testOfflineDebugUnitTest --tests helium314.keyboard.keyboard.KeyboardThemeTest --tests helium314.keyboard.latin.common.ColorsTest --tests helium314.keyboard.latin.utils.ColorUtilTest — passed (14/14: 5 + 3 + 6)
  • ./gradlew testStandardDebugUnitTest --tests helium314.keyboard.keyboard.KeyboardThemeTest --tests helium314.keyboard.latin.common.ColorsTest --tests helium314.keyboard.latin.utils.ColorUtilTest — passed (14/14: 5 + 3 + 6)
  • Themes and preview have been in daily use in my fork (LeanType+); the v4.4.0 port and review fixes above (stacked user row, adjusted pastel/graphite accents, night-mode dynamic functional key states) have not been visually checked on a physical device yet.

- Adds 15 built-in color themes: 2 Material You dynamic variants (Dynamic colors subtle / vivid, Android 12+) and 13 curated palettes (Clean Light/Dark, Graphite, Pure Black dimmed, Warm Night, High Contrast Light/Dark, Arctic, Solar Light/Dark, Ocean, Deep Sea, Pastel), each with distinct auto-correction and typed-word suggestion colors and WCAG-checked contrast (text >= 7.0 on keys, >= 4.5 on functional keys and suggestions, hints >= 3.0, accent >= 3.0).
- DynamicColors subtle and vivid variants use distinct normal and pressed functional key colors in night mode too, update haveColorsChanged for variant suggestion colors, and preserve isLightAccent for action key icons.
- Adds a compact 3-chip color swatch preview (key, functional key, accent on background) to every theme row in ColorThemePickerDialog, rendered without background-image disk I/O and with Settings.getDayNightContext so day/night previews match the selected mode.
- Uses unique LazyColumn keys so legacy user themes matching a new built-in name cannot crash the picker, prevents creating new user themes with built-in names while keeping the standard color editor, and stacks delete/edit actions below user theme rows so names are not cramped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant