简体   繁体   中英

Accelerate list scroll on swipe - Android. How to?

How to make that the faster you swipe, the faster the list scrolls? I've noticed this behavior in Instagram's list and in lists of some other applications. Also, the scroll dash bubbles vertically a bit, while it scrolls - a common behavior in those apps, which suggests that their lists are not of a custom implementation.

I couldn't achieve it with Recycler View.

How do they make it?

I'm not familiar with Instagram's scroll behaviour and if it's the same to my proposed solution, but you can give following snippet a shot:

listView.setFriction(ViewConfiguration.getScrollFriction() * 0.5);

In RecyclerView friction param is hidden in LayoutManager somewhere, if I remember correctly. Edit: This may help with ReyclerView

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM