Kleptine
Kleptine

Reputation: 5085

Android: Move View after animation?

I'm trying to basically have a button move down to the bottom of the screen with an animation after it is clicked.

I have the animation working perfectly, but the button doesn't stay at the bottom of the screen after the animation finishes. I've tried using offsetTopAndBottom(), but it only stays down there for one frame, and is redrawn at the top. How can I get the button to stay?

Upvotes: 5

Views: 4821

Answers (3)

SteBra
SteBra

Reputation: 4247

Your button is not clickable because you are using View animation instead of the Property Animation. View animation only change where your View is drawn instead of really moving it to that location. Property animation does the trick.

I answered your question on another thread. You can check it out here.

Upvotes: 0

Mix
Mix

Reputation: 3211

Yes, setFillAfter(true) works.

But the strange thing is that corresponding android:fillAfter XML attribute does not provide same effect. Be aware, guys.

Upvotes: 3

Ramps
Ramps

Reputation: 5298

Did you try to call setFillAfter(true) on your animation instance?

Regards!

Upvotes: 11

Related Questions