I want to make a Drawable touchable for a component I am creating, does anyone know how to do that?
final Drawable selected = backgroundSelected;
selected.setBounds(0, 0, 20, 90);
selected.draw(canvas);
canvas.save();
I want to make a Drawable touchable for a component I am creating, does anyone know how to do that?
final Drawable selected = backgroundSelected;
selected.setBounds(0, 0, 20, 90);
selected.draw(canvas);
canvas.save();
You cannot do this directly. You need a View to capture touch events.
Solved it by using an onTouch event, and then checking the coordinates of the touch against the coordinates of the Drawable.