aryaxt
aryaxt

Reputation: 77596

Android ==> Simple Animation?

How can i display a simple animation?

Let's say there is a button on the screen with margin left of 200, and margin top of 200. I need to set the margin left, and top of this button to 0 and show a simple animation.

So basically a simple animation on a button from position 200,200 to position 0,0

Upvotes: 6

Views: 4677

Answers (2)

Paresh Mayani
Paresh Mayani

Reputation: 128428

There are mainly 4 built-in Animations comes up with Android SDK:

  1. AlphaAnimation – transparency changes
  2. RotateAnimation – rotations
  3. ScaleAnimation – growing or shrinking
  4. TranslateAnimation – position changes

So from these....You can implement TranslateAnimation.

You can refer Example here and also Android SDK - TranslateAnimation .

Enjoy!!!

Upvotes: 16

CommonsWare
CommonsWare

Reputation: 1006614

Use a TranslateAnimation.

Upvotes: 3

Related Questions