Java Code Examples for com.facebook.react.common.MapBuilder

The following examples show how to use com.facebook.react.common.MapBuilder. These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
@Override
public Map<String, Integer> getCommandsMap() {
    Map<String, Integer> map = MapBuilder.of(
            "showCalloutViaManager",SHOW_CALLOUT,
            "centerMapViaManager", CENTER_MAP,
            "addGraphicsOverlayViaManager", ADD_GRAPHICS_OVERLAY,
            "removeGraphicsOverlayViaManager",REMOVE_GRAPHICS_OVERLAY,
            "addPointsToOverlayViaManager",ADD_POINTS_TO_OVERLAY,
            "removePointsFromOverlayViaManager", REMOVE_POINTS_FROM_OVERLAY,
            "updatePointsInGraphicsOverlayViaManager", UPDATE_POINTS_IN_GRAPHICS_OVERLAY
    );
    // Ran out of space in the constructor lol
    map.put("routeGraphicsOverlayViaManager",ROUTE_GRAPHICS_OVERLAY);
    map.put("setRouteIsVisible", SET_ROUTE_IS_VISIBLE);
    map.put("dispose", DISPOSE);
    return map;
}
 
Example 2
Source Project: react-native-amap   Source File: AMapMarkerManager.java    License: MIT License 6 votes vote down vote up
@Override
@Nullable
public Map getExportedCustomDirectEventTypeConstants() {
    Map<String, Map<String, String>> map = MapBuilder.of(
            "onPress", MapBuilder.of("registrationName", "onPress"),
            "onCalloutPress", MapBuilder.of("registrationName", "onCalloutPress"),
            "onDragStart", MapBuilder.of("registrationName", "onDragStart"),
            "onDrag", MapBuilder.of("registrationName", "onDrag"),
            "onDragEnd", MapBuilder.of("registrationName", "onDragEnd")
    );

    map.putAll(MapBuilder.of(
            "onDragStart", MapBuilder.of("registrationName", "onDragStart"),
            "onDrag", MapBuilder.of("registrationName", "onDrag"),
            "onDragEnd", MapBuilder.of("registrationName", "onDragEnd")
    ));

    return map;
}
 
Example 3
@Override
@Nullable
public Map<String, Integer> getCommandsMap() {
    return MapBuilder.<String, Integer>builder()
            .put("connectToRoom", CONNECT_TO_ROOM)
            .put("disconnect", DISCONNECT)
            .put("switchCamera", SWITCH_CAMERA)
            .put("toggleVideo", TOGGLE_VIDEO)
            .put("toggleSound", TOGGLE_SOUND)
            .put("getStats", GET_STATS)
            .put("disableOpenSLES", DISABLE_OPENSL_ES)
            .put("toggleRemoteSound", TOGGLE_REMOTE_SOUND)
            .put("toggleBluetoothHeadset", TOGGLE_BLUETOOTH_HEADSET)
            .put("sendString", SEND_STRING)
            .build();
}
 
Example 4
public Map getExportedCustomBubblingEventTypeConstants() {
    return MapBuilder.builder()
            .put(
                    "onSingleTap",
                    MapBuilder.of(
                            "phasedRegistrationNames",
                            MapBuilder.of("bubbled", "onSingleTap")))
            .put(
                    "onMapDidLoad",
                    MapBuilder.of(
                            "phasedRegistrationNames",
                            MapBuilder.of("bubbled", "onMapDidLoad")))
            .put(
                    "onOverlayWasModified",
                    MapBuilder.of(
                            "phasedRegistrationNames",
                            MapBuilder.of("bubbled", "onOverlayWasModified")))
            .put(
                    "onOverlayWasAdded",
                    MapBuilder.of(
                            "phasedRegistrationNames",
                            MapBuilder.of("bubbled", "onOverlayWasAdded")))
            .put(
                    "onOverlayWasRemoved",
                    MapBuilder.of(
                            "phasedRegistrationNames",
                            MapBuilder.of("bubbled", "onOverlayWasRemoved")))
            .put(
                    "onMapMoved",
                    MapBuilder.of(
                            "phasedRegistrationNames",
                            MapBuilder.of("bubbled", "onMapMoved")))
            .build();
}
 
