I know you say you don't want to hear this, but seriously: don't do this. These two simply do not play well together with touch scrolling and other behavior.
On Fri, Feb 18, 2011 at 1:31 PM, AUandroid <[email protected]> wrote: > I know that we are not supposed to put a listView inside of a > scrollView. The layout and nesting of my apps views are determined > at run time and I have no control over that.My situation demands it > and I have a working implementation to achieve that. However I am not > sure what exactly is happening in onInterceptTouchEvent(). > > I am returning false from onTouchEvent() ,of scrollView, if the > MotionEvent occurred within the bounds of the listView, thus the event > is passed down to my listView to handle. So if I touch and drag > outside the listView my outer scrollView scrolls, else if I touch and > drag on the listView, the listView scrolls. They dont compete for > scrolling anymore. This is all possible only if I always return false > from the onInterceptTouchEvent() of the scrollView. In the default > implementation it returns true if it is being dragged. My solution > breaks if I return true from here for any condition. Is it ok to > simply return false all the time from onInterceptTouchEvent()? I have > tried scrolling in several ways and both the scrollview and the > listView are scrolling as expected when I return false. > > A standalone listView also works fine when I simply return false from > its onInterceptTouchEvent() instead of returning super(AbsListView). > onInterceptTouchEvent() > > Anyone has any scenario when the scrolling might not work? > > thanks, > vk > > -- > 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 > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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

