K2GO-385 refactor(ui): shared filter chip + boot-surface download buttons (PR3c) - #545
Open
luisguzman-adfa wants to merge 3 commits into
Open
K2GO-385 refactor(ui): shared filter chip + boot-surface download buttons (PR3c)#545luisguzman-adfa wants to merge 3 commits into
luisguzman-adfa wants to merge 3 commits into
Conversation
…rt, Books filters)
PR3 third slice, part 1 -- the filter-chip role from the pill-roles design decision
(board k2go-chip-vs-button-v1). Three screens each hand-rolled their own selectable
chip, which is why the ZIM sort chips ("By size", "A-Z") looked different from the
category chips and from the Books filters. Unify them into one component.
- New shared K2GoFilterChip: a Material 3 Chip styled to the decision's filter-chip
spec -- 8dp corner, 32dp (the 32dp step on the 4dp role ladder), selectable with a
leading check when active, app-teal (filled + on-teal text when selected;
transparent + teal outline + teal text when not). create(...) builds one;
style(chip, selected) applies it to an XML-inflated chip.
- ZimLandingFragment (category filters) and BooksLandingFragment (Popular / Educational
/ My books) build theirs through create(), dropping their 48dp teal-pill / drawable
builders.
- ZimCategoryFragment sort chips (By size / A-Z / Grouped) become Material Chips in the
layout and are styled through style() on every render; the label still carries the
sort direction ("By size ▲").
Shape now signals the type -- 8dp corner + check = a toggle -- distinct from the stadium
action button, the dot+text status and the 8dp metadata tag. First Material Chip use in
the app (the theme is already Material 3, so the widget resolves).
…oot-surface variant + FQR) PR3 third slice, part 2 -- the download-progress buttons were the last surface off the one app button system (three button strategies coexisted). Bring them in, respecting that they sit on two different surfaces. - New boot-surface button variants Widget.K2Go.Button.Outlined.OnBootPaper / Widget.K2Go.Button.Text.OnBootPaper: the app button's stadium shape + type, but colour from the fixed boot tokens (k2go_boot_ink/muted). The rootfs download surface is a fixed light "paper" in both light and dark (ADFA-4814), so a theme-coloured button would be unreadable there. - activity_library rootfs download: Pause/Resume/Retry and Cancel move from bare Widget.Material3.Button.Outlined/Text (+ inline boot colours) to those variants -- same boot colours, now with the app's stadium shape, and the colour recipe lives in the style. - FqrController maps download overlay: its Stop/Retry + Cancel move from a bare Material3 outlined button to Widget.K2Go.Button.Outlined via the shared ThemeOverlay. FQR's overlay is a themed (day/night) surface, so the K2Go outlined style's theme teal is correct there -- not the boot tokens. So both download surfaces now use the app's stadium button; they differ only in colour source (fixed boot tokens vs theme), which is the real difference between the surfaces.
…olibri browse chips Two things found reviewing PR3c on device. 1. The filter chip's check never showed. A bare new Chip(ctx) picks up the theme's default (Assist) chipStyle, which carries no checkedIcon, so setCheckedIconVisible alone drew nothing. Set a plain check (new ic_check_16) explicitly on the chip; it tints on-teal on the selected fill. The check is the design's "toggle" cue, so every filter chip (ZIM / Books / Kolibri) now shows it. 2. KolibriBrowseFragment was a missed filter-chip surface -- its own sort toggles (By size / A-Z) and category chips still used the old k2go_chip_bg/k2go_pill_bg drawable pair, so they looked different from the ZIM/Books chips. Migrate them onto K2GoFilterChip like the others (sort chips: TextView -> <Chip> in the layout, styled via style(); category chip: create()); the sort label still carries its direction.
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.
PR3 third slice of the pill-roles design decision (board k2go-chip-vs-button-v1) — the last two roles that were still hand-rolled per screen.
Filter chip
Four screens each built their own selectable chip, which is why the ZIM sort chips ("By size", "A-Z") looked different from the category chips, the Books filters, and the Kolibri chips. Unify them.
K2GoFilterChip: a Material 3 Chip styled to the decision's filter-chip spec — 8dp corner, 32dp, selectable with a leading check when active, app-teal (filled + on-teal text selected; transparent + teal outline unselected).create(...)builds one;style(chip, selected)applies it to an XML-inflated chip.<TextView>→<Chip>in their layouts) and Kolibri category chips.checkedIcon(newic_check_16): a barenew Chip(ctx)takes the theme's default Assist chip style, which carries none, sosetCheckedIconVisiblealone drew nothing.First Material Chip use in the app (
Theme.K2GoisTheme.Material3.DayNight, so it resolves).Boot-surface download buttons
The download-progress buttons were the last surface off the one app button system.
Widget.K2Go.Button.Outlined.OnBootPaper/.Text.OnBootPaper: the app button's stadium shape + type, but colour from the fixed boot tokens — the rootfs download surface is a fixed light "paper" in both themes (ADFA-4814), where a theme-coloured button is unreadable.Widget.K2Go.Button.Outlinedvia the shared ThemeOverlay — FQR's overlay is a themed day/night surface, so the K2Go style's theme teal (which has a-nightvariant) is right there, not the boot tokens.Verification
Built and installed on device. Filter chips render uniform (8dp/32dp) with a visible check across ZIM landing/category, Books, and Kolibri; the rootfs download and FQR overlay buttons render as the app's stadium buttons.
Out of scope
The remaining filter-chip surfaces (MapsChoose, SettingsSub, the edition/Books-landing-layout chips) and the confirm dialogs the earlier follow-up missed are separate branches. The state→colour status mapping (a shared status owner) stays a follow-up.