Java 类com.facebook.react.uimanager.events.Event 实例源码

项目:RNLearn_Project1    文件:NativeAnimatedNodesManager.java   
@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();
    }
  }
}
项目:RNLearn_Project1    文件:NativeAnimatedNodesManager.java   
@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();
    }
  }
}
项目:Ironman    文件:NativeAnimatedNodesManager.java   
@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;
}
项目:RNLearn_Project1    文件:NativeAnimatedNodeTraversalTest.java   
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)));
    }
  };
}
项目:RNLearn_Project1    文件:NativeAnimatedNodeTraversalTest.java   
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)));
    }
  };
}
项目:Ironman    文件:NativeAnimatedNodeTraversalTest.java   
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)));
    }
  };
}
项目:RNLearn_Project1    文件:ReactWebViewManager.java   
private static void dispatchEvent(WebView webView, Event event) {
  ReactContext reactContext = (ReactContext) webView.getContext();
  EventDispatcher eventDispatcher =
    reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
  eventDispatcher.dispatchEvent(event);
}
项目:RNLearn_Project1    文件:ReactWebViewManager.java   
private static void dispatchEvent(WebView webView, Event event) {
  ReactContext reactContext = (ReactContext) webView.getContext();
  EventDispatcher eventDispatcher =
    reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
  eventDispatcher.dispatchEvent(event);
}
项目:ReactNativeSignatureExample    文件:ReactWebViewManager.java   
private static void dispatchEvent(WebView webView, Event event) {
  ReactContext reactContext = (ReactContext) webView.getContext();
  EventDispatcher eventDispatcher =
      reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
  eventDispatcher.dispatchEvent(event);
}
项目:react-native-ibeacon-android    文件:ReactWebViewManager.java   
private static void dispatchEvent(WebView webView, Event event) {
  ReactContext reactContext = (ReactContext) webView.getContext();
  EventDispatcher eventDispatcher =
      reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
  eventDispatcher.dispatchEvent(event);
}
项目:react-native-box-loaders    文件:ReactWebViewManager.java   
private static void dispatchEvent(WebView webView, Event event) {
  ReactContext reactContext = (ReactContext) webView.getContext();
  EventDispatcher eventDispatcher =
      reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
  eventDispatcher.dispatchEvent(event);
}
项目:Ironman    文件:ReactWebViewManager.java   
private static void dispatchEvent(WebView webView, Event event) {
  ReactContext reactContext = (ReactContext) webView.getContext();
  EventDispatcher eventDispatcher =
    reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
  eventDispatcher.dispatchEvent(event);
}
项目:react-native-x5    文件:RNX5WebViewManager.java   
private static void dispatchEvent(WebView webView, Event event) {
    ReactContext reactContext = (ReactContext) webView.getContext();
    EventDispatcher eventDispatcher =
            reactContext.getNativeModule(UIManagerModule.class).getEventDispatcher();
    eventDispatcher.dispatchEvent(event);
}