Skip to content

Commit f0ae2b1

Browse files
authored
Un-strip Compose Animation bindings (animation-android, animation-core-android) (#1448)
`Xamarin.AndroidX.Compose.Animation.Android` and `Xamarin.AndroidX.Compose.Animation.Core.Android` shipped empty — a blanket `<remove-node path="/api/package" />` stripped every type in `androidx.compose.animation.*` and `androidx.compose.animation.core.*`, so nothing (`Animatable`, `Transition`, `EnterTransition`, animation specs, easing curves, …) was reachable from C#. This replaces the blanket strip with surgical transforms plus the two compile dependencies that were actually missing, so the supporting type system binds. ### `animation-core-android` — targeted `remove-node` transforms Removes only nodes that genuinely can't bind due to binder limitations: - **`vectorize` methods** — Kotlin's `AnimationSpec` hierarchy uses covariant generic return types (`AnimationSpec`→`VectorizedAnimationSpec`, `FiniteAnimationSpec`→`VectorizedFiniteAnimationSpec`, …), inexpressible in C# (CS0738/CS0535/CS9334). - **`VectorizedAnimationSpec.isInfinite`** — a Kotlin default interface property mis-marked abstract by class-parse, so concrete `Vectorized*` classes failed to implement it. - **`TransitionState.getCurrentState/getTargetState`** — generic erasure yields un-overridable abstract `Raw*State` members on the base (CS0534). - **Colliding `DecayAnimation` ctor** — two constructors whose generic params (`T` / `AnimationVector`) both erase to `Object` (CS0111). ### Internal packages removed The internal Kotlin packages `androidx.compose.animation.core.internal` and `androidx.compose.animation.internal` only exposed implementation-detail facade helpers (`JvmDefaultWithCompatibility_jvmAndAndroidKt`, `PlatformOptimizedCancellationException*`), which are not useful public API. Both packages are now removed via `remove-node` transforms, and the corresponding `AndroidX.Compose.Animation.Core.Internal` / `AndroidX.Compose.Animation.Internal` namespaces were dropped from `published-namespaces.txt` and `PublicAPI.Unshipped.txt`. The public `@InternalAnimationApi` opt-in annotation lives in the `core` package (not `core.internal`) and is preserved. ### Dependency additions (preserve API instead of stripping it) Two members referenced types only reachable as second-level transitive deps, unavailable at compile time. Added via `extraDependencies` rather than deleting the members: - `animation-core-android` → `kotlinx-coroutines-core-jvm` (so `DeferredTargetAnimation.updateTarget(CoroutineScope)` binds). - `animation-android` → `ui-unit-android` (so `SharedTransitionScope : Density` and `SplineBased*` bind). ### Packaging / metadata - `nugetVersion` bumped `1.11.2` → `1.11.2.1` for both packages. - New namespaces added to `published-namespaces.txt`; `docs/artifact-list-with-versions.md` updated. - Regenerated `PublicAPI.Unshipped.txt` (core: 614 entries, animation: 227). ### Known limitation Most user-facing `@Composable`s (`AnimatedVisibility`, `Crossfade`, …) remain stripped because their `@JvmInline value class` parameters block binding pending dotnet/java-interop#1440; they should reappear once it lands. The supporting types (`Transition`, `Animatable`, `EnterTransition`/`ExitTransition`, spec/easing types) and the `*Kt` container classes now bind regardless.
1 parent eb2f50b commit f0ae2b1

7 files changed

Lines changed: 891 additions & 12 deletions

File tree

config.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,9 @@
265265
"groupId": "androidx.compose.animation",
266266
"artifactId": "animation-android",
267267
"version": "1.11.2",
268-
"nugetVersion": "1.11.2",
269-
"nugetId": "Xamarin.AndroidX.Compose.Animation.Android"
268+
"nugetVersion": "1.11.2.1",
269+
"nugetId": "Xamarin.AndroidX.Compose.Animation.Android",
270+
"extraDependencies": "androidx.compose.ui.ui-unit-android"
270271
},
271272
{
272273
"groupId": "androidx.compose.animation",
@@ -279,8 +280,9 @@
279280
"groupId": "androidx.compose.animation",
280281
"artifactId": "animation-core-android",
281282
"version": "1.11.2",
282-
"nugetVersion": "1.11.2",
283-
"nugetId": "Xamarin.AndroidX.Compose.Animation.Core.Android"
283+
"nugetVersion": "1.11.2.1",
284+
"nugetId": "Xamarin.AndroidX.Compose.Animation.Core.Android",
285+
"extraDependencies": "org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm"
284286
},
285287
{
286288
"groupId": "androidx.compose.animation",

docs/artifact-list-with-versions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
| 34|androidx.collection:collection-jvm |1.6.0 |Xamarin.AndroidX.Collection.Jvm |1.6.0 |
4242
| 35|androidx.collection:collection-ktx |1.6.0 |Xamarin.AndroidX.Collection.Ktx |1.6.0 |
4343
| 36|androidx.compose.animation:animation |1.11.2 |Xamarin.AndroidX.Compose.Animation |1.11.2 |
44-
| 37|androidx.compose.animation:animation-android |1.11.2 |Xamarin.AndroidX.Compose.Animation.Android |1.11.2 |
44+
| 37|androidx.compose.animation:animation-android |1.11.2 |Xamarin.AndroidX.Compose.Animation.Android |1.11.2.1 |
4545
| 38|androidx.compose.animation:animation-core |1.11.2 |Xamarin.AndroidX.Compose.Animation.Core |1.11.2 |
46-
| 39|androidx.compose.animation:animation-core-android |1.11.2 |Xamarin.AndroidX.Compose.Animation.Core.Android |1.11.2 |
46+
| 39|androidx.compose.animation:animation-core-android |1.11.2 |Xamarin.AndroidX.Compose.Animation.Core.Android |1.11.2.1 |
4747
| 40|androidx.compose.animation:animation-graphics |1.11.2 |Xamarin.AndroidX.Compose.Animation.Graphics |1.11.2 |
4848
| 41|androidx.compose.animation:animation-graphics-android |1.11.2 |Xamarin.AndroidX.Compose.Animation.Graphics.Android |1.11.2 |
4949
| 42|androidx.compose.foundation:foundation |1.11.2 |Xamarin.AndroidX.Compose.Foundation |1.11.2 |

published-namespaces.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ AndroidX.Car.Widget.ItemDecorators
363363
AndroidX.CardView.Widget
364364
AndroidX.Collection
365365
AndroidX.Collection.Internal
366+
AndroidX.Compose.Animation
367+
AndroidX.Compose.Animation.Core
366368
AndroidX.Compose.Animation.Graphics
367369
AndroidX.Compose.Animation.Graphics.Res
368370
AndroidX.Compose.Animation.Graphics.Vector

0 commit comments

Comments
 (0)