1

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?

Community
  • 1
  • 1
Frank
  • 12,010
  • 8
  • 61
  • 78
  • I do not think there any other solution then 1. copy scrollview and customize it, or 2. use the above solution. Both are bad in my eyes, but I do not see any other solution. – Frank May 29 '12 at 08:58

1 Answers1

0

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.

blessanm86
  • 31,439
  • 14
  • 68
  • 79
  • Thanks but the getMaxScrollAmount() never changes, if I scroll fast, far, near or slow, it's always the same number. Documentation says getMaxScrollAmount = "The maximum amount this scroll view will scroll in response to an arrow event.", and my scrolling is not always an arrow event. – Frank May 29 '12 at 08:08