Skip to content

K2GO-385 refactor(ui): shared filter chip + boot-surface download buttons (PR3c) - #545

Open
luisguzman-adfa wants to merge 3 commits into
mainfrom
refactor/K2GO-385-filter-chips-boot-buttons
Open

K2GO-385 refactor(ui): shared filter chip + boot-surface download buttons (PR3c)#545
luisguzman-adfa wants to merge 3 commits into
mainfrom
refactor/K2GO-385-filter-chips-boot-buttons

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

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.

  • New shared 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.
  • Migrated ZimLandingFragment (category filters), BooksLandingFragment (Popular / Educational / My books), ZimCategoryFragment and KolibriBrowseFragment sort chips (By size / A-Z / Grouped — <TextView><Chip> in their layouts) and Kolibri category chips.
  • The check needed an explicit checkedIcon (new ic_check_16): a bare new Chip(ctx) takes the theme's default Assist chip style, which carries none, so setCheckedIconVisible alone drew nothing.

First Material Chip use in the app (Theme.K2Go is Theme.Material3.DayNight, so it resolves).

Boot-surface download buttons

The download-progress buttons were the last surface off the one app button system.

  • New 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.
  • activity_library rootfs download (Pause/Resume/Retry + Cancel) → those variants (dropped inline boot colours).
  • FqrController maps-download overlay (Stop/Retry + Cancel) → Widget.K2Go.Button.Outlined via the shared ThemeOverlay — FQR's overlay is a themed day/night surface, so the K2Go style's theme teal (which has a -night variant) 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.

…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.
@luisguzman-adfa luisguzman-adfa changed the title Refactor/k2 go 385 filter chips boot buttons K2GO-385 refactor(ui): shared filter chip + boot-surface download buttons (PR3c) Sep 5, 2026
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