Yes, all views are in the same activity.

The scrollview is by default returning false in the onTouchEvent()
while my custom horizontally draggable view is returning true. Inside
the onTouchEvent() in my custom draggable view, I decide whether the
user is trying to scroll vertically rather than drag horizontally. At
that point I call a method on the custom scrollview to tell it to
start returning true in the onTouchEvent(). From then on the custom
draggable view returns false. But the onTouchEvent() in the scrollview
doesn't get called until the next time the user starts a touch event
(has released touch and touches again). Programmatically calling the
scrollview's onTouchEvent() does not work.

Does this make sense now?



On Jan 1, 8:22 pm, Yang Bo <[email protected]> wrote:
> Sorry,I donnot quite get you. Are the views in the same activity?
> 在 2011-12-30 上午10:31,"Sky" <[email protected]>写道:
>
>
>
>
>
>
>
> > I have one custom made view that I can drag across the screen
> > horizontally. Within this view is a ScrollView. I already have it so I
> > can decide whether the user is dragging across the screen horizontally
> > or vertically, enabling/disabling the onTouchEvent() for the
> > appropriate views. However the newly enabled view doesn't regain
> > control until the user has released touch and presses down once more.
>
> > So I believe the onTouchEvent in the view that has current control
> > must pass off the touch event (MotionEvent) to the other view.
>
> > I have tried simply calling the onTouchEvent() as well as
> > dispatchTouchEvent.
>
> > I have tried creating the MotionEvent.ACTION_UP event for the current
> > view and then passing the MotionEvent.ACTION_DOWN followed by
> > MotionEvent.ACTION_MOVE to the view I want to gain control.
>
> > Nothing works.
>
> > Can anyone help? I hope my explanation of what I'm doing is sufficient!
>
> > --
> > 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

-- 
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

Reply via email to