Java Code Examples for com.facebook.react.common.MapBuilder#of()

The following examples show how to use com.facebook.react.common.MapBuilder#of() . 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: ScreenCoordinator.java    From native-navigation with MIT License 5 votes vote down vote up
private void deliverPromise(Promise promise, int resultCode, Map<String, Object> payload) {
  if (promise != null) {
    Map<String, Object> newPayload =
            MapBuilder.of(EXTRA_CODE, resultCode, EXTRA_PAYLOAD, payload);
    promise.resolve(ConversionUtil.toWritableMap(newPayload));
  }
}
 
Example 2
Source File: YouTubeManager.java    From react-native-youtube with MIT License 5 votes vote down vote up
@Override
public Map<String,Integer> getCommandsMap() {
    return MapBuilder.of(
        "seekTo",
        COMMAND_SEEK_TO,
        "nextVideo",
        COMMAND_NEXT_VIDEO,
        "previousVideo",
        COMMAND_PREVIOUS_VIDEO,
        "playVideoAt",
        COMMAND_PLAY_VIDEO_AT
    );
}
 
Example 3
Source File: CustomTwilioVideoViewManager.java    From react-native-twilio-video-webrtc with MIT License 5 votes vote down vote up
@Override
@Nullable
public Map getExportedCustomDirectEventTypeConstants() {
    Map<String, Map<String, String>> map = MapBuilder.of(
            ON_CAMERA_SWITCHED, MapBuilder.of("registrationName", ON_CAMERA_SWITCHED),
            ON_VIDEO_CHANGED, MapBuilder.of("registrationName", ON_VIDEO_CHANGED),
            ON_AUDIO_CHANGED, MapBuilder.of("registrationName", ON_AUDIO_CHANGED),
            ON_CONNECTED, MapBuilder.of("registrationName", ON_CONNECTED),
            ON_CONNECT_FAILURE, MapBuilder.of("registrationName", ON_CONNECT_FAILURE),
            ON_DISCONNECTED, MapBuilder.of("registrationName", ON_DISCONNECTED),
            ON_PARTICIPANT_CONNECTED, MapBuilder.of("registrationName", ON_PARTICIPANT_CONNECTED)
    );

    map.putAll(MapBuilder.of(
            ON_PARTICIPANT_DISCONNECTED, MapBuilder.of("registrationName", ON_PARTICIPANT_DISCONNECTED),
            ON_DATATRACK_MESSAGE_RECEIVED, MapBuilder.of("registrationName", ON_DATATRACK_MESSAGE_RECEIVED),
            ON_PARTICIPANT_ADDED_DATA_TRACK, MapBuilder.of("registrationName", ON_PARTICIPANT_ADDED_DATA_TRACK),
            ON_PARTICIPANT_ADDED_VIDEO_TRACK, MapBuilder.of("registrationName", ON_PARTICIPANT_ADDED_VIDEO_TRACK),
            ON_PARTICIPANT_REMOVED_VIDEO_TRACK, MapBuilder.of("registrationName", ON_PARTICIPANT_REMOVED_VIDEO_TRACK),
            ON_PARTICIPANT_ADDED_AUDIO_TRACK, MapBuilder.of("registrationName", ON_PARTICIPANT_ADDED_AUDIO_TRACK),
            ON_PARTICIPANT_REMOVED_AUDIO_TRACK, MapBuilder.of("registrationName", ON_PARTICIPANT_REMOVED_AUDIO_TRACK)
    ));

    map.putAll(MapBuilder.of(
            ON_PARTICIPANT_REMOVED_DATA_TRACK, MapBuilder.of("registrationName", ON_PARTICIPANT_REMOVED_DATA_TRACK)
    ));

    map.putAll(MapBuilder.of(
            ON_PARTICIPANT_ENABLED_VIDEO_TRACK, MapBuilder.of("registrationName", ON_PARTICIPANT_ENABLED_VIDEO_TRACK),
            ON_PARTICIPANT_DISABLED_VIDEO_TRACK, MapBuilder.of("registrationName", ON_PARTICIPANT_DISABLED_VIDEO_TRACK),
            ON_PARTICIPANT_ENABLED_AUDIO_TRACK, MapBuilder.of("registrationName", ON_PARTICIPANT_ENABLED_AUDIO_TRACK),
            ON_PARTICIPANT_DISABLED_AUDIO_TRACK, MapBuilder.of("registrationName", ON_PARTICIPANT_DISABLED_AUDIO_TRACK),
            ON_STATS_RECEIVED, MapBuilder.of("registrationName", ON_STATS_RECEIVED)
    ));

    return map;
}
 
Example 4
Source File: ReactViewPagerManager.java    From react-native-image-zoom with MIT License 5 votes vote down vote up
@Override
public Map<String,Integer> getCommandsMap() {
    return MapBuilder.of(
            "setPage",
            COMMAND_SET_PAGE,
            "setPageWithoutAnimation",
            COMMAND_SET_PAGE_WITHOUT_ANIMATION);
}
 
Example 5
Source File: ViewManager.java    From react-native-image-zoom with MIT License 5 votes vote down vote up
@Override
public @Nullable
Map getExportedCustomDirectEventTypeConstants() {
    return MapBuilder.of(
        ImageEvent.eventNameForType(ImageEvent.ON_TAP), MapBuilder.of("registrationName", "onTap"),
        ImageEvent.eventNameForType(ImageEvent.ON_LOAD), MapBuilder.of("registrationName", "onLoad"),
        ImageEvent.eventNameForType(ImageEvent.ON_SCALE), MapBuilder.of("registrationName", "onScaleChange"),
        ImageEvent.eventNameForType(ImageEvent.ON_MATRIX), MapBuilder.of("registrationName", "onMatrixChange")
    );
}
 
