Skip to content

Support persistent performance modes and surface events on Android#49

Open
acedmicabhishek wants to merge 5 commits into
LottieFiles:mainfrom
acedmicabhishek:main
Open

Support persistent performance modes and surface events on Android#49
acedmicabhishek wants to merge 5 commits into
LottieFiles:mainfrom
acedmicabhishek:main

Conversation

@acedmicabhishek
Copy link
Copy Markdown

I had major issue with this stuff bro on god no cap

In complex React Native applications, frequent navigation can lead to dropped frames or "invisible icons" due to the constant re-parsing of heavy Lottie JSON models. To resolve this, this PR exposes new high-performance features for Android, allowing developers to directly optimize animation responsiveness and lifecycle handling.

When combined with the companion updates in the dotlottie-android core, this provides a robust, native-level solution for achieving "premium" animation performance.
I have made the pull on that repo too
both of them needs to be merged

New Features & API Updates

  • performanceMode Prop: Allows developers to switch between ram (default) and cpu modes. Activating cpu mode keeps the underlying C++ player alive in a native cache, successfully eliminating re-parsing overhead during screen transitions.
  • cacheId Prop: Introduces a unique identifier for caching specific player instances in native memory. This is especially critical for maintaining smooth performance in persistent UI elements like Bottom Navigation Bars.
  • onSurfaceReady Event: Added a new bubbling event that instantly notifies the JavaScript thread the moment the native OpenGL surface is fully bound and ready to render, enabling perfect synchronization for initial animations.
  • Documentation: Added a comprehensive PERFORMANCE.md guide and updated the README to clearly explain these optimizations to developers.

Note: These enhancements are currently Android-specific optimizations. This is due to the unique way TextureView lifecycles and GL contexts operate on the Android platform.

NOTE : LOOK BRO I KNOW YALL GOATED AND SMART BUT IDK WHY IM SAYING THIS , ONCE Y'ALL MERGE IT

UPDATE THE GRADLE FILE , IT CURRENTLY HOOK TO MY OTHER FORK OF DOTLOTTIE-ANDROID BECAUSE BOTH NEEDS TO BE MERGED , BECAUSE THIS FEATURE IS TOTALLY DEPENDENT ON THE DOTLOTTIE-ANDROID

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

🦋 Changeset detected

Latest commit: ce4ee32

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@theashraf
Copy link
Copy Markdown
Member

@acedmicabhishek

the solution has to be provided first from dotlottie-android release to review this PR

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