當前位置: 首頁>>代碼示例>>Java>>正文


Java MapBuilder類代碼示例

本文整理匯總了Java中com.facebook.react.common.MapBuilder的典型用法代碼示例。如果您正苦於以下問題:Java MapBuilder類的具體用法?Java MapBuilder怎麽用?Java MapBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MapBuilder類屬於com.facebook.react.common包,在下文中一共展示了MapBuilder類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getExportedCustomDirectEventTypeConstants

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@Override
@Nullable
public Map getExportedCustomDirectEventTypeConstants() {
    return MapBuilder.of(
            REACT_ON_LOAD_START_EVENT,
            MapBuilder.of("registrationName", REACT_ON_LOAD_START_EVENT),
            REACT_ON_PROGRESS_EVENT,
            MapBuilder.of("registrationName", REACT_ON_PROGRESS_EVENT),
            REACT_ON_LOAD_EVENT,
            MapBuilder.of("registrationName", REACT_ON_LOAD_EVENT),
            REACT_ON_ERROR_EVENT,
            MapBuilder.of("registrationName", REACT_ON_ERROR_EVENT),
            REACT_ON_LOAD_END_EVENT,
            MapBuilder.of("registrationName", REACT_ON_LOAD_END_EVENT)
    );
}
 
開發者ID:DylanVann,項目名稱:react-native-fast-image,代碼行數:17,代碼來源:FastImageViewManager.java

