0

I've created a RelativeLayout that contain 4 buttons positioned like a circle. I've given rotate animation to the layout, also OnClickListeners on these buttons. But when i run the code the OnClickListener works only from the button's initial position. That is, suppose the layout rotate 90 degrees, the button comes to a new position. But clicking on that position doesnt do any thing instead I need to click at the position where it was initially, to activate ONClickListener for that button. Is there any way to set OnClickListener for the same position as it is displayed?

explained in this pic :

https://i.stack.imgur.com/RFlLh.png

akhil007
  • 13
  • 1
  • 1
  • 4

1 Answers1

0

use property animation instead of view animation according to google doc

view animation system is that it only modified where the View was drawn, and not the actual View itself. For instance, if you animated a button to move across the screen, the button draws correctly, but the actual location where you can click the button does not change, so you have to implement your own logic to handle this.

http://developer.android.com/guide/topics/graphics/prop-animation.html#property-vs-view

mcd
  • 1,434
  • 15
  • 31