Search in sources :

Example 1 with ReactRootView

use of com.facebook.react.ReactRootView in project native-navigation by airbnb.

the class ReactNativeIntents method getSharedElementOptionsBundle.

static Bundle getSharedElementOptionsBundle(Activity activity, Intent intent, @Nullable ReadableMap options) {
    ViewGroup transitionGroup = null;
    if (activity instanceof ReactInterface && options != null && options.hasKey(SHARED_ELEMENT_TRANSITION_GROUP_OPTION)) {
        ReactRootView reactRootView = ((ReactInterface) activity).getReactRootView();
        transitionGroup = ViewUtils.findViewGroupWithTag(reactRootView, R.id.react_shared_element_group_id, options.getString(SHARED_ELEMENT_TRANSITION_GROUP_OPTION));
    }
    if (transitionGroup == null) {
        //noinspection unchecked
        return ActivityOptionsCompat.makeSceneTransitionAnimation(activity).toBundle();
    } else {
        ReactNativeUtils.setIsSharedElementTransition(intent);
        return AutoSharedElementCallback.getActivityOptionsBundle(activity, transitionGroup);
    }
}
Also used : ViewGroup(android.view.ViewGroup) ReactRootView(com.facebook.react.ReactRootView)

Aggregations

ViewGroup (android.view.ViewGroup)1 ReactRootView (com.facebook.react.ReactRootView)1