WXGesture.java 文件源码

java
阅读 38 收藏 0 点赞 0 评论 0

项目:weex-3d-map 作者:
/**
 * Create a touchObject for a pointer at a certain moment.
 * @param motionEvent motionEvent, which contains all pointers event in a period of time
 * @param pos index used to retrieve a certain moment in a period of time.
 * @param pointerIndex pointerIndex
 * @return JSONObject represent a touch event
 * @see <a href="https://developer.mozilla.org/en-US/docs/Web/API/Touch">touch</a>
 */
private JSONObject createJSONObject(MotionEvent motionEvent, int pos, int pointerIndex) {
  PointF screenXY, pageXY;
  if (pos == CUR_EVENT) {
    pageXY = getEventLocInPageCoordinate(motionEvent, pointerIndex);
    screenXY = getEventLocInScreenCoordinate(motionEvent, pointerIndex);
  } else {
    pageXY = getEventLocInPageCoordinate(motionEvent, pointerIndex, pos);
    screenXY = getEventLocInScreenCoordinate(motionEvent, pointerIndex, pos);
  }
  return createJSONObject(screenXY, pageXY, (float) motionEvent.getPointerId(pointerIndex));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号