refactor(games): unify recent win/loss chip across games#62
Merged
Conversation
Extract a shared WinLossChip and RecentResultsStrip (the Coinflip lettered W / L / P style, tone-driven via OutcomeTone) and use them in Coinflip, Mines, Crash and Blackjack so the recent-results indicator looks the same everywhere. This restyles Crash's plain colored squares and Blackjack's solid chips to match Coinflip; each screen drops its local RecentStrip / RecentChip / HistoryChip copy. Roulette is left as-is (it shows colored pocket numbers, not win/loss).
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.
Summary
Unifies the recent win/loss indicator across the games so it looks the same
everywhere (except Roulette), matching Coinflip's lettered chip. Extracts a
shared
WinLossChipandRecentResultsStripand wires Coinflip, Mines, Crashand Blackjack to them.
Rationale
The four games each had their own recent-results strip: Coinflip and Mines drew
a tinted, bordered chip with a W / L letter; Crash drew a plain solid square with
no label; Blackjack drew a solid-fill chip with a white W / L / P letter. They
were visually inconsistent for the same concept.
The new
WinLossChip(tone: OutcomeTone)reuses the existingOutcomeTone(Win / Loss / Push) enum and renders the Coinflip style;
RecentResultsStripwraps the "Recent" header and the chip row. Each screen now maps its result list
to
OutcomeToneand calls the shared strip, deleting its localRecentStrip/RecentChip/HistoryChip. Net -30 lines.Roulette is intentionally left untouched: its strip shows colored pocket numbers
(0-36), not a win/loss outcome, so the shared chip does not apply.
Verification
./gradlew :app:compileDebugKotlin(green)./gradlew :app:ktlintMainSourceSetCheck(green)./gradlew :app:detekt(green)./gradlew :app:installDebug-- built and installed on a physical device.On-device screenshots of the Crash/Blackjack strips are pending (the test device
was in active use); the chip is the same shared composable already shown working
on Coinflip.
Test plan
the identical W / L / P chip on device; confirm Roulette is unchanged.
Related issues
Checklist
refactor/).[Unreleased].