Example 6
Source File: CrosswalkWebViewGroupManager.java    From react-native-webview-crosswalk with MIT License 5 votes vote down vote up
@Override
public
@Nullable
Map<String, Integer> getCommandsMap () {
    return MapBuilder.of(
        "goBack", GO_BACK,
        "goForward", GO_FORWARD,
        "reload", RELOAD,
        "postMessage", POST_MESSAGE
    );
}
 
Example 7
Source File: ReactDrawerLayoutManager_1d0b39_s.java    From coming with MIT License 5 votes vote down vote up
@Override
public @Nullable Map getExportedCustomDirectEventTypeConstants() {
  return MapBuilder.of(
      DrawerSlideEvent.EVENT_NAME, MapBuilder.of("registrationName", "onDrawerSlide"),
      DrawerOpenedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onDrawerOpen"),
      DrawerClosedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onDrawerClose"),
      DrawerStateChangedEvent.EVENT_NAME, MapBuilder.of(
          "registrationName", "onDrawerStateChanged"));
}
 
Example 8
Source File: LottieAnimationViewManager.java    From lottie-react-native with Apache License 2.0 5 votes vote down vote up
@Override public Map<String, Integer> getCommandsMap() {
  return MapBuilder.of(
      "play", COMMAND_PLAY,
      "reset", COMMAND_RESET,
      "pause", COMMAND_PAUSE,
      "resume", COMMAND_RESUME
  );
}
 
Example 9
Source File: AMapViewManager.java    From react-native-amap with MIT License 5 votes vote down vote up
@Override
public @Nullable Map<String, Integer> getCommandsMap() {
    return MapBuilder.of(
        "animateToRegion", ANIMATE_TO_REGION,
        "getMapScreenShot", GET_MAP_SCREENSHOT
    );
}
 
Example 10
Source File: AppBarLayoutManager.java    From react-native-collapsing-toolbar with MIT License 5 votes vote down vote up
@Override
public @javax.annotation.Nullable
Map<String, Integer> getCommandsMap() {
    return MapBuilder.of(
            "show", COMMAND_SHOW,
            "hide", COMMAND_HIDE,
            "redraw", COMMAND_REDRAW
    );
}
 
Example 11
Source File: ReactTweetViewManager.java    From react-native-twitterkit with MIT License 5 votes vote down vote up
public @Nullable
Map getExportedCustomDirectEventTypeConstants() {
  return MapBuilder.of(
          "onLoadError", MapBuilder.of("registrationName", "onLoadError"),
          "onLoadSuccess", MapBuilder.of("registrationName", "onLoadSuccess")
  );
}
 
Example 12
Source File: BrightcovePlayerManager.java    From react-native-brightcove-player with MIT License 5 votes vote down vote up
@Override
public Map<String, Integer> getCommandsMap() {
    return MapBuilder.of(
            "seekTo",
            COMMAND_SEEK_TO
    );
}
 
Example 13
Source File: ReactAztecManager.java    From react-native-aztec with GNU General Public License v2.0 5 votes vote down vote up
@Nullable
@Override
public Map getExportedCustomDirectEventTypeConstants() {
    return MapBuilder.of(
            "topSelectionChange",
            MapBuilder.of("registrationName", "onSelectionChange")
            );
}
 
Example 14
Source File: RN3DViewManager.java    From react-native-3d-model-view with MIT License 5 votes vote down vote up
@Override
public Map<String,Integer> getCommandsMap() {
  return MapBuilder.of(
          "startAnimation",
          COMMAND_START_ANIMATION,
          "stopAnimation",
          COMMAND_STOP_ANIMATION,
          "setProgress",
          COMMAND_SET_PROGRESS);
}
 
Example 15
Source File: NativeAdViewManager.java    From react-native-fbads with MIT License 5 votes vote down vote up
@Override
@Nullable
public Map<String, Object> getExportedCustomDirectEventTypeConstants() {
  return MapBuilder.<String, Object>of(
      "onAdLoaded",
      MapBuilder.of("registrationName", "onAdLoaded"),
      "onAdFailed",
      MapBuilder.of("registrationName", "onAdFailed")
  );
}
 
Example 16
Source File: RNCameraViewManager.java    From react-native-camera-android with MIT License 4 votes vote down vote up
@Override
public @Nullable
Map<String, Integer> getCommandsMap() {
    return MapBuilder.of("takePicture", TAKE_PICTURE);
}
 
Example 17
Source File: RNPublisherBannerViewManager.java    From react-native-admob with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Nullable
@Override
public Map<String, Integer> getCommandsMap() {
    return MapBuilder.of("loadBanner", COMMAND_LOAD_BANNER);
}
 
Example 18
Source File: ReactChatInputManager.java    From aurora-imui with MIT License 4 votes vote down vote up
@Nullable
@Override
public Map<String, Integer> getCommandsMap() {
    return MapBuilder.of("close_soft_input", CLOSE_SOFT_INPUT);
}
 
Example 19
Source File: ReactToolbarManager.java    From react-native-GPay with MIT License 4 votes vote down vote up
@Nullable
@Override
public Map<String, Integer> getCommandsMap() {
  return MapBuilder.of("dismissPopupMenus", COMMAND_DISMISS_POPUP_MENUS);
}
 
Example 20
Source File: ReactDrawerLayoutManager_1d0b39_t.java    From coming with MIT License 4 votes vote down vote up
@Override
public @Nullable Map getExportedViewConstants() {
  return MapBuilder.of(
      "DrawerPosition",
      MapBuilder.of("Left", Gravity.START, "Right", Gravity.END));
}