java - OnClik button set animation on another button -


this code animate button:

translateanimation animate = new translateanimation(0,0,0,view.getheight()); animate.setduration(500); animate.setfillafter(true); view.startanimation(animate); view.setvisibility(view.gone); 

and want when click on button animation start on button.

use code:

final button anotherbutton = (button) findviewbyid(/*your_another_button_id*/); view.setonclicklistener(new onclicklistener ({     @override     public void onclick(view view)      {         translateanimation animate = new translateanimation(0,0,0,anotherbutton.getheight());         animate.setduration(500);         animate.setfillafter(true);         anotherbutton.startanimation(animate);         anotherbutton.setvisibility(view.gone);     } })); 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -