switch (action) {
case MotionEventACTION_DOWN:
DownX = eventgetX();//float DownX
DownY = eventgetY();//float DownY
currentMS = SystemcurrentTimeMillis();//long currentMS 获取系统时间
break;
case MotionEventACTION_MOVE:
float moveX = eventgetX() - DownX;//X轴距离
float moveY = eventgetY() - DownY;//y轴距离
long moveTime = SystemcurrentTimeMillis() - currentMS搜索;//移动时间
break;
case MotionEventACTION_UP:
break;
switch (action) {
case MotionEventACTION_DOWN:
DownX = eventgetX();//float DownX
DownY = eventgetY();//float DownY
currentMS = SystemcurrentTimeMillis();//long currentMS 获取系统时间
break;
case MotionEventACTION_MOVE:
float moveX = eventgetX() - DownX;//X轴距离
float moveY = eventgetY() - DownY;//y轴距离
long moveTime = SystemcurrentTimeMillis() - currentMS搜索;//移动时间
break;
case MotionEventACTION_UP:
break;
}
>
以上就是关于如何获取 RecyclerView 的滑动距离全部的内容,包括:如何获取 RecyclerView 的滑动距离、Android 如何获取手在屏幕上滑动的距离、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)