Scaling Animation In ANDROID

Posted by Unknown Jumat, 19 April 2013 0 komentar
Scaling animation is used to scale a view. In Android, you can apply this scaling effect to almost anything, from simple text, to images, buttons, etc…

 Here simply I will explain a scaling textview which you can apply to other views also... In res/anim/scale.xml
 
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator">
<scale
android:fromXScale="0.0"
android:toXScale="1.0"
android:fromYScale="0.0"
android:toYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:duration="2000" />
</set>
Java source code is given below
 
public class Textviewanimation extends Activity {
Animation fadeIn,fadeOut;
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("This is an animated textview");

final Animation Scale = AnimationUtils.loadAnimation(this,R.anim.scale);
startanimation.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
tv.startAnimation(Scale);
}
}); }
}
see more: 
TERIMA KASIH ATAS KUNJUNGAN SAUDARA
Judul: Scaling Animation In ANDROID
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/scaling-animation-in-android.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.