I'm trying to do something after scrolling stopped.So, I tried using OnScrollListener#onScrollStateChanged(SCROLL_STATE_IDLE)
to detect when the scrolling stopped(either TOUCH_SCROLL or FLING
)(at 1.5 it's runs as i expect).
But when it runs on 2.0, onScrollStateChanged can't received the event after releasing the finger.Is there any callback or anyway to detect that event?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
The trick is to keep track of when the user is flinging and when they are not. It seems like this is about the only distinction you can make because, like you said, the transitions from scrolling with a finger to idle are not recorded. Here's what I'm talking about:
And then in the listView adapter:
So, instead of reacting to the change in the listener, just load the images (or whatever you need to do that's intensive) in the first place as long as there's no flinging going on.
This is all taken out of my project here: https://github.com/pkulak/mealfire_android
Try using the setOnScrollListener and implement the onScrollStateChanged with scrollState == 0 ... do what you need to do...