3

Simple scenario - ScrollView hosting a single LinearLayout which has several children - the preferred pattern to allow a scroll enabled views in developing on Android.

I need to capture onScrollEvents, start, stop, etc. that are readily available and work very well if I use ListView/onScrollListener combination.

A dedicated widget for scrolling a view DOES NOT have the built-in capabilities to capture these events? Come On! I have tried OnTouchEvent listener, onGestureListener, etc - all work arounds and all meant for something else. What am I missing here?

Dzhuneyt
  • 8,437
  • 14
  • 64
  • 118
narkis
  • 335
  • 1
  • 7
  • 17
  • The exact same thing has been asked and answered before: http://stackoverflow.com/questions/8181828/android-detect-when-scrollview-stops-scrolling Basically, it's not available out of the box. – Dzhuneyt Feb 05 '14 at 14:56
  • Exactly - we should probably ask another thousand times so someone on Android dev team will hear it or at least provide a reasonable excuse. - will have to pick one of the hundreds of work-arounds, probably extending ScrollView. – narkis Feb 05 '14 at 15:20
  • possible duplicate of [Can I have onScrollListener for a ScrollView?](http://stackoverflow.com/questions/10713312/can-i-have-onscrolllistener-for-a-scrollview) – KimKha May 07 '15 at 10:47
  • Salam. This answer worked for me very good: http://stackoverflow.com/a/23365539/1676736 – Sayed Abolfazl Fatemi Aug 20 '15 at 07:07

1 Answers1

3

Unfortunately, there is no pre-built way for getting these events. However, there are two workarounds:

  • Use a ListView instead

  • Build your own custom ScrollView with ScrollListener. This is not that hard to achieve and has been done before.

Community
  • 1
  • 1
FD_
  • 12,947
  • 4
  • 35
  • 62