detect if a touch event happens inside a shapeDrawable

1.1k views Asked by At

I am drawing a number of ShapeDrawables through a canvas in a custom android view. I have an onTouchEvent method and it's working fine. Everything is working fine. Now I want to be able to detect if a touch event intersects (i.e. happens inside) a certain ShapeDrawable. Is there a way to do that?

1

There are 1 answers

0
learner On

I got the answer:

  sd.getBounds().contains(x, y)