Repository navigation
Rename TintArgb/ColorArgb → Tint/Color on hand-written facades - #237
Merged
Merged
Conversation
After PR #221 (implicit `long -> Color` conversion) and PR #222 (theme reads off composer), the `*Argb` suffix on color properties is vestigial — callers can pass `scheme.OnSurface` (a `long`) directly to a `Color?` property and the implicit conversion does the rest. The five hand-written facades that still exposed `long? *Argb` are renamed here to match the shape the source-generated `Text` facade already uses (`public Color? Color`). Renames (all in `Microsoft.AndroidX.Compose`): - Icon.TintArgb -> Tint - HorizontalDivider.ColorArgb -> Color - VerticalDivider.ColorArgb -> Color - CircularProgressIndicator.{ColorArgb, TrackColorArgb} -> {Color, TrackColor} - LinearProgressIndicator.{ColorArgb, TrackColorArgb} -> {Color, TrackColor} The render bodies still call the bound `DividerKt` / `ProgressIndicatorKt` / `IconKt` bindings (and `IconPainter` bridge) with a `long` color slot; the new properties are converted via `Color is { } c ? c : 0L`. No `[Obsolete]` aliases — same rationale as #221, #223, #225, #226, #229: every entry was in `PublicAPI.Unshipped.txt`, never `Shipped.txt`, so a clean break is acceptable pre-1.0. Sweep: 19 callsite renames across two samples — Jetchat (15: Conversation, JetchatDrawer, JetchatIcon, Profile, RecordButton), Reply (5: EmailDetailAppBar, ReplyEmailListItem, ReplyEmailThreadItem, ReplyProfileImage, ReplySearchBar). JetNews and the Gallery had no references. Verified: generator tests 132/132, facade build, Gallery build, Jetchat / JetNews / Reply builds all clean (no RS0016/RS0017). Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR renames long? TintArgb/ColorArgb/TrackColorArgb properties to Color? Tint/Color/TrackColor on the five hand-written facades that still exposed the old ARGB-packed-long shape. With PRs #221 (implicit long → Color) and #222 (theme reads off composer) already merged, the *Argb suffix is vestigial — callers can pass theme color longs directly to Color? properties via the implicit conversion. The new property names and types match the shape already used by source-generated facades (e.g., Text.Color).
Changes:
- Renamed properties on
Icon,HorizontalDivider,VerticalDivider,CircularProgressIndicator, andLinearProgressIndicatorfromlong?toColor?, updating render bodies to use theColor is { } c ? c : 0Lconversion pattern. - Updated 19 call sites across Jetchat and Reply samples to use the new property names.
- Re-sorted
PublicAPI.Unshipped.txtand swapped old entries for the renamed ones (clean break, pre-1.0 API never shipped).
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/Microsoft.AndroidX.Compose/Icon.cs |
Renames long? TintArgb → Color? Tint; updates render body and XML doc. |
src/Microsoft.AndroidX.Compose/HorizontalDivider.cs |
Renames long? ColorArgb → Color? Color; updates render body and XML doc. |
src/Microsoft.AndroidX.Compose/VerticalDivider.cs |
Renames long? ColorArgb → Color? Color; updates render body and XML doc. |
src/Microsoft.AndroidX.Compose/CircularProgressIndicator.cs |
Renames ColorArgb/TrackColorArgb → Color/TrackColor; updates render body and XML docs. |
src/Microsoft.AndroidX.Compose/LinearProgressIndicator.cs |
Renames ColorArgb/TrackColorArgb → Color/TrackColor; updates render body and XML docs. |
src/Microsoft.AndroidX.Compose/PublicAPI.Unshipped.txt |
Removes 10 old *Argb entries, adds 10 new Color?-typed entries, re-sorts file. |
samples/Jetchat/Conversation.cs |
5 call sites: TintArgb → Tint, ColorArgb → Color. |
samples/Jetchat/Profile.cs |
4 call sites: TintArgb → Tint, ColorArgb → Color. |
samples/Jetchat/RecordButton.cs |
2 call sites: TintArgb → Tint. |
samples/Jetchat/JetchatIcon.cs |
2 call sites: TintArgb → Tint. |
samples/Jetchat/JetchatDrawer.cs |
1 call site: TintArgb → Tint. |
samples/Reply/EmailDetailAppBar.cs |
1 call site: TintArgb → Tint. |
samples/Reply/ReplyEmailListItem.cs |
1 call site: TintArgb → Tint. |
samples/Reply/ReplyEmailThreadItem.cs |
1 call site: TintArgb → Tint. |
samples/Reply/ReplyProfileImage.cs |
1 call site: TintArgb → Tint. |
samples/Reply/ReplySearchBar.cs |
1 call site: TintArgb → Tint. |
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.
After #221 (implicit
long → Colorconversion) and #222 (theme reads off composer), the*Argbsuffix on color properties is vestigial — callers can passscheme.OnSurface(along) straight to aColor?property and the implicit conversion does the rest. The five hand-written facades that still exposedlong? *Argbare renamed here to match the shape the source-generatedTextfacade already uses (public Color? Color).Renames
Icon.cslong? TintArgbColor? TintHorizontalDivider.cslong? ColorArgbColor? ColorVerticalDivider.cslong? ColorArgbColor? ColorCircularProgressIndicator.cslong? ColorArgb,long? TrackColorArgbColor? Color,Color? TrackColorLinearProgressIndicator.cslong? ColorArgb,long? TrackColorArgbColor? Color,Color? TrackColorThe render bodies still call the bound
DividerKt/ProgressIndicatorKt/IconKtbindings (and theIconPainterbridge) with alongcolor slot; the new properties are converted viaColor is { } c ? c : 0L.No
[Obsolete]aliasesSame rationale as #221, #223, #225, #226, #229: every removed entry was in
PublicAPI.Unshipped.txt, neverShipped.txt, so a clean break is acceptable pre-1.0. Verified — onlyColor.FromArgb(...)factories remain (intentional, those aren't being renamed).Sweep
19 callsite renames across two samples; JetNews and the Gallery had no references.
Conversation.csProfile.csRecordButton.csJetchatIcon.csJetchatDrawer.csEmailDetailAppBar.csReplyEmailListItem.csReplyEmailThreadItem.csReplyProfileImage.csReplySearchBar.csVerified
dotnet test src/Microsoft.AndroidX.Compose.SourceGenerators.Tests— 132/132dotnet build src/Microsoft.AndroidX.Compose— clean (no RS0016/RS0017)dotnet build src/Microsoft.AndroidX.Compose.Gallerydotnet build samples/Jetchatdotnet build samples/JetNewsdotnet build samples/ReplyNot deployed to a device — leaving smoke-test for the user.
Coordination
Round-2 #2. Disjoint file set from sibling round-2 PRs except for
PublicAPI.Unshipped.txt— expect a mechanical sort conflict on merge with round-2 #1 (Modifier.Paddingdefaults) and round-2 #3 (Func<IComposer, ComposableNode>implicit).