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
Post a Comment