Example 5
Source Project: coming   Source File: ReactDrawerLayoutManager_1d0b39_s.java    License: 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 6
Source Project: react-native-pili   Source File: PiliPlayerViewManager.java    License: MIT License 5 votes vote down vote up
@Override
@Nullable
public Map getExportedCustomDirectEventTypeConstants() {
    MapBuilder.Builder builder = MapBuilder.builder();
    for (Events event : Events.values()) {
        builder.put(event.toString(), MapBuilder.of("registrationName", event.toString()));
    }
    return builder.build();
}
 
Example 7
Source Project: react-native-android-kit   Source File: TabLayoutManager.java    License: MIT License 5 votes vote down vote up
@Nullable
@Override
public Map<String, Integer> getCommandsMap() {
	return MapBuilder.of(
			"setupWithViewPager",
			COMMAND_SETUPWITHVIEWPAGER
	);
}
 
Example 8
@Nullable
@Override
public Map<String, Object> getExportedCustomDirectEventTypeConstants() {
  return MapBuilder.of(
      "onReady", MapBuilder.of("registrationName", "onReady"),
      "onError", MapBuilder.of("registrationName", "onError"),
      "onChangeState", MapBuilder.of("registrationName", "onChangeState"),
      "onChangeFullscreen", MapBuilder.of("registrationName", "onChangeFullscreen")
  );
}
 
Example 9
@Nullable
@Override
public Map<String, Integer> getCommandsMap() {
  return MapBuilder.of(
          "play", COMMAND_PLAY,
          "pause", COMMAND_PAUSE,
          "stop", COMMAND_STOP,
          "toggleSpeed", COMMAND_TOGGLE_SPEED
  );
}
 
Example 10
Source Project: react-native-image-filter-kit   Source File: ImageFilterManager.java    License: MIT License 5 votes vote down vote up
public Map<String, Object> getExportedCustomBubblingEventTypeConstants() {
  return MapBuilder.<String, Object>builder()
    .put(
      ImageFilterEvent.ON_FILTERING_START,
      MapBuilder.of(
        "phasedRegistrationNames",
        MapBuilder.of("bubbled", ImageFilterEvent.ON_FILTERING_START)
      )
    )
    .put(
      ImageFilterEvent.ON_FILTERING_FINISH,
      MapBuilder.of(
        "phasedRegistrationNames",
        MapBuilder.of("bubbled", ImageFilterEvent.ON_FILTERING_FINISH)
      )
    )
    .put(
      ImageFilterEvent.ON_FILTERING_ERROR,
      MapBuilder.of(
        "phasedRegistrationNames",
        MapBuilder.of("bubbled", ImageFilterEvent.ON_FILTERING_ERROR)
      )
    )
    .put(
      ImageFilterEvent.ON_EXTRACT_IMAGE,
      MapBuilder.of(
        "phasedRegistrationNames",
        MapBuilder.of("bubbled", ImageFilterEvent.ON_EXTRACT_IMAGE)
      )
    )
    .build();
}
 
Example 11
Source Project: react-native-video   Source File: ReactVideoViewManager.java    License: MIT License 5 votes vote down vote up
@Override
@Nullable
public Map getExportedCustomDirectEventTypeConstants() {
    MapBuilder.Builder builder = MapBuilder.builder();
    for (Events event : Events.values()) {
        builder.put(event.toString(), MapBuilder.of("registrationName", event.toString()));
    }
    return builder.build();
}
 
Example 12
Source Project: react-native-youtube   Source File: YouTubeManager.java    License: MIT License 5 votes vote down vote up
@Override
public @Nullable Map <String,Object> getExportedCustomDirectEventTypeConstants() {
    return MapBuilder.of(
        "error",
        (Object) MapBuilder.of("registrationName", "onYouTubeError"),
        "ready",
        (Object) MapBuilder.of("registrationName", "onYouTubeReady"),
        "state",
        (Object) MapBuilder.of("registrationName", "onYouTubeChangeState"),
        "quality",
        (Object) MapBuilder.of("registrationName", "onYouTubeChangeQuality"),
        "fullscreen",
        (Object) MapBuilder.of("registrationName", "onYouTubeChangeFullscreen")
    );
}
 
