Skip to content

ADFA-5074 refactor(ui): the working animation, resolved instead of copied - #379

Merged
luisguzman-adfa merged 2 commits into
mainfrom
refactor/ADFA-5074-one-progress-host
Aug 10, 2026
Merged

luisguzman-adfa merged 2 commits into
mainfrom
refactor/ADFA-5074-one-progress-host

Conversation

@luisguzman-adfa

@luisguzman-adfa luisguzman-adfa commented Aug 10, 2026 •

Copy link
Copy Markdown
Collaborator

First step of the one-host work; this PR only covers the animation.

The working Lottie was pasted verbatim into three card layouts — ZIM, Maps and
module install — each with the file name written in its XML, and was missing from
Courses entirely. That is how a type ends up without one and how three copies
drift apart.

One shared layout now holds the block and each card includes it where its own
composition wants it: placement stays the card's business, the asset does not.
The block declares no lottie_rawRes on purpose — a layout that can show an
animation on its own is a layout that can contradict the rule — so nothing plays
until a card asks.

The rule is in the domain: ProgressVisual resolves from the execution class,
live work is a download and stopped work is a build, unit-tested on the JVM
along with the mod: key parsing. ProgressVisuals (util) maps that to a raw
resource and is the only place in the app where the file name appears. A module
passes its own key, so the per-platform exception point is reachable from the one
place most likely to need it.

BUILD deliberately resolves to the same asset for now: Maps wants art of its
own and does not have it yet, and a placeholder beats a second copy.

Not every animation in the app. BackupJobFragment picks
k2go_backup_loop/k2go_restore_loop from its mode (ADFA-4961) by this same
principle, written earlier, and keeps its own block — backup and restore are
system operations, not content. The shared layout says so and a TODO says to
extend that precedent rather than build a third mechanism.

The three existing blocks were verified identical before extracting, except the
module card's 16dp margin, which its include overrides. Verified on device: the
four details show one animation each, the three existing ones unchanged, and the
backup screen still uses its own.

…pied

The Lottie block was pasted verbatim into three card layouts — ZIM, Maps
and module install — each with the file name written in its XML, and was
missing from Courses entirely. That is how a type ends up without one and
how three copies drift apart.

One shared layout now holds the block, and each card includes it where
its own composition wants it: placement stays the card's business, the
asset does not. The block declares no lottie_rawRes on purpose — a layout
that can show an animation on its own is a layout that can contradict the
rule — so nothing plays until a card asks ProgressVisuals for it.

The rule itself is in the domain: ProgressVisual resolves from the
execution class, live work is a download and stopped work is a build,
unit-tested on the JVM. ProgressVisuals maps that to a raw resource, and
is the only place in the app where the file name appears.

BUILD deliberately resolves to the same asset for now: Maps wants art of
its own and does not have it yet, and a placeholder beats a second copy.
Giving it one is a line there, or a case in the domain if a single module
turns out to need its own — no layout is touched either way.

The three existing blocks were verified identical before extracting, so
they render as before. Courses gains the animation in the same position
as the others, which is the only visible change.
…overclaiming

Review follow-ups.

applyForModule took no module name, so it built the operation with an empty
platform — and the per-platform exception in forOperation matches on
platform(). The hook that justified resolving instead of placing was
unreachable from the one place most likely to need it. It takes the key now,
and a test fails if that regresses.

The key parsing moved to the domain as ProgressVisual.forKey, which is where
ContentType.byKey already lives; it had been put in presentation out of
habit. That also makes it testable, so "mod:", an unknown key and an empty
one are covered — the prefix is the part that breaks quietly, and an
off-by-one there would classify every module as content.

The module-install card's block was spaced at 16dp, not the shared 12dp. I
called the three blocks identical having compared only their contents, not
the frame around them; its include overrides the margin.

ProgressVisuals moved out of redesign to util, beside Snackbars and
ByteFormatter, so a shared UI helper does not live in the legacy flat
package and kolibri stops reaching into it for this.

And the shared layout no longer says "the animation, once", because it is
not: BackupJobFragment picks k2go_backup_loop or k2go_restore_loop from its
mode (ADFA-4961), by this same principle, written earlier. It stays outside
on purpose — backup and restore are system operations, not content — so the
comment names it and a TODO says to extend that precedent rather than build
a third mechanism.
@luisguzman-adfa
luisguzman-adfa merged commit a1d59ed into main Aug 10, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the refactor/ADFA-5074-one-progress-host branch August 10, 2026 18:59
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