Skip to content

K2GO-427 feat(contentexchange): content manager (read/select foundation) - #681

Merged
luisguzman-adfa merged 3 commits into
mainfrom
feat/K2GO-427-content-manager-ui
Oct 23, 2026
Merged

luisguzman-adfa merged 3 commits into
mainfrom
feat/K2GO-427-content-manager-ui

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Slice 1 (foundation) of the K2Go content manager: the read/display + selection surface.
Export / import / delete are later slices (the bottom action bar is present but disabled).

  • A layered feature package org.appdevforall.k2go.contentexchange/{domain,data,presentation}:
    domain use cases (list content grouped by app with totals; storage status), a data layer
    that reads cx-core through dash-node's relay (/k2go-api/v1/apps|content|storage), and a
    ViewModel + Fragment.
  • Lists content grouped by app (Kiwix / Kolibri / Calibre), each item with its size, plus
    total used and free disk, with per-item multi-select. Rows recycle through a RecyclerView
    (scales to a large library on weak devices).
  • Free disk comes from the app's own StorageProbe (StatFs): on K2Go the app owns the
    phone-disk truth; only the content totals are taken from the core's /v1/storage. A missing
    /v1/storage degrades gracefully (content still lists).
  • Reached from Settings and the setup Library screen.

Verification: JVM unit tests for the domain/use-case layer; assembleStandardDebug builds
clean (~48s). On-device integration against a live box (needs cx-core deployed) is a follow-up.

UI changes
New user-facing strings (parked in strings_untranslated.xml, pending l10n to all locales):

  • "Content manager" / "Content on this box, grouped by app. Select items to manage them."
  • "Loading content..." / "Could not reach the box. Try again." / "No content on this box yet."
  • "Used by content: %1$s" / "Free on device: %1$s" / "Free space: unavailable"
  • "%1$d items : %2$s" / "No items" / "%1$d selected : %2$s"
  • "Export" / "Share" / "Delete" (disabled) / "Export, share and delete are not available yet."
  • App labels: "Wikipedia & ZIM" (Kiwix), "Courses" (Kolibri), "Books" (Calibre)
  • Settings: "Content manager" / "Manage, export and remove content"
    Light/dark: the screen uses Material 3 semantic color tokens, so both themes are handled by
    construction; an on-device light/dark render check is pending the integration follow-up.

Layered feature package (domain/data/presentation) that lists box content
grouped by app with per-item sizes, total used and free disk, and per-item
multi-select. Reads cx-core through dash-node (/k2go-api/v1/apps|content|storage)
and degrades to no free-disk figure when /v1/storage is absent. The Export/Share/
Delete bottom bar is present but disabled: those actions are later slices.
Reachable from Settings. JVM unit tests cover grouping/totals and storage degrade.
…core

The phone owns the real free-disk truth on K2Go, so the manager reads free space
from the shared storage/StorageProbe (StatFs) and takes only the content totals
(usedByContentBytes) from the core /v1/storage. The box free/total figures stay in
the mapped entity for the box-side IIAB Console.
A large library (hundreds of books, many ZIMs) must not inflate one view per item
at once: it janks and can OOM weak 32-bit devices. The per-app item lists now bind
through a RecyclerView with four view types (header block, group header, item,
empty), so only visible rows are inflated. Selection stays in the ViewModel; the
adapter reads and toggles it through a SelectionController, so a recycled row always
reflects the current selection.
@luisguzman-adfa
luisguzman-adfa merged commit db3c9f6 into main Oct 23, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/K2GO-427-content-manager-ui branch October 23, 2026 04:53
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