class ItemTouchEvent implements OnTouchListener {
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
// System.out.println("触摸..");
if (event.getAction() == MotionEvent.ACTION_MOVE) {
// System.out.println("MOVE"); //接触到ListView移动时
BtnCheck(0);
} else if (event.getAction() == MotionEvent.ACTION_UP) {
// System.out.println("up"); //离开ListView时
BtnCheck(currentPage);
} else if (event.getAction() == MotionEvent.ACTION_DOWN) {
// System.out.println("down"); //接触到ListView时
BtnCheck(0);
}
return false;
}
}
class LvScrollEvent implements OnScrollListener {
@Override
public void onScroll(AbsListView view, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
// TODO Auto-generated method stub
}
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
// TODO Auto-generated method stub
switch (scrollState) {
case OnScrollListener.SCROLL_STATE_IDLE: //
BtnCheck(currentPage);
// mBusy = false;
System.out.println("停止...");
break;
case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:
BtnCheck(0);
// mBusy = true;
System.out.println("正在滑动...");
break;
case OnScrollListener.SCROLL_STATE_FLING:
BtnCheck(0);
// mBusy = true;
System.out.println("开始滚动...");
break;
}
}
}
listview的监听事件
精选 转载
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
java springboot监听事件和处理事件
java springboot监听事件和处理事件
spring 自定义事件 应用程序 -
vue监听事件
input: 监听输入框的输入事件,在输入框的值发生改变时执行相关的代码。v-on:touchstart: 监听
vue.js 前端 javascript 监听事件 触摸屏