K2GO-385 refactor(ui): extract shared K2GoChip and migrate the duplicated outlined chips - #538
Merged
Merged
Conversation
…ated outlined chips The outlined status/meta chip (transparent fill, colored 1.4dp stroke, M3 LabelMedium) was copy-pasted: DashboardDetailFragment built it via chip()/styleChip() and ModuleDetailFragment via an identical chip(), so a fix to one silently missed the other. Add redesign/K2GoChip with create(ctx, text, colorRes) to build a row chip and style(TextView, text, colorRes) to recolor one in place (for the live status pill), preserving the exact dp/appearance/outline. Migrate both fragments onto it and drop their private helpers (and now-orphaned imports). The card home dot+label is a different form with a single-owner state rule and stays out; a survey of the other GradientDrawable sites found no further instance of this chip (ModuleHubFragment.statePill is a distinct, overloaded full-radius pill, left as-is).
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.
Extracts the app's outlined status/meta chip into one shared component so a fix lands once instead of in each copy.
What changes
redesign/K2GoChip:create(ctx, text, colorRes)builds a row chip,style(TextView, text, colorRes)recolors one in place (for the live status pill). Same M3 Label Medium, transparent fill, 1.4dp coloured outline — exact dp preserved.DashboardDetailFragmentandModuleDetailFragmentoff their duplicated privatechip()/styleChip()onto it; drop the copies and now-orphaned imports.Net: −53 lines across the two fragments; no visual change.
Out of scope
ModuleHubFragment.statePill(a distinct, overloaded pill) stay as-is. Follow-up is the status/action/metadata role split — design decision recorded on K2GO-385.Verification
assembleDebug) and installed on device; Dashboard-detail and Module-detail chips render identically to the pre-change build; no crash.