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


Java RootViewUtil类代码示例

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


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

示例1: onInterceptTouchEvent

import com.facebook.react.uimanager.RootViewUtil; //导入依赖的package包/类
@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;
    }
}
 
开发者ID:wix,项目名称:react-native-swipe-view,代码行数:27,代码来源:SwipeView.java

示例2: notifyNativeGestureStarted

import com.facebook.react.uimanager.RootViewUtil; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:12,代码来源:NativeGestureUtil.java


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