K2GO-385 refactor(ui): remaining confirm dialogs and single-choice picker roles - #549
Merged
Merged
Conversation
… 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.
…actor/K2GO-385-remaining-dialogs
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).