5

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?

Richard Ev
  • 52,939
  • 59
  • 191
  • 278
Kleptine
  • 5,089
  • 16
  • 58
  • 81

3 Answers3

11

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

Regards!

Richard Ev
  • 52,939
  • 59
  • 191
  • 278
Ramps
  • 5,190
  • 1
  • 45
  • 47
  • 1
    Adding that didn't work. It seems like this should be an easy problem to fix, I can't imagine how anyone could do any animation without solving this problem. – Kleptine Jan 17 '10 at 23:44
  • 1
    ... and did you call setFillEnabled(true) before setFillAfter(true)? – Ramps Jan 18 '10 at 11:38
  • Haha, it actually did work, I was calling it on the wrong object though. :P Anyways, thanks. – Kleptine Jan 24 '10 at 04:06
3

Yes, setFillAfter(true) works.

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

Richard Ev
  • 52,939
  • 59
  • 191
  • 278
Mix
  • 3,081
  • 2
  • 17
  • 14
0

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.

Community
  • 1
  • 1
SteBra
  • 4,188
  • 6
  • 37
  • 68