I am trying to make my list a bounce. To explain myself, I want ListView to have the same behavior as an iOs object view object. At the top and bottom of the list, the user can scroll through the list by checking his finger.
This behavior existed on Samsung Android 2.2 devices (e.g. Galaxy Tab GT1000).
On most tested devices, the list now works differently when scrolling, it displays a blue line, which becomes brighter when you swipe your finger.
I found a BounceListView like this:
public class BounceListView extends ListView { private static final int MAX_Y_OVERSCROLL_DISTANCE = 200; private Context mContext; private int mMaxYOverscrollDistance; public BounceListView(Context context) { super(context); mContext = context; initBounceListView(); } public BounceListView(Context context, AttributeSet attrs) { super(context, attrs); mContext = context; initBounceListView(); } public BounceListView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mContext = context; initBounceListView(); } private void initBounceListView() {
But the problem with this ListView is that it does not return to the first or last item after scrolling through the list ... It remains in the position where the list does not fill.
Does anyone have an idea to make it work?
Thanks in advance!
source share