Example 13
@Nullable
@Override
public Map getExportedCustomDirectEventTypeConstants() {
    return MapBuilder.of(
            "topSelectionChange",
            MapBuilder.of("registrationName", "onSelectionChange")
            );
}
 
Example 14
@Override
public Map<String, Integer> getCommandsMap() {
    return MapBuilder.<String, Integer>builder()
            .put("applyFormat", COMMAND_NOTIFY_APPLY_FORMAT)
            .put("focusTextInput", mFocusTextInputCommandCode)
            .put("blurTextInput", mBlurTextInputCommandCode)
            .build();
}
 
Example 15
@Override
public @Nullable Map <String,Object> getExportedCustomDirectEventTypeConstants() {
    Map<String, Object> map = new HashMap<>();
    map.put(EVENT_READY, (Object) MapBuilder.of("registrationName", "onReady"));
    map.put(EVENT_PLAY, (Object) MapBuilder.of("registrationName", "onPlay"));
    map.put(EVENT_PAUSE, (Object) MapBuilder.of("registrationName", "onPause"));
    map.put(EVENT_END, (Object) MapBuilder.of("registrationName", "onEnd"));
    map.put(EVENT_PROGRESS, (Object) MapBuilder.of("registrationName", "onProgress"));
    map.put(EVENT_CHANGE_DURATION, (Object) MapBuilder.of("registrationName", "onChangeDuration"));
    map.put(EVENT_UPDATE_BUFFER_PROGRESS, (Object) MapBuilder.of("registrationName", "onUpdateBufferProgress"));
    map.put(EVENT_TOGGLE_ANDROID_FULLSCREEN, (Object) MapBuilder.of("registrationName", "onToggleAndroidFullscreen"));
    return map;
}
 
Example 16
Source Project: react-native-date-picker   Source File: DatePickerManager.java    License: MIT License 5 votes vote down vote up
public Map getExportedCustomBubblingEventTypeConstants() {
  return MapBuilder.builder()
          .put("dateChange", MapBuilder.of("phasedRegistrationNames",
                  MapBuilder.of("bubbled", "onChange")
                  )
          ).build();
}
 
Example 17
Source Project: react-native-rtmpview   Source File: RNRtmpViewManager.java    License: MIT License 5 votes vote down vote up
@Override
@Nullable
public Map getExportedCustomDirectEventTypeConstants() {
    MapBuilder.Builder builder = MapBuilder.builder();
    for (RNRtmpView.Events event : RNRtmpView.Events.values()) {
        builder.put(event.toString(), MapBuilder.of("registrationName", event.toString()));
    }
    return builder.build();
}
 
Example 18
Source Project: react-native-rtmpview   Source File: RNRtmpViewManager.java    License: MIT License 5 votes vote down vote up
@Override
public Map<String,Integer> getCommandsMap() {
    MapBuilder.Builder builder = MapBuilder.builder();
    for (RNRtmpView.Commands command : RNRtmpView.Commands.values()) {
        builder.put(command.toString(), command.ordinal());
    }
    return builder.build();
}
 
Example 19
@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 20
Source Project: react-native-image-zoom   Source File: ReactViewPagerManager.java    License: MIT License 5 votes vote down vote up
@Override
public Map getExportedCustomDirectEventTypeConstants() {
    return MapBuilder.of(
            PageScrollEvent.EVENT_NAME, MapBuilder.of("registrationName", "onPageScroll"),
            PageScrollStateChangedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onPageScrollStateChanged"),
            PageSelectedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onPageSelected")
    );
}
 
Example 21
Source Project: react-native-smart-barcode   Source File: RCTCaptureManager.java    License: MIT License 5 votes vote down vote up
@Override
public
@Nullable
Map<String, Integer> getCommandsMap() {
    return MapBuilder.of(
            "change",
            CHANGE_SHOW);//js处发送的方法名字
}
 
