ya I was sort of expecting a similar answer. Like I said, I know we
are not supposed to nest the two. My situation is the user can can
"build" the app any way he wants, if the  main layout has items which
cannot fit in the screen the main layout scrolls both vertically and
horizontally, there is no stopping as to what goes in the app or how
they are wired, it is sort of a dynamic everything app.

I did not mention earlier, but my listview does not expand in the
infinite space provided by scrollview, the listview optimizations are
all preserved. Also, the litview scrolls horizontally also as the
contents of the rows might be longer than the LV width.  I have tried
scrolling in many ways and it 'seems' to be fine, except I cant see
the  overScrollfooter and header image, which is acceptable.

1) What does 'dragging' mean with respect to scrollViews. Does it mean
the listView/ScrollView has reached the boundary and the user is still
in the motionEvent down+move?Is that why I cant see the overScroll
images.
2) "These two simply do not play well together with touch scrolling
and other behavior" what are/is  these/this other behaviour?
3)I simply cannot find the loss in  functionality by not intercepting
touch events in the onInterceptTouchEvent()?

I can avoid all this by popping up a dialog when the user taps on a
'listView' like looking image or watever and place my list there, but
it takes away my user experience as certain selection events will not
be seamless. This will still be a LV which scrolls horizontally and
vertically. What is of most importance is the user must have a way of
placing a list insider a larger scrolling layout.

My main concern really is to make sure I am not relying on any faulty
behaviour (as I am returning false all the time from
onInterceptTouchEvent()) so that my app wont break in the future. Like
I said in my first post, I have it working and is currently in my
code, it looks neat too. I am looking for reasons to remove it.

Thanks,
vk








On Feb 18, 7:51 pm, Dianne Hackborn <hack...@android.com> wrote:
> 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 <thevk...@gmail.com> 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 android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to