I overridden ScrollView to pass the MotionEvent to the GestureDetector to detect transition events on the ScrollView. I need to determine when the scroll stops. This is not the MotionEvent.ACTION_UP with the MotionEvent.ACTION_UP event, because it usually happens at the beginning of fling gestures, followed by a flurry of onScrollChanged() calls in ScrollView.
So, basically we are dealing with the following events:
- onFling
- onScrollChanged, onScrollChanged, onScrollChanged, ..., onScrollChanged
There is no callback when the onScrollChanged event occurs. I was thinking of posting a message to the event queue using Handler during onFling and waiting for Runnable to complete, indicating that the transition was completed, unfortunately, it fires after the first call to onScrollChanged.
Any other ideas?
android android-scrollview onfling
Christopher perry
source share