Java Code Examples for com.facebook.react.bridge.Arguments#makeNativeMap()

The following examples show how to use com.facebook.react.bridge.Arguments#makeNativeMap() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UIManagerModule.java    From react-native-GPay with MIT License 6 votes vote down vote up
@ReactMethod(isBlockingSynchronousMethod = true)
public @Nullable WritableMap getConstantsForViewManager(final String viewManagerName) {
  ViewManager targetView =
      viewManagerName != null ? mUIImplementation.resolveViewManager(viewManagerName) : null;
  if (targetView == null) {
    return null;
  }

  SystraceMessage.beginSection(
          Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "UIManagerModule.getConstantsForViewManager")
      .arg("ViewManager", targetView.getName())
      .arg("Lazy", true)
      .flush();
  try {
    Map<String, Object> viewManagerConstants =
        UIManagerModuleConstantsHelper.createConstantsForViewManager(
            targetView, null, null, null, mCustomDirectEvents);
    if (viewManagerConstants != null) {
      return Arguments.makeNativeMap(viewManagerConstants);
    }
    return null;
  } finally {
    SystraceMessage.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE).flush();
  }
}
 
Example 2
Source File: UIManagerModule.java    From react-native-GPay with MIT License 4 votes vote down vote up
@ReactMethod(isBlockingSynchronousMethod = true)
public WritableMap getDefaultEventTypes() {
  return Arguments.makeNativeMap(UIManagerModuleConstantsHelper.getDefaultExportableEventTypes());
}