learner
learner

Reputation: 11780

detect if a touch event happens inside a shapeDrawable

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?

Upvotes: 1

Views: 1183

Answers (1)

learner
learner

Reputation: 11780

I got the answer:

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

Upvotes: 2

Related Questions