Java 类com.facebook.react.uimanager.RootViewUtil 实例源码

项目:react-native-swipe-view    文件:SwipeView.java   
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
    int action = MotionEventCompat.getActionMasked(event);
    switch(action) {
        case (MotionEvent.ACTION_DOWN):
            initialX = event.getRawX();
            return false;
        case (MotionEvent.ACTION_MOVE) :
            float deltaX = event.getRawX() - initialX;
            boolean nowSwiping = Math.abs(deltaX) > MIN_DISABLE_SCROLL;
            if (!swiping && nowSwiping && listener != null) {
                listener.onSwipeStart();
            }

            swiping = swiping || nowSwiping;
            if(swiping) {
                RootViewUtil.getRootView(this).onChildStartedNativeGesture(event);
            }
            return swiping;
        case (MotionEvent.ACTION_UP) :
        case (MotionEvent.ACTION_CANCEL) :
        case (MotionEvent.ACTION_OUTSIDE) :
        default:
            return false;
    }
}
项目:RNLearn_Project1    文件:NativeGestureUtil.java   
/**
 * Helper method that should be called when a native view starts a native gesture (e.g. a native
 * ScrollView takes control of a gesture stream and starts scrolling). This will handle
 * dispatching the appropriate events to JS to make sure the gesture in JS is canceled.
 *
 * @param view the View starting the native gesture
 * @param event the MotionEvent that caused the gesture to be started
 */
public static void notifyNativeGestureStarted(View view, MotionEvent event) {
  RootViewUtil.getRootView(view).onChildStartedNativeGesture(event);
}
项目:RNLearn_Project1    文件:NativeGestureUtil.java   
/**
 * Helper method that should be called when a native view starts a native gesture (e.g. a native
 * ScrollView takes control of a gesture stream and starts scrolling). This will handle
 * dispatching the appropriate events to JS to make sure the gesture in JS is canceled.
 *
 * @param view the View starting the native gesture
 * @param event the MotionEvent that caused the gesture to be started
 */
public static void notifyNativeGestureStarted(View view, MotionEvent event) {
  RootViewUtil.getRootView(view).onChildStartedNativeGesture(event);
}
项目:ReactNativeSignatureExample    文件:NativeGestureUtil.java   
/**
 * Helper method that should be called when a native view starts a native gesture (e.g. a native
 * ScrollView takes control of a gesture stream and starts scrolling). This will handle
 * dispatching the appropriate events to JS to make sure the gesture in JS is canceled.
 *
 * @param view the View starting the native gesture
 * @param event the MotionEvent that caused the gesture to be started
 */
public static void notifyNativeGestureStarted(View view, MotionEvent event) {
  RootViewUtil.getRootView(view).onChildStartedNativeGesture(event);
}
项目:react-native-ibeacon-android    文件:NativeGestureUtil.java   
/**
 * Helper method that should be called when a native view starts a native gesture (e.g. a native
 * ScrollView takes control of a gesture stream and starts scrolling). This will handle
 * dispatching the appropriate events to JS to make sure the gesture in JS is canceled.
 *
 * @param view the View starting the native gesture
 * @param event the MotionEvent that caused the gesture to be started
 */
public static void notifyNativeGestureStarted(View view, MotionEvent event) {
  RootViewUtil.getRootView(view).onChildStartedNativeGesture(event);
}
项目:react-native-box-loaders    文件:NativeGestureUtil.java   
/**
 * Helper method that should be called when a native view starts a native gesture (e.g. a native
 * ScrollView takes control of a gesture stream and starts scrolling). This will handle
 * dispatching the appropriate events to JS to make sure the gesture in JS is canceled.
 *
 * @param view the View starting the native gesture
 * @param event the MotionEvent that caused the gesture to be started
 */
public static void notifyNativeGestureStarted(View view, MotionEvent event) {
  RootViewUtil.getRootView(view).onChildStartedNativeGesture(event);
}
项目:Ironman    文件:NativeGestureUtil.java   
/**
 * Helper method that should be called when a native view starts a native gesture (e.g. a native
 * ScrollView takes control of a gesture stream and starts scrolling). This will handle
 * dispatching the appropriate events to JS to make sure the gesture in JS is canceled.
 *
 * @param view the View starting the native gesture
 * @param event the MotionEvent that caused the gesture to be started
 */
public static void notifyNativeGestureStarted(View view, MotionEvent event) {
  RootViewUtil.getRootView(view).onChildStartedNativeGesture(event);
}