简体   繁体   中英

Android ScrollView detect end of/finished scroll animation

My problem is simple: I would like to detect when ScrollView ended a scroll animation.

  • We do not have access to the Scroller object of the ScrollView.
  • ScrollView.onScrollChanged is not called when it's parameters t and oldt are the same (at the end of the scroll)

The only working solution I can find is the one below, it is checking every 100 ms to see if the scroll ended, that sounds horrible to me. https://stackoverflow.com/a/10198865/1310343

Is there a more elegant solution?

Try extending the ScrollView class and override the onScrollChanged method. That should work. With the 'getMaxScrollAmount' method you should be able to find if the scrolling is done.

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