Repository navigation
K2GO-427 feat(contentexchange): content manager (read/select foundation) - #681
Merged
Merged
Conversation
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.
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.
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).
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.
total used and free disk, with per-item multi-select. Rows recycle through a RecyclerView
(scales to a large library on weak devices).
phone-disk truth; only the content totals are taken from the core's /v1/storage. A missing
/v1/storage degrades gracefully (content still lists).
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):
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.