Commit 90d2610
Use wildcard CompanionStatic rename to surface all class companions
The previous commit enumerated 7 specific Kotlin companion classes by name
across foundation-android (1), ui-graphics-android (1), and ui-text-android
(5). That fixed those 7 but left 62 more classes with the same problem in
just these three packages: ScrollState.Companion, LazyListState.Companion,
BlendMode.Companion, Brush.Companion, Path.Companion, ImeAction.Companion,
TextRange.Companion, AnnotatedString.Companion, and many others were still
unreachable without raw JNI.
Replace the per-class entries with the same wildcard XPath that
kotlin-stdlib, okio-jvm, com.google.ai.edge.aicore, and com.google.mlkit
genai-prompt already use:
<attr path="/api/package/class[substring(@name,string-length(@name)-9)
='.Companion']"
name="managedName">CompanionStatic</attr>
This renames every nested *.Companion peer in the package to CompanionStatic,
letting the binding generator emit `public static <Outer>.CompanionStatic
Companion { get; }` on every outer class.
After this change:
foundation-android : 24 new static Companion accessors
ui-graphics-android: 35 new static Companion accessors
ui-text-android : 45 new static Companion accessors
---
104 total (vs. 7 in the previous revision)
Interface companions are unaffected — the binding generator hoists them to
top-level <Outer>Companion before this rename matches, so `Path.Companion`,
`ImageBitmap.Companion`, `DrawScope.Companion`, etc. surface correctly via
their hoisted peer.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 227fa7b commit 90d2610
6 files changed
Lines changed: 896 additions & 511 deletions
File tree
- source
- androidx.compose.foundation/foundation-android
- PublicAPI
- Transforms
- androidx.compose.ui
- ui-graphics-android
- PublicAPI
- Transforms
- ui-text-android
- PublicAPI
- Transforms
Lines changed: 278 additions & 99 deletions
Large diffs are not rendered by default.
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
86 | 88 | | |
87 | | - | |
| 89 | + | |
88 | 90 | | |
0 commit comments