Skip to content

K2GO-385 refactor(ui): remaining confirm dialogs and single-choice picker roles - #549

Merged
luisguzman-adfa merged 7 commits into
mainfrom
refactor/K2GO-385-remaining-dialogs
Sep 5, 2026
Merged

K2GO-385 refactor(ui): remaining confirm dialogs and single-choice picker roles#549
luisguzman-adfa merged 7 commits into
mainfrom
refactor/K2GO-385-remaining-dialogs

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Three UI-standardization changes on the settings / dialog surfaces, under the pill-roles decision.

Confirm dialogs. Four confirmations that the #540 sweep missed -- they used the fully-qualified MaterialAlertDialogBuilder or AlertDialog.Builder, so the short-name grep skipped them -- now use the shared BrandDialog (destructive): "Reinstall from scratch?" (BackupRestoreFragment), "Cancel the download?" (LibraryActivity), "Cancel the module install?" (SetupProgressActivity), "Turn off K2Go?" (SettingsFragment). After this, no raw confirm dialog remains outside FqrController.

Theme picker (Q3). A list picker is a themed single-choice dialog, not a bare list. chooseTheme moves from AlertDialog.Builder.setItems to MaterialAlertDialogBuilder.setSingleChoiceItems wrapped in Theme_K2Go, pre-checking the active theme (Light / System / Dark) with a leading radio. Tap still applies and closes -- behavior is unchanged.

Books language selector (Q3B). The selector sits next to the filter chips but opens the language picker rather than toggling a filter, so it now reads as a dropdown: a trailing teal caret and the current value ("English"), no check or selected-fill. The tap still opens the same ZimLanguageDialog.

Verification. Visual; pending an on-device pass (theme picker shows the current selection; the Books selector reads as a menu, not a chip; the four confirms render as clay-destructive BrandDialog cards).

… missed to BrandDialog

#540 swept the raw MaterialAlertDialogBuilder confirms, but matched only the short
form -- these four used the FULLY-QUALIFIED name or android/androidx AlertDialog.Builder,
so the grep passed over them and they still rendered as plain platform dialogs (buttons
in a row, no card). They are all simple destructive confirms; route them through the
shared BrandDialog like the rest.

- BackupRestoreFragment "Reinstall from scratch?" (fully-qualified MADB) -> BrandDialog
  destructive ("Erase and reinstall").
- LibraryActivity "Cancel the download?" (fully-qualified MADB) -> destructive.
- SetupProgressActivity "Cancel the module install?" (fully-qualified MADB) -> destructive.
- SettingsFragment "Turn off K2Go?" (AlertDialog.Builder) -> destructive, matching the
  clay "Turn off" button that opens it.

Left as-is on purpose: the theme picker (SettingsFragment) and the language pickers are
setItems LIST dialogs, which BrandDialog does not model; LibraryActivity's "damaged"
dialog is a special three-button, non-cancelable dialog with a neutral that must not
dismiss (it captures a screenshot of itself); FqrController's dialogs are its own themed
subsystem. After this, no MaterialAlertDialogBuilder confirm remains outside FqrController.
…alog

Pill-roles Q3: a list picker is a themed M3 single-choice dialog with a leading filled radio
on the current row, not a bare list. chooseTheme moves from AlertDialog.Builder.setItems to
MaterialAlertDialogBuilder.setSingleChoiceItems wrapped in Theme_K2Go, pre-checking the active
theme (Light / System / Dark). Tap still applies and closes, so behavior is unchanged; the
dialog now shows which theme is active. Drops the now-unused AlertDialog import.
…ot a chip

Pill-roles Q3B: the language selector sits next to the filter chips but is a different control
-- it opens the single-choice language picker rather than toggling a filter. It now carries a
trailing caret (ic_expand_more, teal) so it reads as a menu button that shows the current value
("English"), distinct from the chips (which toggle and show a check). No behavior change; the
tap still opens the shared ZimLanguageDialog. The optional leading globe glyph is deferred until
there is a size-matched icon -- the caret is the essential "this opens a menu" cue.
…opdown

Completes Q3B: the language selector now carries a leading globe (new ic_language) as well as
the trailing caret, so it reads unmistakably as a language picker. Both glyphs take the teal
drawableTint already on the view.
@luisguzman-adfa luisguzman-adfa changed the title Refactor/k2 go 385 remaining dialogs K2GO-385 refactor(ui): remaining confirm dialogs and single-choice picker roles Sep 5, 2026
…rol, not the M3 lilac default

The theme picker (a MaterialAlertDialog wrapped in Theme_K2Go) rendered with the Material3 baseline
lilac card and a purple radio: Theme.K2Go set colorSurface / colorSurfaceContainer but left the rest
of the surface-container ladder and the control-activated colour undefined, so an M3 dialog fell back
to the baseline defaults. Define the full ladder -- colorSurfaceContainerLowest / Low -> k2go_paper,
High / Highest -> k2go_surface (an M3 dialog reads colorSurfaceContainerHigh for its card) -- and set
colorControlActivated + android:colorControlActivated to k2go_teal (the single-choice radio uses the
android-namespace attr). Root fix: every themed M3 dialog, menu and control now takes a K2Go surface
and teal, not lilac / purple. The tokens carry their -night twins, so DayNight is handled.
@luisguzman-adfa
luisguzman-adfa merged commit 7fb3219 into main Sep 5, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the refactor/K2GO-385-remaining-dialogs branch September 5, 2026 23:32
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