Reputation: 15
I have a rectangular Imageview that responds to touch (it rotates by a specific number of degrees, using animation). The imageview has an ontouchlistener attached to it.
However, once it has rotated, it still responds to touch only at its original (pre-rotation) location. Even though I have setfillafter to true.
My theory is that the rotation is for display purposes only... is there a way to detect a touch on a rectangular imageview rotated at an angle - e.g. 45 degrees?
Upvotes: 1
Views: 558
Reputation: 31779
When animation is applied to a view in android, only the pixels of the view are shifted while the hit area remains in the same position.
To actually move a view, you will need to add a animation listener to the view and manually change the view position on animation end.
Upvotes: 1