Hello Kostya, thank you very much.
That implementation boils down to linearly iterating through all children until a child is found that matches. Inside the loop, each child's getHitRect() Rect is compared to the MotionEvent's coordinates. On 10 Jan., 22:05, Kostya Vasilyev <[email protected]> wrote: > Abdull, > > Take a look at the source for ViewGroup.dispatchTouchEvent. > > http://www.netmite.com/android/mydroid/frameworks/base/core/java/andr... > > It has code to hit-test children, and it's only a few lines of code. > > ( provided you can't set click listeners on individual views, which is > the usual way to handle this ) > > -- Kostya > > 10.01.2011 23:44, Abdull пишет: > > > > > I have a ViewGroup (for instance, a RelativeLayout). This ViewGroup is > > populated with several Views (for instance, a few Buttons). > > Given a Point relative to the ViewGroup's coordinate system, I would > > like to look up the View which is located at this Point. That is, I'm > > looking for a public method with a signature similar to > > > class ViewGroup { > > ... > > public View findViewAt(int x, int y) > > ... > > } > > > Does the Android GUI Framework include such a method? I had a look in > > the API documentation but couldn't find something like this. Isn't > > this a classic feature GUI APIs usually provide? > > -- > Kostya Vasilyev -- WiFi Manager + pretty widget > --http://kmansoft.wordpress.com -- 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

