Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crashes when reloading app quickly on Android #5958

Merged
merged 2 commits into from
May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@
}

public boolean isLayoutAnimationEnabled() {
// In case the user rapidly reloads the app, there is a possibility that the active instance may
// not be available.
// However, the code will still attempt to trigger the layout animation of views that are going
// to be dropped.
// This is required as without it, the `mAnimationsManager.isLayoutAnimationEnabled`
// would crash when trying to get the uiManager from the context.
if (!mContext.hasActiveReactInstance()) {
return false;
}

maybeInit();
return mAnimationsManager.isLayoutAnimationEnabled();
}
Expand Down Expand Up @@ -424,7 +434,7 @@
cleanerCallback.remove(view.getId());
runnable.run();
}
// childrens' callbacks should be cleaned by former publicDropView calls as Animation Manager

Check warning on line 437 in android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (childrens)
// stripes views from bottom to top
super.dropView(view);
}
Expand Down
Loading