Skip to content

Rename TintArgb/ColorArgb → Tint/Color on hand-written facades - #237

Merged
jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers/drop-argb-suffix
Jun 10, 2026
Merged

jonathanpeppers merged 1 commit into
mainfrom
jonathanpeppers/drop-argb-suffix

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Owner

After #221 (implicit long → Color conversion) and #222 (theme reads off composer), the *Argb suffix on color properties is vestigial — callers can pass scheme.OnSurface (a long) straight 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

File Before After
Icon.cs long? TintArgb Color? Tint
HorizontalDivider.cs long? ColorArgb Color? Color
VerticalDivider.cs long? ColorArgb Color? Color
CircularProgressIndicator.cs long? ColorArgb, long? TrackColorArgb Color? Color, Color? TrackColor
LinearProgressIndicator.cs long? ColorArgb, long? TrackColorArgb Color? Color, Color? TrackColor

The render bodies still call the bound DividerKt / ProgressIndicatorKt / IconKt bindings (and the 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 removed entry was in PublicAPI.Unshipped.txt, never Shipped.txt, so a clean break is acceptable pre-1.0. Verified — only Color.FromArgb(...) factories remain (intentional, those aren't being renamed).

Sweep

19 callsite renames across two samples; JetNews and the Gallery had no references.

Sample File Hits
Jetchat Conversation.cs 5
Jetchat Profile.cs 4
Jetchat RecordButton.cs 2
Jetchat JetchatIcon.cs 2
Jetchat JetchatDrawer.cs 1
Reply EmailDetailAppBar.cs 1
Reply ReplyEmailListItem.cs 1
Reply ReplyEmailThreadItem.cs 1
Reply ReplyProfileImage.cs 1
Reply ReplySearchBar.cs 1

Verified

  • ✅ dotnet test src/Microsoft.AndroidX.Compose.SourceGenerators.Tests — 132/132
  • ✅ dotnet build src/Microsoft.AndroidX.Compose — clean (no RS0016/RS0017)
  • ✅ dotnet build src/Microsoft.AndroidX.Compose.Gallery
  • ✅ dotnet build samples/Jetchat
  • ✅ dotnet build samples/JetNews
  • ✅ dotnet build samples/Reply

Not 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.Padding defaults) and round-2 #3 (Func<IComposer, ComposableNode> implicit).

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]>
@jonathanpeppers
jonathanpeppers marked this pull request as ready for review June 10, 2026 12:49
Copilot AI review requested due to automatic review settings June 10, 2026 12:49
@jonathanpeppers
jonathanpeppers merged commit 1f26496 into main Jun 10, 2026
2 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers/drop-argb-suffix branch June 10, 2026 12:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and LinearProgressIndicator from long? to Color?, updating render bodies to use the Color is { } c ? c : 0L conversion pattern.
  • Updated 19 call sites across Jetchat and Reply samples to use the new property names.
  • Re-sorted PublicAPI.Unshipped.txt and 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.

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.

2 participants