On Wed, Mar 25, 2009 at 1:35 PM, Ward Willats <goo...@wardco.com> wrote:

> Is there a framework way to "clip to region" touch events in a view?
> Or do I have to get in and muck with the dispatchTouchEvent()? (It
> gets tricky because of the overlap, the system might have given the
> event to the wrong child.)


Either that, or you can implement a custom Button subclass that implements
onTouchEvent() to ignore events that are not within some region you define.


> Also, an aside, do touch events just get shot directly by the system
> into dispatchTouchEvent()?  I don't see much of the sort of logic to
> pass events and focus changes down the view tree that you sometimes
> find in other systems.


The logic for dispatching events is in ViewGroup.  It is basically a tree
traversal, each ViewGroup deciding how to dispatch events to its immediate
children.

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