Skip to content

feat(ui): Settings — "Use wallpaper colors" switch row #89

@ilmoniemi

Description

@ilmoniemi

User Story

As a Pyrycode mobile user on Android 12+, I want a "Use wallpaper colors" switch in Settings → Appearance, so I can opt into Material You and have the app pick colors from my system wallpaper.

Context

The Settings screen scaffolded in #64 shows an Appearance section. The Theme row (System / Light / Dark) and the picker dialog land in #86 and #87. This ticket adds a second row in the same section: a Material 3 switch labelled "Use wallpaper colors" that flips the use_wallpaper_colors preference established by the sibling plumbing ticket.

Per the project's Stack Decision → Color theming, this is Android 12+ only. On Android < 12, the switch is rendered disabled (greyed) with helper text "Requires Android 12 or newer" — discoverable but inert. Default is OFF, so the brand palette renders unless the user opts in.

Acceptance Criteria

  • Settings → Appearance section gains a "Use wallpaper colors" row beneath the Theme row, containing a label, optional subtitle / helper text, and a trailing M3 Switch.
  • On Android 12+ (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S): the switch is enabled; its checked state mirrors AppPreferences.useWallpaperColors; toggling it persists via AppPreferences.setUseWallpaperColors(...) and the app's ColorScheme updates immediately without a process restart (the plumbing ticket already wires the flow into the composition root).
  • On Android < 12: the switch is rendered in the disabled state, the row shows helper text "Requires Android 12 or newer", and tapping is a no-op (the underlying preference value is irrelevant on this SDK level).
  • SettingsViewModel (introduced by feat(ui): Settings theme picker dialog (System / Light / Dark) #87) gains a useWallpaperColors: StateFlow<Boolean> exposing the persisted value, and an event entry point for toggling. The Settings composable remains a thin state + event consumer per the project's MVI convention.
  • SettingsViewModelTest covers: initial state mirrors AppPreferences.useWallpaperColors; toggling persists via the fake; the exposed flow re-emits after persistence.

Technical Notes

Depends On

Figma

https://www.figma.com/design/g2HIq2UyPhslEoHRokQmHG?node-id=17-2

The switch row lives in the Settings screen (node 17-2, established by #64) directly beneath the Theme row from #87. The switch itself has no Figma sub-node — implement with M3 Switch defaults. The disabled-with-helper-text variant for Android < 12 also has no Figma node; M3 disabled-row defaults plus the helper-text string in the AC are the spec. If the visual diverges meaningfully from M3 defaults later, a Figma-side ticket can capture it; for this slice, M3 defaults are the spec.

Size Estimate

S — switch row composable in SettingsScreen.kt (~30 LOC), SettingsViewModel.kt extension (~15 LOC), SettingsViewModelTest.kt additions (~25 LOC). ~45 LOC production.

Split from #75.

Metadata

Metadata

Assignees

No one assigned

    Labels

    size:s<100 lines; default for non-trivial tickets

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions