public abstract booleanonScroll(MotionEvente1,MotionEvente2, float distanceX, float distanceY)

Since: API Level 1

Notified when a scroll occurs with the initial on downMotionEventand the current moveMotionEvent. The distance in x and y is also supplied for convenience.

Parameters
e1 The first down motion event that started the scrolling.
e2 The move motion event that triggered the current onScroll.
distanceX The distance along the X axis that has been scrolled since the last call to onScroll. This is NOT the distance betweene1ande2.
distanceY The distance along the Y axis that has been scrolled since the last call to onScroll. This is NOT the distance betweene1ande2.
Returns
  • true if the event is consumed, else false
e1 初次触控地图的event1 e2 每次触发onScroll函数得到的的event2 distance是上一次的event2减去 当前event2得到的结果 //注意到顺序 lastEvent2 - event2 = distance
验证:
if (lastE2 != null){    Log.i(TAG, "distanceX:" + distanceX + " = " + (lastE2.getX()-e2.getX()));    Log.i(TAG, "distanceY:" + distanceY + " = " + (lastE2.getY()-e2.getY()));}lastE2 = MotionEvent.obtain(e2);


更多相关文章

  1. Android下openGL操作矩阵的函数
  2. Android中常用的函数
  3. Android下intent的setdata、settype和setdataandtype函数
  4. C基础—函数指针,联合体,枚举,结构体和结构体指针
  5. OpenCV 的 RGB 顺序和 Android 载入的 RGB 顺序相反
  6. Android的按钮监听事件&自定义回调函数
  7. android JNI层线程回调Java函数
  8. 硬件访问服务4之Android硬件访问服务框架及系统函数全详细实现
  9. 重载android返回键响应函数

随机推荐

  1. Android屏幕方向及键盘状态
  2. HTTP 工具类 封装 For android
  3. android技术博客汇总
  4. android 写入data/data/包名/file/中
  5. MySQL对window函数执行sum函数可能出现的
  6. MySQL如何使用授权命令grant
  7. 一篇文章掌握MySQL的索引查询优化技巧
  8. 浅析mysql 定时备份任务
  9. 删除mysql服务的具体方法
  10. mysql数据存放的位置在哪