• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TouchEventType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: dispatchCancelEvent

import com.facebook.react.uimanager.events.TouchEventType; //导入依赖的package包/类
private void dispatchCancelEvent(MotionEvent androidEvent, EventDispatcher eventDispatcher) {
  // This means the gesture has already ended, via some other CANCEL or UP event. This is not
  // expected to happen very often as it would mean some child View has decided to intercept the
  // touch stream and start a native gesture only upon receiving the UP/CANCEL event.
  if (mTargetTag == -1) {
    FLog.w(
      ReactConstants.TAG,
      "Can't cancel already finished gesture. Is a child View trying to start a gesture from " +
        "an UP/CANCEL event?");
    return;
  }

  Assertions.assertCondition(
    !mChildIsHandlingNativeGesture,
    "Expected to not have already sent a cancel for this gesture");
  Assertions.assertNotNull(eventDispatcher).dispatchEvent(
    TouchEvent.obtain(
      mTargetTag,
      TouchEventType.CANCEL,
      androidEvent,
      mGestureStartTime,
      mTargetCoordinates[0],
      mTargetCoordinates[1],
      mTouchEventCoalescingKeyHelper));
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:26,代码来源:JSTouchDispatcher.java


示例2: dispatchCancelEvent

import com.facebook.react.uimanager.events.TouchEventType; //导入依赖的package包/类
private void dispatchCancelEvent(MotionEvent androidEvent, EventDispatcher eventDispatcher) {
  // This means the gesture has already ended, via some other CANCEL or UP event. This is not
  // expected to happen very often as it would mean some child View has decided to intercept the
  // touch stream and start a native gesture only upon receiving the UP/CANCEL event.
  if (mTargetTag == -1) {
    FLog.w(
      ReactConstants.TAG,
      "Can't cancel already finished gesture. Is a child View trying to start a gesture from " +
        "an UP/CANCEL event?");
    return;
  }

  Assertions.assertCondition(
    !mChildIsHandlingNativeGesture,
    "Expected to not have already sent a cancel for this gesture");
  Assertions.assertNotNull(eventDispatcher).dispatchEvent(
    TouchEvent.obtain(
      mTargetTag,
      SystemClock.nanoTime(),
      TouchEventType.CANCEL,
      androidEvent,
      mTargetCoordinates[0],
      mTargetCoordinates[1]));
}
 
开发者ID:ManrajGrover,项目名称:react-native-box-loaders,代码行数:25,代码来源:JSTouchDispatcher.java


示例3: dispatchCancelEvent

import com.facebook.react.uimanager.events.TouchEventType; //导入依赖的package包/类
private void dispatchCancelEvent(MotionEvent androidEvent, EventDispatcher eventDispatcher) {
  // This means the gesture has already ended, via some other CANCEL or UP event. This is not
  // expected to happen very often as it would mean some child View has decided to intercept the
  // touch stream and start a native gesture only upon receiving the UP/CANCEL event.
  if (mTargetTag == -1) {
    FLog.w(
      ReactConstants.TAG,
      "Can't cancel already finished gesture. Is a child View trying to start a gesture from " +
        "an UP/CANCEL event?");
    return;
  }

  Assertions.assertCondition(
    !mChildIsHandlingNativeGesture,
    "Expected to not have already sent a cancel for this gesture");
  Assertions.assertNotNull(eventDispatcher).dispatchEvent(
    TouchEvent.obtain(
      mTargetTag,
      TouchEventType.CANCEL,
      androidEvent,
      mTargetCoordinates[0],
      mTargetCoordinates[1],
      mTouchEventCoalescingKeyHelper));
}
 
开发者ID:Right-Men,项目名称:Ironman,代码行数:25,代码来源:JSTouchDispatcher.java


示例4: dispatchCancelEvent

import com.facebook.react.uimanager.events.TouchEventType; //导入依赖的package包/类
private void dispatchCancelEvent(MotionEvent androidEvent) {
  // This means the gesture has already ended, via some other CANCEL or UP event. This is not
  // expected to happen very often as it would mean some child View has decided to intercept the
  // touch stream and start a native gesture only upon receiving the UP/CANCEL event.
  if (mTargetTag == -1) {
    FLog.w(
        ReactConstants.TAG,
        "Can't cancel already finished gesture. Is a child View trying to start a gesture from " +
            "an UP/CANCEL event?");
    return;
  }

  EventDispatcher eventDispatcher = mReactInstanceManager.getCurrentReactContext()
      .getNativeModule(UIManagerModule.class)
      .getEventDispatcher();

  Assertions.assertCondition(
      !mChildIsHandlingNativeGesture,
      "Expected to not have already sent a cancel for this gesture");
  Assertions.assertNotNull(eventDispatcher).dispatchEvent(
      TouchEvent.obtain(
          mTargetTag,
          SystemClock.nanoTime(),
          TouchEventType.CANCEL,
          androidEvent,
          mTargetCoordinates[0],
          mTargetCoordinates[1]));
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:29,代码来源:ReactRootView.java


示例5: dispatch

import com.facebook.react.uimanager.events.TouchEventType; //导入依赖的package包/类
private void dispatch(MotionEvent ev, TouchEventType type) {
    ev.offsetLocation(getAbsoluteLeft(this), getAbsoluteTop(this));
    mEventDispatcher.dispatchEvent(
        TouchEvent.obtain(
            mTargetTag,
            type,
            ev,
            mGestureStartTime,
            ev.getX(),
            ev.getY(),
            mTouchEventCoalescingKeyHelper));
}
 
开发者ID:react-native-community,项目名称:react-native-svg,代码行数:13,代码来源:SvgView.java


示例6: handleTouchEvent

import com.facebook.react.uimanager.events.TouchEventType; //导入依赖的package包/类
private void handleTouchEvent(MotionEvent ev) {
    int action = ev.getAction() & MotionEvent.ACTION_MASK;
    if (action == MotionEvent.ACTION_DOWN) {
        mGestureStartTime = ev.getEventTime();
        dispatch(ev, TouchEventType.START);
    } else if (mTargetTag == -1) {
        // All the subsequent action types are expected to be called after ACTION_DOWN thus target
        // is supposed to be set for them.
        Log.e(
            "error",
            "Unexpected state: received touch event but didn't get starting ACTION_DOWN for this " +
                "gesture before");
    } else if (action == MotionEvent.ACTION_UP) {
        // End of the gesture. We reset target tag to -1 and expect no further event associated with
        // this gesture.
        dispatch(ev, TouchEventType.END);
        mTargetTag = -1;
        mGestureStartTime = TouchEvent.UNSET;
    } else if (action == MotionEvent.ACTION_MOVE) {
        // Update pointer position for current gesture
        dispatch(ev, TouchEventType.MOVE);
    } else if (action == MotionEvent.ACTION_POINTER_DOWN) {
        // New pointer goes down, this can only happen after ACTION_DOWN is sent for the first pointer
        dispatch(ev, TouchEventType.START);
    } else if (action == MotionEvent.ACTION_POINTER_UP) {
        // Exactly onw of the pointers goes up
        dispatch(ev, TouchEventType.END);
    } else if (action == MotionEvent.ACTION_CANCEL) {
        dispatchCancelEvent(ev);
        mTargetTag = -1;
        mGestureStartTime = TouchEvent.UNSET;
    } else {
        Log.w(
            "IGNORE",
            "Warning : touch event was ignored. Action=" + action + " Target=" + mTargetTag);
    }
}
 
开发者ID:react-native-community,项目名称:react-native-svg,代码行数:38,代码来源:SvgView.java


示例7: dispatchCancelEvent

import com.facebook.react.uimanager.events.TouchEventType; //导入依赖的package包/类
private void dispatchCancelEvent(MotionEvent ev) {
    // This means the gesture has already ended, via some other CANCEL or UP event. This is not
    // expected to happen very often as it would mean some child View has decided to intercept the
    // touch stream and start a native gesture only upon receiving the UP/CANCEL event.
    if (mTargetTag == -1) {
        Log.w(
            "error",
            "Can't cancel already finished gesture. Is a child View trying to start a gesture from " +
                "an UP/CANCEL event?");
        return;
    }

    dispatch(ev, TouchEventType.CANCEL);
}
 
开发者ID:react-native-community,项目名称:react-native-svg,代码行数:15,代码来源:SvgView.java


示例8: getBubblingEventTypeConstants

import com.facebook.react.uimanager.events.TouchEventType; //导入依赖的package包/类
static Map getBubblingEventTypeConstants() {
  return MapBuilder.builder()
      .put(
          "topChange",
          MapBuilder.of(
              "phasedRegistrationNames",
              MapBuilder.of("bubbled", "onChange", "captured", "onChangeCapture")))
      .put(
          "topSelect",
          MapBuilder.of(
              "phasedRegistrationNames",
              MapBuilder.of("bubbled", "onSelect", "captured", "onSelectCapture")))
      .put(
          TouchEventType.START.getJSEventName(),
          MapBuilder.of(
              "phasedRegistrationNames",
              MapBuilder.of(
                  "bubbled",
                  "onTouchStart",
                  "captured",
                  "onTouchStartCapture")))
      .put(
          TouchEventType.MOVE.getJSEventName(),
          MapBuilder.of(
              "phasedRegistrationNames",
              MapBuilder.of(
                  "bubbled",
                  "onTouchMove",
                  "captured",
                  "onTouchMoveCapture")))
      .put(
          TouchEventType.END.getJSEventName(),
          MapBuilder.of(
              "phasedRegistrationNames",
              MapBuilder.of(
                  "bubbled",
                  "onTouchEnd",
                  "captured",
                  "onTouchEndCapture")))
      .build();
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:42,代码来源:UIManagerModuleConstants.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UsernameNotFoundException类代码示例发布时间:2022-05-22
下一篇:
Java DerivedDbTable类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap