当前位置: 首页>>代码示例>>Java>>正文


Java Event类代码示例

本文整理汇总了Java中com.facebook.react.uimanager.events.Event的典型用法代码示例。如果您正苦于以下问题:Java Event类的具体用法?Java Event怎么用?Java Event使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Event类属于com.facebook.react.uimanager.events包,在下文中一共展示了Event类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onEventDispatch

import com.facebook.react.uimanager.events.Event; //导入依赖的package包/类
@Override
public void onEventDispatch(Event event) {
  // Only support events dispatched from the UI thread.
  if (!UiThreadUtil.isOnUiThread()) {
    return;
  }

  if (!mEventDrivers.isEmpty()) {
    // If the event has a different name in native convert it to it's JS name.
    String eventName = event.getEventName();
    Map<String, String> customEventType = mCustomEventTypes.get(eventName);
    if (customEventType != null) {
      eventName = customEventType.get("registrationName");
    }

    List<EventAnimationDriver> driversForKey = mEventDrivers.get(event.getViewTag() + eventName);
    if (driversForKey != null) {
      for (EventAnimationDriver driver : driversForKey) {
        event.dispatch(driver);
        mRunUpdateNodeList.add(driver.mValueNode);
      }
      updateNodes(mRunUpdateNodeList);
      mRunUpdateNodeList.clear();
    }
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:27,代码来源:NativeAnimatedNodesManager.java

示例2: onEventDispatch

import com.facebook.react.uimanager.events.Event; //导入依赖的package包/类
@Override
public boolean onEventDispatch(Event event) {
  // Only support events dispatched from the UI thread.
  if (!UiThreadUtil.isOnUiThread()) {
    return false;
  }

  if (!mEventDrivers.isEmpty()) {
    // If the event has a different name in native convert it to it's JS name.
    String eventName = event.getEventName();
    Map<String, String> customEventType = mCustomEventTypes.get(eventName);
    if (customEventType != null) {
      eventName = customEventType.get("registrationName");
    }

    EventAnimationDriver eventDriver = mEventDrivers.get(event.getViewTag() + eventName);
    if (eventDriver != null) {
      event.dispatch(eventDriver);
      mUpdatedNodes.add(eventDriver.mValueNode);
      return true;
    }
  }

  return false;
}
 
开发者ID:Right-Men,项目名称:Ironman,代码行数:26,代码来源:NativeAnimatedNodesManager.java

示例3: createScrollEvent

import com.facebook.react.uimanager.events.Event; //导入依赖的package包/类
private Event createScrollEvent(final int tag, final double value) {
  return new Event(tag) {
    @Override
    public String getEventName() {
      return "topScroll";
    }

    @Override
    public void dispatch(RCTEventEmitter rctEventEmitter) {
      rctEventEmitter.receiveEvent(tag, "topScroll", JavaOnlyMap.of(
        "contentOffset", JavaOnlyMap.of("y", value)));
    }
  };
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:15,代码来源:NativeAnimatedNodeTraversalTest.java

示例4: dispatchEvent

import com.facebook.react.uimanager.events.Event; //导入依赖的package包/类
private static void dispatchEvent(WebView webView, Event event) {
  ReactContext reactContext = (ReactContext) webView.getContext();
  EventDispatcher eventDispatcher =
    reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
  eventDispatcher.dispatchEvent(event);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:7,代码来源:ReactWebViewManager.java

示例5: dispatchEvent

import com.facebook.react.uimanager.events.Event; //导入依赖的package包/类
private static void dispatchEvent(WebView webView, Event event) {
  ReactContext reactContext = (ReactContext) webView.getContext();
  EventDispatcher eventDispatcher =
      reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
  eventDispatcher.dispatchEvent(event);
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:7,代码来源:ReactWebViewManager.java

示例6: dispatchEvent

import com.facebook.react.uimanager.events.Event; //导入依赖的package包/类
private static void dispatchEvent(WebView webView, Event event) {
    ReactContext reactContext = (ReactContext) webView.getContext();
    EventDispatcher eventDispatcher =
            reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
    eventDispatcher.dispatchEvent(event);
}
 
开发者ID:shimohq,项目名称:react-native-x5,代码行数:7,代码来源:RNX5WebViewManager.java


注:本文中的com.facebook.react.uimanager.events.Event类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。