Scale Animation in android

deepak - Mon Jan 23 2012 17:42:39 GMT-0500 (EST)

Scale Animation in android

Scale Animation in android

Search for: Scale Animation in android

deepak - Mon Jan 23 2012 18:47:48 GMT-0500 (EST)

Here are the steps


1) Create an xml in the res/anim folder to have the scale configs.

2) Use the below configuration. 

<?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"
 android:fromXScale="2" android:toXScale="1" android:fromYScale="2"
 android:toYScale="1" android:pivotX="50%" android:pivotY="50%"
 android:duration="100" />

3) Use the below code in java to start the animation

Animation logoMoveAnimation = 
AnimationUtils.loadAnimation(view.getContext(), R.anim.scale);
         button.startAnimation(logoMoveAnimation);

deepak - Mon Jan 23 2012 19:05:07 GMT-0500 (EST)

SDK reference

SDK reference

deepak - Mon Jan 23 2012 19:07:18 GMT-0500 (EST)

Good article on Animation Part 1

Good article on Animation Part 1

deepak - Mon Jan 23 2012 19:07:49 GMT-0500 (EST)

Good article on Animation Part 2

Good article on Animation Part 2