当前位置: 首页>>代码示例>>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;未经允许,请勿转载。