• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java PointerEvents类的典型用法和代码示例

java 2次浏览

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

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

示例1: reactTagForTouch

点赞 3

import com.facebook.react.uimanager.PointerEvents; //导入依赖的package包/类
@Override
public int reactTagForTouch(float touchX, float touchY) {
  /*
   * Make sure we don't find any children if the pointer events are set to BOX_ONLY.
   * There is no need to special-case any other modes, because if PointerEvents are set to:
   * a) PointerEvents.AUTO - all children are included, nothing to exclude
   * b) PointerEvents.NONE - this method will NOT be executed, because the View will be filtered
   *    out by TouchTargetHelper.
   * c) PointerEvents.BOX_NONE - TouchTargetHelper will make sure that {@link #reactTagForTouch()}
   *     doesn't return getId().
   */
  SoftAssertions.assertCondition(
      mPointerEvents != PointerEvents.NONE,
      "TouchTargetHelper should not allow calling this method when pointer events are NONE");

  if (mPointerEvents != PointerEvents.BOX_ONLY) {
    NodeRegion nodeRegion = virtualNodeRegionWithinBounds(touchX, touchY);
    if (nodeRegion != null) {
      return nodeRegion.getReactTag(touchX, touchY);
    }
  }

  // no children found
  return getId();
}
 

开发者ID:qq565999484,
项目名称:RNLearn_Project1,
代码行数:26,
代码来源:FlatViewGroup.java

示例2: onInterceptTouchEvent

点赞 3

import com.facebook.react.uimanager.PointerEvents; //导入依赖的package包/类
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
  final long downTime = ev.getDownTime();
  if (downTime != mLastTouchDownTime) {
    mLastTouchDownTime = downTime;
    if (interceptsTouchEvent(ev.getX(), ev.getY())) {
      return true;
    }
  }

  if (mOnInterceptTouchEventListener != null &&
      mOnInterceptTouchEventListener.onInterceptTouchEvent(this, ev)) {
    return true;
  }
  // We intercept the touch event if the children are not supposed to receive it.
  if (mPointerEvents == PointerEvents.NONE || mPointerEvents == PointerEvents.BOX_ONLY) {
    return true;
  }
  return super.onInterceptTouchEvent(ev);
}
 

开发者ID:qq565999484,
项目名称:RNLearn_Project1,
代码行数:21,
代码来源:FlatViewGroup.java

示例3: onTouchEvent

点赞 3

import com.facebook.react.uimanager.PointerEvents; //导入依赖的package包/类
@Override
public boolean onTouchEvent(MotionEvent ev) {
  // We do not accept the touch event if this view is not supposed to receive it.
  if (mPointerEvents == PointerEvents.NONE) {
    return false;
  }

  if (mPointerEvents == PointerEvents.BOX_NONE) {
    // We cannot always return false here because some child nodes could be flatten into this View
    NodeRegion nodeRegion = virtualNodeRegionWithinBounds(ev.getX(), ev.getY());
    if (nodeRegion == null) {
      // no child to handle this touch event, bailing out.
      return false;
    }
  }

  // The root view always assumes any view that was tapped wants the touch
  // and sends the event to JS as such.
  // We don't need to do bubbling in native (it's already happening in JS).
  // For an explanation of bubbling and capturing, see
  // http://javascript.info/tutorial/bubbling-and-capturing#capturing
  return true;
}
 

开发者ID:qq565999484,
项目名称:RNLearn_Project1,
代码行数:24,
代码来源:FlatViewGroup.java

示例4: parsePointerEvents

点赞 3

import com.facebook.react.uimanager.PointerEvents; //导入依赖的package包/类
private static PointerEvents parsePointerEvents(@Nullable String pointerEventsStr) {
  if (pointerEventsStr != null) {
    switch (pointerEventsStr) {
      case "none":
        return PointerEvents.NONE;
      case "auto":
        return PointerEvents.AUTO;
      case "box-none":
        return PointerEvents.BOX_NONE;
      case "box-only":
        return PointerEvents.BOX_ONLY;
    }
  }
  // default or invalid
  return PointerEvents.AUTO;
}
 

开发者ID:qq565999484,
项目名称:RNLearn_Project1,
代码行数:17,
代码来源:RCTViewManager.java

示例5: getPointerEventsConfigForView

点赞 3