示例2: create

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
public static ReactQueueConfigurationImpl create(
    ReactQueueConfigurationSpec spec,
    QueueThreadExceptionHandler exceptionHandler) {
  Map<MessageQueueThreadSpec, MessageQueueThreadImpl> specsToThreads = MapBuilder.newHashMap();

  MessageQueueThreadSpec uiThreadSpec = MessageQueueThreadSpec.mainThreadSpec();
  MessageQueueThreadImpl uiThread =
    MessageQueueThreadImpl.create( uiThreadSpec, exceptionHandler);
  specsToThreads.put(uiThreadSpec, uiThread);

  MessageQueueThreadImpl jsThread = specsToThreads.get(spec.getJSQueueThreadSpec());
  if (jsThread == null) {
    jsThread = MessageQueueThreadImpl.create(spec.getJSQueueThreadSpec(), exceptionHandler);
  }

  MessageQueueThreadImpl nativeModulesThread =
      specsToThreads.get(spec.getNativeModulesQueueThreadSpec());
  if (nativeModulesThread == null) {
    nativeModulesThread =
        MessageQueueThreadImpl.create(spec.getNativeModulesQueueThreadSpec(), exceptionHandler);
  }

  return new ReactQueueConfigurationImpl(uiThread, nativeModulesThread, jsThread);
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:25,代碼來源:ReactQueueConfigurationImpl.java

示例3: testCustomBubblingEvents

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@Test
public void testCustomBubblingEvents() {
  ViewManager mockViewManager = mock(ViewManager.class);
  List<ViewManager> viewManagers = Arrays.asList(mockViewManager);
  when(mockViewManager.getExportedCustomBubblingEventTypeConstants())
      .thenReturn(MapBuilder.of("onTwirl", TWIRL_BUBBLING_EVENT_MAP));
  UIManagerModule uiManagerModule = new UIManagerModule(
    mReactContext,
    viewManagers,
    mUIImplementationProvider,
    false);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat((Map) constants.get(CUSTOM_BUBBLING_EVENT_TYPES))
      .contains(MapEntry.entry("onTwirl", TWIRL_BUBBLING_EVENT_MAP))
      .containsKey("topChange");
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:17,代碼來源:UIManagerModuleConstantsTest.java

示例4: testCustomDirectEvents

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@Test
public void testCustomDirectEvents() {
  ViewManager mockViewManager = mock(ViewManager.class);
  List<ViewManager> viewManagers = Arrays.asList(mockViewManager);
  when(mockViewManager.getExportedCustomDirectEventTypeConstants())
      .thenReturn(MapBuilder.of("onTwirl", TWIRL_DIRECT_EVENT_MAP));
  UIManagerModule uiManagerModule = new UIManagerModule(
    mReactContext,
    viewManagers,
    mUIImplementationProvider,
    false);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat((Map) constants.get(CUSTOM_DIRECT_EVENT_TYPES))
      .contains(MapEntry.entry("onTwirl", TWIRL_DIRECT_EVENT_MAP))
      .containsKey("topLoadingStart");
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:17,代碼來源:UIManagerModuleConstantsTest.java

示例5: testCustomViewConstants

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@Test
public void testCustomViewConstants() {
  ViewManager mockViewManager = mock(ViewManager.class);
  List<ViewManager> viewManagers = Arrays.asList(mockViewManager);
  when(mockViewManager.getName()).thenReturn("RedPandaPhotoOfTheDayView");
  when(mockViewManager.getExportedViewConstants())
      .thenReturn(MapBuilder.of("PhotoSizeType", MapBuilder.of("Small", 1, "Large", 2)));
  UIManagerModule uiManagerModule = new UIManagerModule(
    mReactContext,
    viewManagers,
    mUIImplementationProvider,
    false);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat(constants).containsKey("RedPandaPhotoOfTheDayView");
  assertThat((Map) constants.get("RedPandaPhotoOfTheDayView")).containsKey("Constants");
  assertThat((Map) valueAtPath(constants, "RedPandaPhotoOfTheDayView", "Constants"))
      .containsKey("PhotoSizeType");
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:19,代碼來源:UIManagerModuleConstantsTest.java

示例6: testNativeProps

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@Test
public void testNativeProps() {
  ViewManager mockViewManager = mock(ViewManager.class);
  List<ViewManager> viewManagers = Arrays.asList(mockViewManager);
  when(mockViewManager.getName()).thenReturn("SomeView");
  when(mockViewManager.getNativeProps())
      .thenReturn(MapBuilder.of("fooProp", "number"));
  UIManagerModule uiManagerModule = new UIManagerModule(
    mReactContext,
    viewManagers,
    mUIImplementationProvider,
    false);
  Map<String, Object> constants = uiManagerModule.getConstants();
  assertThat((String) valueAtPath(constants, "SomeView", "NativeProps", "fooProp"))
      .isEqualTo("number");
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:17,代碼來源:UIManagerModuleConstantsTest.java

示例7: getExportedCustomDirectEventTypeConstants

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@Override
public @Nullable Map<String, Object> getExportedCustomDirectEventTypeConstants() {
    MapBuilder.Builder<String, Object> builder = MapBuilder.builder();
    for (String event : VideoEventEmitter.Events) {
        builder.put(event, MapBuilder.of("registrationName", event));
    }
    return builder.build();
}
 
開發者ID:12d,項目名稱:react-native-videoplayer,代碼行數:9,代碼來源:ReactExoplayerViewManager.java

示例8: getExportedViewConstants

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@Override
public @Nullable Map<String, Object> getExportedViewConstants() {
    return MapBuilder.<String, Object>of(
            "ScaleNone", Integer.toString(ResizeMode.RESIZE_MODE_FIT),
            "ScaleAspectFit", Integer.toString(ResizeMode.RESIZE_MODE_FIT),
            "ScaleToFill", Integer.toString(ResizeMode.RESIZE_MODE_FILL),
            "ScaleAspectFill", Integer.toString(ResizeMode.RESIZE_MODE_CENTER_CROP)
    );
}
 
開發者ID:12d,項目名稱:react-native-videoplayer,代碼行數:10,代碼來源:ReactExoplayerViewManager.java

示例9: getExportedCustomDirectEventTypeConstants

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@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();
}
 
開發者ID:12d,項目名稱:react-native-videoplayer,代碼行數:10,代碼來源:ReactVideoViewManager.java

示例10: getExportedViewConstants

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@Override
@Nullable
public Map getExportedViewConstants() {
    return MapBuilder.of(
            "ScaleNone", Integer.toString(ScalableType.LEFT_TOP.ordinal()),
            "ScaleToFill", Integer.toString(ScalableType.FIT_XY.ordinal()),
            "ScaleAspectFit", Integer.toString(ScalableType.FIT_CENTER.ordinal()),
            "ScaleAspectFill", Integer.toString(ScalableType.CENTER_CROP.ordinal())
    );
}
 
開發者ID:12d,項目名稱:react-native-videoplayer,代碼行數:11,代碼來源:ReactVideoViewManager.java

示例11: getExportedCustomBubblingEventTypeConstants

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@Nullable
@Override
public Map getExportedCustomBubblingEventTypeConstants() {
  MapBuilder.Builder<String, Map> builder = MapBuilder.builder();
  for (SendEventTypes evt : SendEventTypes.values()) {
    builder.put(evt.toString(), MapBuilder.of("registrationName", evt.toString()));
  }
  Log.d(TAG, builder.toString());
  return builder.build();
}
 
開發者ID:shahen94,項目名稱:react-native-extendable-image,代碼行數:11,代碼來源:ExtendableImageManager.java

示例12: getCommandsMap

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@Nullable
@Override
public Map<String, Integer> getCommandsMap() {
  return MapBuilder.of(
          ReceiveEventTypes.ANIMATE,
          ReceiveEventTypes.ANIMATE_CODE
  );
}
 
開發者ID:shahen94,項目名稱:react-native-extendable-image,代碼行數:9,代碼來源:ExtendableImageManager.java

示例13: getExportedViewConstants

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@Nullable
@Override
public Map getExportedViewConstants() {
  return MapBuilder.of(
          "PanCenter", Integer.toString(ExtendableImage.PAN_LIMIT_CENTER),
          "PanInside", Integer.toString(ExtendableImage.PAN_LIMIT_INSIDE),
          "PanOutside", Integer.toString(ExtendableImage.PAN_LIMIT_OUTSIDE),
          "ScaleCenterCrop", Integer.toString(ExtendableImage.SCALE_TYPE_CENTER_CROP),
          "ScaleCenterInside", Integer.toString(ExtendableImage.SCALE_TYPE_CENTER_INSIDE),
          "ScaleCustom", Integer.toString(ExtendableImage.SCALE_TYPE_CUSTOM)
  );
}
 
開發者ID:shahen94,項目名稱:react-native-extendable-image,代碼行數:13,代碼來源:ExtendableImageManager.java

示例14: getExportedCustomDirectEventTypeConstants

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
public @Nullable
Map getExportedCustomDirectEventTypeConstants() {
  return MapBuilder.of(
          "onLoadError", MapBuilder.of("registrationName", "onLoadError"),
          "onLoadSuccess", MapBuilder.of("registrationName", "onLoadSuccess")
  );
}
 
開發者ID:netceteragroup,項目名稱:react-native-twitterkit,代碼行數:8,代碼來源:ReactTweetViewManager.java

示例15: getExportedCustomBubblingEventTypeConstants

import com.facebook.react.common.MapBuilder; //導入依賴的package包/類
@Nullable
@Override
public Map<String, Object> getExportedCustomBubblingEventTypeConstants() {
    return MapBuilder.<String, Object>builder()
        .put("topOffsetChanged",
            MapBuilder.of(
                "phasedRegistrationNames",
                MapBuilder.of(
                    "bubbled", "onOffsetChanged", "captured", "onOffsetChangedCapture")))
        .build();
}
 
開發者ID:cesardeazevedo,項目名稱:react-native-collapsing-toolbar,代碼行數:12,代碼來源:AppBarLayoutManager.java


注:本文中的com.facebook.react.common.MapBuilder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。