This should work the way you want it.
animation.xml in / res / anim
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXScale="1"
android:toXScale="0"
android:fromYScale="1"
android:toYScale="0"
android:duration="5000"
android:pivotX="50%"
android:pivotY="50%" >
</scale>
<alpha
android:fromAlpha="1"
android:toAlpha="0"
android:duration="5000" >
</alpha>
</set>
to call this animation:
TextView textView = (TextView) findViewById(R.id.text_view);
Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.animation);
textView.startAnimation(animation);
source
share