Repository navigation
ADFA-6312: Quick Build toolbar shows a visible stop icon while a build runs - #2106
Conversation
The BUILDING tone drew ic_quick_build_building, a layer-list of an animated-rotate ring and a stop square. On the Samsung A56 the toolbar slot rendered blank for the whole build: the button was there, enabled and announced "Cancel build", but drew no pixels. Bryan's call: drop the spinner and reuse the static ring-and-square the Run button already shows (ic_stop_daemons), so both buttons present a running build the same way. The three building drawables have no other users and are deleted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1o4KqT54Vp2zpakJ54sbU
…eir colour The editor toolbar set the colour filter on the action's icon and only then called mutate(). LayerDrawable.mutate() rebuilds its layers from their constant state, which drops a filter set beforehand, so a layer-list icon drew its raw paint (white on the light toolbar). Tinting before mutate() also wrote onto drawable state shared with other users of the same resource. Mutate first, then tint and dim once, in a small toolbarIcon() helper so the order is pinned by a Robolectric test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1o4KqT54Vp2zpakJ54sbU
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
itsaky-adfa
left a comment
There was a problem hiding this comment.
Review of 81016c7665. Already approved by @jatezzz at this head; this is a second pass on request.
Checked against ADFA-6312's acceptance criteria: BUILDING maps to ic_stop_daemons (AC1), QuickBuildActionPresentationTest pins it (AC3), and the three deleted drawables have no remaining references. ToolbarIconTest's layer test does fail with tint-before-mutate, since LayerDrawable.mutate() rebuilds its children from their ConstantState and drops a per-instance filter. Verified by reading the code at head; tests were not re-run locally.
REVIEW.md has no written approve/request-changes rule, so the default applied.
ADFA-6312
Quick Build's toolbar button now shows a visible stop icon the whole time a build runs, in light and dark themes. On the Samsung A56 the button drew blank for the whole build — functional but invisible — so nothing signalled a build was running or how to stop it.
The BUILDING state now draws
ic_stop_daemons(the Run button's static stop icon) instead of the animatedic_quick_build_building, so a stop icon is visible in both light and dark.What to review
QuickBuildAction.kt— the BUILDING tone drops the animated spinner and reuses the Run button's static stop icon.ToolbarIcon.kt— small helper that callsmutate()before tinting, so a layer-list icon keeps its colour.EditorHandlerActivity.kt— routes toolbar icon tinting through that helper.Screenshots
Before (origin/stage) the BUILDING-state button was blank; after the fix it draws the stop icon in light and dark, and it holds at 2x font scale. Before/after device screenshots (A56: light and dark, font scale 1.0 and 2.0, first-full-build and live-reload) were captured during the device pass and can be added to this PR on request.
Tested at
4fa62a2405ToolbarIconTest(new, 3 cases) andQuickBuildActionPresentationTest(10 cases), both green.ToolbarIconTestpins the mutate-then-tint order; watched failing (icon drew raw white) with the order reverted, green with the fix.ToolbarIcon.kt:ToolbarIconTestcovers 100% line (4/4), 100% instruction, and 83.3% branch (5/6) — null icon, enabled, disabled, and the mutate-then-tint path on a layered icon. The one uncovered branch is the null-return path oficon.mutate()?, unreachable becauseDrawable.mutate()contractually returnsthisand the?.is Kotlin's safe-call on a platform return type.🤖 Generated with Claude Code
https://claude.ai/code/session_018DEPcb7gdHpRHRHXVqNnbf