how to implement fling in android listview

后端 未结 2 1697
执念已碎
执念已碎 2020-12-05 03:50

I would like to implement onfling (or some similar swipe) in listview in each and every item in list. If I swipe that particular item it should display three bu

相关标签:
2条回答
  • 2020-12-05 04:11

    Use EfficientAdapter rather than listview. Using which you can set theonFling event and override it to your needs

    0 讨论(0)
  • 2020-12-05 04:19

    I have implemented this with the help of gesture detection:

    gestureDetector = new GestureDetector(context, new MyGestureDetector());
    gestureListener = new View.OnTouchListener() {
        public boolean onTouch(View v, MotionEvent event) {
            return gestureDetector.onTouchEvent(event);
        }
    };
    mList.setOnTouchListener(gestureListener);
    
    0 讨论(0)
提交回复
热议问题