views:

52

answers:

1

I have a simple LinearLayout with two Buttons side by side. They are supposed to slide into and out of view from the right side of the screen when needed. I have the animation working and the rest of the work is done, but I have one last problem to solve.

How can I set the LinearLayout's visibility to View.GONE after the slide out animation is complete? I need it to disappear once it's of screen.

+2  A: 

Grab a reference of your Animation object doing the animation. Call Animation#setAnimationListener and in the listener's onAnimationEnd method set the visibility to View.GONE.

Qberticus