Skip to content

Un-strip Compose Animation bindings (animation-android, animation-core-android)#1448

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/compose-animation-fix
Draft

Un-strip Compose Animation bindings (animation-android, animation-core-android)#1448
Copilot wants to merge 3 commits into
mainfrom
copilot/compose-animation-fix

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 5, 2026

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 (AnimationSpecVectorizedAnimationSpec, FiniteAnimationSpecVectorizedFiniteAnimationSpec, …), 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-androidkotlinx-coroutines-core-jvm (so DeferredTargetAnimation.updateTarget(CoroutineScope) binds).
  • animation-androidui-unit-android (so SharedTransitionScope : Density and SplineBased* bind).

Packaging / metadata

  • nugetVersion bumped 1.11.21.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 @Composables (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.

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix blank removal of Compose Animation bindings for Android Un-strip Compose Animation bindings (animation-android, animation-core-android) Jun 5, 2026
Copilot AI requested a review from jonathanpeppers June 5, 2026 23:24
@jonathanpeppers
Copy link
Copy Markdown
Member

@copilot should we remove the *.Internal package/namespace? If so make sure to update namespaces file

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 6, 2026

@copilot should we remove the *.Internal package/namespace? If so make sure to update namespaces file

Yes — those packages (androidx.compose.animation.internal, androidx.compose.animation.core.internal) only contain internal Kotlin facade helpers (JvmDefaultWithCompatibility_jvmAndAndroidKt, PlatformOptimizedCancellationException*), so they're not useful public API. In e1c4717 I added remove-node transforms for both packages and dropped AndroidX.Compose.Animation.Internal / AndroidX.Compose.Animation.Core.Internal from published-namespaces.txt (and the matching PublicAPI.Unshipped.txt entries). The public @InternalAnimationApi opt-in annotation lives in the core package, not the core.internal package, so it's kept.

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.

Compose Animation: animation-android and animation-core-android are fully blanket-stripped (<remove-node path="/api/package"/>)

2 participants