Skip to content

feat: Route opacity CSS transitions to the Android platform path - #10240

Merged
MatiPl01 merged 2 commits into
mainfrom
@matipl01/android-css-opacity-routing-flag
Aug 12, 2026
Merged

MatiPl01 merged 2 commits into
mainfrom
@matipl01/android-css-opacity-routing-flag

Conversation

@MatiPl01

Copy link
Copy Markdown
Contributor

Adds the Android arm of canRouteCSSProperty so opacity routes to the platform backend, behind the ANDROID_CSS_PLATFORM_TRANSITIONS static flag, and turns that flag on in the example apps.

The flag defaults to false, so nothing changes for users. Independent of the platform backend stack: until the Android hook is wired, apply() returns false on an empty std::function and every property falls back to the C++ loop, so this is a no-op whichever order it lands in.

Any TimeInterpolator can carry a curve, so unlike Apple every CSS easing routes; Kotlin rebuilds steps() and linear() stops from the same points the loop uses.

Routes opacity to the Android backend behind ANDROID_CSS_PLATFORM_TRANSITIONS,
off by default. The backend declines when the view predates API 29 or the
target is 0, and those transitions fall back to the C++ loop.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 65992368-7c77-4fc9-943a-fa5a03ef5033

📥 Commits

Reviewing files that changed from the base of the PR and between 66b8724 and 90815c5.

📒 Files selected for processing (1)
  • packages/react-native-reanimated/Common/cpp/reanimated/CSS/utils/platform.cpp

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added support for routing Android opacity transitions through native platform transitions when the feature is enabled.
    • Android CSS transitions now accept all easing types for supported native transitions.
    • Added a feature flag to control this behavior, disabled by default in the main configuration.
  • Bug Fixes
    • Unsupported CSS properties continue to use the standard animation path for reliable behavior.
  • Configuration
    • Enabled the feature in the Android, macOS, and tvOS example applications for testing and demonstration.

Walkthrough

Adds the ANDROID_CSS_PLATFORM_TRANSITIONS static flag, enables it in example applications, and routes Android CSS transitions for opacity when the flag is enabled.

Changes

Android CSS platform transitions

Layer / File(s) Summary
Transition flag configuration
packages/react-native-reanimated/src/featureFlags/*, apps/*-example/package.json
Adds the flag with a default value of false and enables it in the Fabric, macOS, and tvOS examples.
Android transition routing
packages/react-native-reanimated/Common/cpp/reanimated/CSS/utils/platform.*
Routes Android transitions for opacity when enabled. Updates the documentation for backend-specific routing and C++ fallback behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: pawicao, tjzel

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: routing opacity CSS transitions through the Android platform path.
Description check ✅ Passed The description accurately explains the Android routing logic, feature flag, default behavior, fallback path, and easing handling.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch @matipl01/android-css-opacity-routing-flag

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MatiPl01
MatiPl01 force-pushed the @matipl01/android-css-opacity-routing-flag branch from 66b8724 to 90815c5 Compare August 12, 2026 12:43
@MatiPl01
MatiPl01 requested a review from pawicao August 12, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants