Looked at the android source. smoothScrollBy has a bug in it. It only reports scroll state as IDLE once its completed scrolling it never sets the state as scrolling started. So I wouldn't get a onScrollChanged callback.
Solution would be to use reflection (which I know is bad) PS: Note to self and others who lookup this issue ;) On Jul 25, 4:44 pm, photon <[email protected]> wrote: > Hi, > > I need to achieve Scenerio as in the previous > thread:http://groups.google.com/group/android-developers/browse_thread/threa... > > <pasting the same content here for convienence> > > 1) ListView has many items (i.e. scrolling will occur at some point) > 2) At the beginning, the selection is at the top (item #0) > 3) User scrolls down (i.e. we're not in touch mode) > 4) For the first items, the selection is moving down without the list > to scroll. > 5) Once the selected item is reaching the middle of the list's > viewport: the list starts to scroll-down. > 6) Then, toward the end of the list: scrolling stops and the selection > keeps moving down until the last item is reached. It's a common > feature in (keyboard-enabled) UI frameworks but I don't believe it's > possible to achieve with Android, as for now > > After fishing for answers on the internet and the android source. > Looks like Its not supported, but I did notice there are a few private > functions in ListView, (e.g. function fillFromMiddle(int, int), > fillFromSelection(int, int)) what do these do? > > I also see 'mLayoutMode = mStackFromBottom ? LAYOUT_FORCE_BOTTOM : > LAYOUT_FORCE_TOP;' on data changed function which always forces my > selected Item in the list view to be on the top. Is there a way to > change that? > > (FYI: setSelection on the listView to switch between items was too > slow for fast scrolling through a big list so I had to resort to using > scrollBy functions) > > To work around this problem. I tried to dispatch touchevents and > achieve scrolling functions like (smoothScrollBy(..) ). As my device > isn't a touch based device I DO NOT get a onSCrollStateChanged, even > though I do register onScrollListener. is there a way to work around > this? (Is there a way to fake the device to think its a touch based > device even if its not, the device I am working on is a custom device > so I can modify the platform code as well, please let me know if this > is possible) > > Also, Is there a way to enable fast scrolling programatically? > > -Photon -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