import com.facebook.react.uimanager.PointerEvents; //导入依赖的package包/类
@Override
public PointerEventsConfig getPointerEventsConfigForView(View view) {
  PointerEvents pointerEvents;
  pointerEvents = view instanceof ReactPointerEventsView ?
          ((ReactPointerEventsView) view).getPointerEvents() :
          PointerEvents.AUTO;

  // Views that are disabled should never be the target of pointer events. However, their children
  // can be because some views (SwipeRefreshLayout) use enabled but still have children that can
  // be valid targets.
  if (!view.isEnabled()) {
    if (pointerEvents == PointerEvents.AUTO) {
      return PointerEventsConfig.BOX_NONE;
    } else if (pointerEvents == PointerEvents.BOX_ONLY) {
      return PointerEventsConfig.NONE;
    }
  }

  switch (pointerEvents) {
    case BOX_ONLY: return PointerEventsConfig.BOX_ONLY;
    case BOX_NONE: return PointerEventsConfig.BOX_NONE;
    case NONE: return PointerEventsConfig.NONE;
  }

  return PointerEventsConfig.AUTO;
}
 

开发者ID:kmagiera,
项目名称:react-native-gesture-handler,
代码行数:27,
代码来源:RNViewConfigurationHelper.java

示例6: setPointerEvents

点赞 2

import com.facebook.react.uimanager.PointerEvents; //导入依赖的package包/类
@ReactProp(name = ViewProps.POINTER_EVENTS)
public void setPointerEvents(ReactViewGroup view, @Nullable String pointerEventsStr) {
  if (pointerEventsStr == null) {
    view.setPointerEvents(PointerEvents.AUTO);
  } else {
    PointerEvents pointerEvents =
        PointerEvents.valueOf(pointerEventsStr.toUpperCase(Locale.US).replace("-", "_"));
    view.setPointerEvents(pointerEvents);
  }
}
 

开发者ID:qq565999484,
项目名称:RNLearn_Project1,
代码行数:11,
代码来源:ReactViewManager.java

示例7: onInterceptTouchEvent

点赞 2

import com.facebook.react.uimanager.PointerEvents; //导入依赖的package包/类
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
  if (mOnInterceptTouchEventListener != null &&
      mOnInterceptTouchEventListener.onInterceptTouchEvent(this, ev)) {
    return true;
  }
  // We intercept the touch event if the children are not supposed to receive it.
  if (mPointerEvents == PointerEvents.NONE || mPointerEvents == PointerEvents.BOX_ONLY) {
    return true;
  }
  return super.onInterceptTouchEvent(ev);
}
 

开发者ID:qq565999484,
项目名称:RNLearn_Project1,
代码行数:13,
代码来源:ReactViewGroup.java

示例8: onTouchEvent

点赞 2

import com.facebook.react.uimanager.PointerEvents; //导入依赖的package包/类
@Override
public boolean onTouchEvent(MotionEvent ev) {
  // We do not accept the touch event if this view is not supposed to receive it.
  if (mPointerEvents == PointerEvents.NONE || mPointerEvents == PointerEvents.BOX_NONE) {
    return false;
  }
  // The root view always assumes any view that was tapped wants the touch
  // and sends the event to JS as such.
  // We don't need to do bubbling in native (it's already happening in JS).
  // For an explanation of bubbling and capturing, see
  // http://javascript.info/tutorial/bubbling-and-capturing#capturing
  return true;
}
 

开发者ID:qq565999484,
项目名称:RNLearn_Project1,
代码行数:14,
代码来源:ReactViewGroup.java

示例9: setPointerEvents

点赞 2

import com.facebook.react.uimanager.PointerEvents; //导入依赖的package包/类
@ReactProp(name = "pointerEvents")
public void setPointerEvents(ReactViewGroup view, @Nullable String pointerEventsStr) {
  if (pointerEventsStr != null) {
    PointerEvents pointerEvents =
        PointerEvents.valueOf(pointerEventsStr.toUpperCase(Locale.US).replace("-", "_"));
    view.setPointerEvents(pointerEvents);
  }
}
 

开发者ID:john1jan,
项目名称:ReactNativeSignatureExample,
代码行数:9,
代码来源:ReactViewManager.java

示例10: getPointerEvents

点赞 2

import com.facebook.react.uimanager.PointerEvents; //导入依赖的package包/类
@Override
public PointerEvents getPointerEvents() {
  return mPointerEvents;
}
 

开发者ID:qq565999484,
项目名称:RNLearn_Project1,
代码行数:5,
代码来源:FlatViewGroup.java

示例11: setPointerEvents

点赞 2

import com.facebook.react.uimanager.PointerEvents; //导入依赖的package包/类
void setPointerEvents(PointerEvents pointerEvents) {
  mPointerEvents = pointerEvents;
}
 

开发者ID:qq565999484,
项目名称:RNLearn_Project1,
代码行数:4,
代码来源:FlatViewGroup.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)