Example 22
Source Project: react-native-GPay   Source File: ReactTextInputManager.java    License: MIT License 5 votes vote down vote up
@Nullable
@Override
public Map<String, Object> getExportedCustomBubblingEventTypeConstants() {
  return MapBuilder.<String, Object>builder()
      .put(
          "topSubmitEditing",
          MapBuilder.of(
              "phasedRegistrationNames",
              MapBuilder.of(
                  "bubbled", "onSubmitEditing", "captured", "onSubmitEditingCapture")))
      .put(
          "topEndEditing",
          MapBuilder.of(
              "phasedRegistrationNames",
              MapBuilder.of("bubbled", "onEndEditing", "captured", "onEndEditingCapture")))
      .put(
          "topTextInput",
          MapBuilder.of(
              "phasedRegistrationNames",
              MapBuilder.of("bubbled", "onTextInput", "captured", "onTextInputCapture")))
      .put(
          "topFocus",
          MapBuilder.of(
              "phasedRegistrationNames",
              MapBuilder.of("bubbled", "onFocus", "captured", "onFocusCapture")))
      .put(
          "topBlur",
          MapBuilder.of(
              "phasedRegistrationNames",
              MapBuilder.of("bubbled", "onBlur", "captured", "onBlurCapture")))
      .put(
          "topKeyPress",
          MapBuilder.of(
              "phasedRegistrationNames",
              MapBuilder.of("bubbled", "onKeyPress", "captured", "onKeyPressCapture")))
      .build();
}
 
Example 23
Source Project: react-native-GPay   Source File: ReactTextInputManager.java    License: MIT License 5 votes vote down vote up
@Nullable
@Override
public Map<String, Object> getExportedCustomDirectEventTypeConstants() {
  return MapBuilder.<String, Object>builder()
      .put(ScrollEventType.getJSEventName(ScrollEventType.SCROLL), MapBuilder.of("registrationName", "onScroll"))
      .build();
}
 
Example 24
Source Project: pili-react-native   Source File: PiliStreamingViewManager.java    License: MIT License 5 votes vote down vote up
@Override
@Nullable
public Map getExportedCustomDirectEventTypeConstants() {
    MapBuilder.Builder builder = MapBuilder.builder();
    for (Events event : Events.values()) {
        builder.put(event.toString(), MapBuilder.of("registrationName", event.toString()));
    }
    return builder.build();
}
 
Example 25
Source Project: native-navigation   Source File: ScreenCoordinator.java    License: 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 26
Source Project: react-native-GPay   Source File: ReactDrawerLayoutManager.java    License: 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 27
Source Project: react-native-GPay   Source File: SwipeRefreshLayoutManager.java    License: MIT License 5 votes vote down vote up
@Nullable
@Override
public Map<String, Object> getExportedViewConstants() {
  return MapBuilder.<String, Object>of(
      "SIZE",
      MapBuilder.of("DEFAULT", SwipeRefreshLayout.DEFAULT, "LARGE", SwipeRefreshLayout.LARGE));
}
 
Example 28
Source Project: react-native-GPay   Source File: ReactModalHostManager.java    License: MIT License 5 votes vote down vote up
@Override
public Map<String, Object> getExportedCustomDirectEventTypeConstants() {
  return MapBuilder.<String, Object>builder()
    .put(RequestCloseEvent.EVENT_NAME, MapBuilder.of("registrationName", "onRequestClose"))
    .put(ShowEvent.EVENT_NAME, MapBuilder.of("registrationName", "onShow"))
    .build();
}
 
Example 29
Source Project: react-native-android-kit   Source File: TabLayoutManager.java    License: MIT License 5 votes vote down vote up
@Nullable
@Override
public Map<String, Integer> getCommandsMap() {
	return MapBuilder.of(
			"setupWithViewPager",
			COMMAND_SETUPWITHVIEWPAGER
	);
}
 
Example 30
Source Project: react-native-GPay   Source File: ReactViewPagerManager.java    License: MIT License 5 votes vote down vote up
@Override
public Map getExportedCustomDirectEventTypeConstants() {
  return MapBuilder.of(
      PageScrollEvent.EVENT_NAME, MapBuilder.of("registrationName", "onPageScroll"),
      PageScrollStateChangedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onPageScrollStateChanged"),
      PageSelectedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onPageSelected"));
}