Skip to content Skip to sidebar Skip to footer

Android :text Animation

I am working in android.. i want to move my text in animation. this is the xml code which i am using:- android:shareInterpolator='true'>Copy

Solution 2:

you can do this by using following steps.

1.create a animation.xml

2.put this code in this animation.xml

<?xml version="1.0" encoding="utf-8"?><setxmlns:android="http://schemas.android.com/apk/res/android"android:interpolator="@android:anim/accelerate_decelerate_interpolator"android:shareInterpolator="true"><translateandroid:fromXDelta="0%"android:toXDelta="80%p"android:fromYDelta="0%"android:toYDelta="0%"android:duration="2000"/><translateandroid:fromXDelta="0%"android:toXDelta="-80%p"android:fromYDelta="0%p"android:toYDelta="80%p"android:duration="1000"android:startOffset="2000"/><translateandroid:fromXDelta="0%"android:toXDelta="80%p"android:fromYDelta="0%"android:toYDelta="0%"android:duration="2000"android:startOffset="3000"/></set>

put this file into res/anim folder of your application.

write following code for your textview on which you want to make animation.

Animationanimation= AnimationUtils.loadAnimation(this,R.anim.animation);

        animation.setAnimationListener(this);

        ViewanimatedView= findViewById(R.id.textview);

          animatedView.startAnimation(animation);

I hope now you can understand this easily .

Post a Comment for "Android :text Animation"