Falling Animation in ANDROID using Animation of Translate

Posted by Unknown Sabtu, 20 April 2013 0 komentar
Falling animation is used to bring transition to a view between two X points or two Y points. In Android, you can apply this scaling effect to almost anything, from simple text, to images, buttons, etc…

in res/anim/falling.xml
suppose if transition to be done between two different X indexes use..
 
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator">
<translate
android:fromXDelta="-100%p"
android:toXDelta="0"
android:duration="2000"/>
</set>

suppose if transition to be done between two different Y indexes use..
 
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator">
<translate
android:fromYDelta="-100%p"
android:toYDelta="0"
android:duration="2000"/>
</set> 
The java source code is given below
 
public class Textviewanimation extends Activity {
TextView tv;
Button startanimation;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_textviewanimation);

tv=(TextView) findViewById(R.id.textview);
startanimation=(Button) findViewById(R.id.button1);
tv.setText("Android is a Linux-based operating system designed primarily for touchscreen mobile devices such as smartphones and tablet computers.");

final Animation falling = AnimationUtils.loadAnimation(this,R.anim.falling);
startanimation.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
tv.startAnimation(falling);
}
}); }
}
see more :
TERIMA KASIH ATAS KUNJUNGAN SAUDARA
Judul: Falling Animation in ANDROID using Animation of Translate
Ditulis oleh Unknown
Rating Blog 5 dari 5
Semoga artikel ini bermanfaat bagi saudara. Jika ingin mengutip, baik itu sebagian atau keseluruhan dari isi artikel ini harap menyertakan link dofollow ke https://androidpopuler.blogspot.com/2013/04/falling-animation-in-android-using.html. Terima kasih sudah singgah membaca artikel ini.

0 komentar:

Posting Komentar

Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android populer.