开发者

how to implement fling in android listview

开发者 https://www.devze.com 2023-01-21 08:50 出处:网络
I would like to implement onfling (or some similar swipe) in listview in each and every item in list. If I swipe that part开发者_如何学Goicular item it should display three buttons next to the name.

I would like to implement onfling (or some similar swipe) in listview in each and every item in list. If I swipe that part开发者_如何学Goicular item it should display three buttons next to the name.

Is there any idea to implement this.


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);


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

0

精彩评论

暂无评论...
验证码 换一张
取 消