Hi
if you want to use animation at every where either button or image etc any one element of ui part
there are as following below details :-
xml Activity:-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Button
android:id="@+id/btn1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Translate" />
<Button
android:id="@+id/btn2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Alpha" />
<Button
android:id="@+id/btn3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="scale" />
<Button
android:id="@+id/btn4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Rootate" />
<Button
android:id="@+id/btnFadeIn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="FadeIn" />
<Button
android:id="@+id/btnFadeOut"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Fade Out" />
<Button
android:id="@+id/btnCrossFading"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Cross Fading" />
<Button
android:id="@+id/btnBlink"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Blink" />
<Button
android:id="@+id/btnZoomIn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Zoom In" />
<Button
android:id="@+id/btnZoomOut"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Zoom Out" />
<Button
android:id="@+id/btnRotate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Rotate" />
<Button
android:id="@+id/btnMove"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Move" />
<Button
android:id="@+id/btnSlideUp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Slide Up" />
<Button
android:id="@+id/btnSlideDown"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Slide Down" />
<Button
android:id="@+id/btnBounce"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Bounce" />
<Button
android:id="@+id/btnSequentialAnimation"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Sequential Animation" />
<Button
android:id="@+id/btnTogetherAnimation"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Together Animation" />
</LinearLayout>
</ScrollView>
</LinearLayout>
.class file:-
public class MainActivity extends Activity {
Button btn1,btn2,btn3,btn4,btnFadeIn,btnFadeOut,btnCrossFading,btnBlink,btnZoomIn,btnZoomOut,
btnRotate,btnMove,btnSlideUp,btnSlideDown,btnBounce,btnSequentialAnimation,btnTogetherAnimation;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn1=(Button)findViewById(R.id.btn1);
btn2=(Button)findViewById(R.id.btn2);
btn3=(Button)findViewById(R.id.btn3);
btn4=(Button)findViewById(R.id.btn4);
btnFadeIn=(Button)findViewById(R.id.btnFadeIn);
btnFadeOut=(Button)findViewById(R.id.btnFadeOut);
btnCrossFading=(Button)findViewById(R.id.btnCrossFading);
btnBlink=(Button)findViewById(R.id.btnBlink);
btnZoomIn=(Button)findViewById(R.id.btnZoomIn);
btnZoomOut=(Button)findViewById(R.id.btnZoomOut);
btnRotate=(Button)findViewById(R.id.btnRotate);
btnMove=(Button)findViewById(R.id.btnMove);
btnSlideUp=(Button)findViewById(R.id.btnSlideUp);
btnSlideDown=(Button)findViewById(R.id.btnSlideDown);
btnBounce=(Button)findViewById(R.id.btnBounce);
btnSequentialAnimation=(Button)findViewById(R.id.btnSequentialAnimation);
btnTogetherAnimation=(Button)findViewById(R.id.btnTogetherAnimation);
final Animation animTranslate=AnimationUtils.loadAnimation(this,R.drawable.translate);
final Animation animAlpha=AnimationUtils.loadAnimation(this, R.drawable.alpha);
final Animation animscale=AnimationUtils.loadAnimation(this,R.drawable.scale);
final Animation animRotate=AnimationUtils.loadAnimation(this, R.drawable.rotate);
final Animation animbtnFadeIn=AnimationUtils.loadAnimation(this,R.drawable.fade_in);
final Animation animbtnFadeOut=AnimationUtils.loadAnimation(this,R.drawable.fade_out);
final Animation animbtnBlink=AnimationUtils.loadAnimation(this,R.drawable.blink);
final Animation animbtnZoomIn=AnimationUtils.loadAnimation(this,R.drawable.zoom_in);
final Animation animbtnZoomOut=AnimationUtils.loadAnimation(this,R.drawable.zoom_out);
final Animation animbtnRotate=AnimationUtils.loadAnimation(this,R.drawable.rotate);
final Animation animbtnMove=AnimationUtils.loadAnimation(this,R.drawable.move);
final Animation animbtnSlideUp=AnimationUtils.loadAnimation(this,R.drawable.slide_up);
final Animation animbtnSlideDown=AnimationUtils.loadAnimation(this,R.drawable.slide_down);
final Animation animbtnBounce=AnimationUtils.loadAnimation(this,R.drawable.bounce);
final Animation animbtnSequentialAnimation=AnimationUtils.loadAnimation(this,R.drawable.sequential_animation);
final Animation animbtnTogetherAnimation=AnimationUtils.loadAnimation(this,R.drawable.together_animation);
btn1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animTranslate);
}
});
btn2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animAlpha);
}
});
btn3.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animscale);
}
});
btn4.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animRotate);
}
});
btnFadeIn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnFadeIn);
}
});
btnFadeOut.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnFadeOut);
}
});
btnBlink.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnBlink);
}
});
btnZoomIn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnZoomIn);
}
});
btnZoomOut.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnZoomOut);
}
});
btnRotate.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnRotate);
}
});
btnMove.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnMove);
}
});
btnSlideUp.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnSlideUp);
}
});
btnSlideDown.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnSlideDown);
}
});
btnBounce.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnBounce);
}
});
btnSequentialAnimation.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnSequentialAnimation);
}
});
btnTogetherAnimation.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnTogetherAnimation);
}
});
}
}
after that create drawable folder inside of res folder
then make then make
1:- alpha.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator">
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.1"
android:duration="500"
android:repeatCount="1"
android:repeatMode="reverse" />
</set>
if you want to use animation at every where either button or image etc any one element of ui part
there are as following below details :-
xml Activity:-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Button
android:id="@+id/btn1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Translate" />
<Button
android:id="@+id/btn2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Alpha" />
<Button
android:id="@+id/btn3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="scale" />
<Button
android:id="@+id/btn4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Rootate" />
<Button
android:id="@+id/btnFadeIn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="FadeIn" />
<Button
android:id="@+id/btnFadeOut"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Fade Out" />
<Button
android:id="@+id/btnCrossFading"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Cross Fading" />
<Button
android:id="@+id/btnBlink"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Blink" />
<Button
android:id="@+id/btnZoomIn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Zoom In" />
<Button
android:id="@+id/btnZoomOut"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Zoom Out" />
<Button
android:id="@+id/btnRotate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Rotate" />
<Button
android:id="@+id/btnMove"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Move" />
<Button
android:id="@+id/btnSlideUp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Slide Up" />
<Button
android:id="@+id/btnSlideDown"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Slide Down" />
<Button
android:id="@+id/btnBounce"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Bounce" />
<Button
android:id="@+id/btnSequentialAnimation"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Sequential Animation" />
<Button
android:id="@+id/btnTogetherAnimation"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Together Animation" />
</LinearLayout>
</ScrollView>
</LinearLayout>
.class file:-
public class MainActivity extends Activity {
Button btn1,btn2,btn3,btn4,btnFadeIn,btnFadeOut,btnCrossFading,btnBlink,btnZoomIn,btnZoomOut,
btnRotate,btnMove,btnSlideUp,btnSlideDown,btnBounce,btnSequentialAnimation,btnTogetherAnimation;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn1=(Button)findViewById(R.id.btn1);
btn2=(Button)findViewById(R.id.btn2);
btn3=(Button)findViewById(R.id.btn3);
btn4=(Button)findViewById(R.id.btn4);
btnFadeIn=(Button)findViewById(R.id.btnFadeIn);
btnFadeOut=(Button)findViewById(R.id.btnFadeOut);
btnCrossFading=(Button)findViewById(R.id.btnCrossFading);
btnBlink=(Button)findViewById(R.id.btnBlink);
btnZoomIn=(Button)findViewById(R.id.btnZoomIn);
btnZoomOut=(Button)findViewById(R.id.btnZoomOut);
btnRotate=(Button)findViewById(R.id.btnRotate);
btnMove=(Button)findViewById(R.id.btnMove);
btnSlideUp=(Button)findViewById(R.id.btnSlideUp);
btnSlideDown=(Button)findViewById(R.id.btnSlideDown);
btnBounce=(Button)findViewById(R.id.btnBounce);
btnSequentialAnimation=(Button)findViewById(R.id.btnSequentialAnimation);
btnTogetherAnimation=(Button)findViewById(R.id.btnTogetherAnimation);
final Animation animTranslate=AnimationUtils.loadAnimation(this,R.drawable.translate);
final Animation animAlpha=AnimationUtils.loadAnimation(this, R.drawable.alpha);
final Animation animscale=AnimationUtils.loadAnimation(this,R.drawable.scale);
final Animation animRotate=AnimationUtils.loadAnimation(this, R.drawable.rotate);
final Animation animbtnFadeIn=AnimationUtils.loadAnimation(this,R.drawable.fade_in);
final Animation animbtnFadeOut=AnimationUtils.loadAnimation(this,R.drawable.fade_out);
final Animation animbtnBlink=AnimationUtils.loadAnimation(this,R.drawable.blink);
final Animation animbtnZoomIn=AnimationUtils.loadAnimation(this,R.drawable.zoom_in);
final Animation animbtnZoomOut=AnimationUtils.loadAnimation(this,R.drawable.zoom_out);
final Animation animbtnRotate=AnimationUtils.loadAnimation(this,R.drawable.rotate);
final Animation animbtnMove=AnimationUtils.loadAnimation(this,R.drawable.move);
final Animation animbtnSlideUp=AnimationUtils.loadAnimation(this,R.drawable.slide_up);
final Animation animbtnSlideDown=AnimationUtils.loadAnimation(this,R.drawable.slide_down);
final Animation animbtnBounce=AnimationUtils.loadAnimation(this,R.drawable.bounce);
final Animation animbtnSequentialAnimation=AnimationUtils.loadAnimation(this,R.drawable.sequential_animation);
final Animation animbtnTogetherAnimation=AnimationUtils.loadAnimation(this,R.drawable.together_animation);
btn1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animTranslate);
}
});
btn2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animAlpha);
}
});
btn3.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animscale);
}
});
btn4.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animRotate);
}
});
btnFadeIn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnFadeIn);
}
});
btnFadeOut.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnFadeOut);
}
});
btnBlink.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnBlink);
}
});
btnZoomIn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnZoomIn);
}
});
btnZoomOut.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnZoomOut);
}
});
btnRotate.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnRotate);
}
});
btnMove.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnMove);
}
});
btnSlideUp.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnSlideUp);
}
});
btnSlideDown.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnSlideDown);
}
});
btnBounce.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnBounce);
}
});
btnSequentialAnimation.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnSequentialAnimation);
}
});
btnTogetherAnimation.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
arg0.startAnimation(animbtnTogetherAnimation);
}
});
}
}
after that create drawable folder inside of res folder
then make then make
1:- alpha.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator">
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.1"
android:duration="500"
android:repeatCount="1"
android:repeatMode="reverse" />
</set>
2:-blink
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="0.0"
android:toAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:duration="600"
android:repeatMode="reverse"
android:repeatCount="infinite"/>
</set>
3:-bounce
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true"
android:interpolator="@android:anim/bounce_interpolator">
<scale
android:duration="500"
android:fromXScale="1.0"
android:fromYScale="0.0"
android:toXScale="1.0"
android:toYScale="1.0" />
</set>
4:- feed_in
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<alpha
android:duration="1000"
android:fromAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="1.0" />
</set>
5:-feed_out
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<alpha
android:duration="1000"
android:fromAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="0.0" />
</set>
6:-move
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fillAfter="true">
<translate
android:fromXDelta="0%p"
android:toXDelta="75%p"
android:duration="800" />
</set>
7:- rootate
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator">
<rotate
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:duration="500"
android:startOffset="0"
android:repeatCount="1"
android:repeatMode="reverse" />
</set>
8:- scale
<?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="1.0"
android:toXScale="3.0"
android:fromYScale="1.0"
android:toYScale="3.0"
android:pivotX="50%"
android:pivotY="50%"
android:duration="500"
android:repeatCount="1"
android:repeatMode="reverse" />
</set>
9:- sequential
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true"
android:interpolator="@android:anim/linear_interpolator" >
<!-- Use startOffset to give delay between animations -->
<!-- Move -->
<translate
android:duration="800"
android:fillAfter="true"
android:fromXDelta="0%p"
android:startOffset="300"
android:toXDelta="75%p" />
<translate
android:duration="800"
android:fillAfter="true"
android:fromYDelta="0%p"
android:startOffset="1100"
android:toYDelta="70%p" />
<translate
android:duration="800"
android:fillAfter="true"
android:fromXDelta="0%p"
android:startOffset="1900"
android:toXDelta="-75%p" />
<translate
android:duration="800"
android:fillAfter="true"
android:fromYDelta="0%p"
android:startOffset="2700"
android:toYDelta="-70%p" />
<!-- Rotate 360 degrees -->
<rotate
android:duration="1000"
android:fromDegrees="0"
android:interpolator="@android:anim/cycle_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="3800"
android:repeatCount="infinite"
android:repeatMode="restart"
android:toDegrees="360" />
</set>
10:-slidedown
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true">
<scale
android:duration="500"
android:fromXScale="1.0"
android:fromYScale="0.0"
android:interpolator="@android:anim/linear_interpolator"
android:toXScale="1.0"
android:toYScale="1.0" />
</set>
11:-slideup
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<scale
android:duration="500"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:interpolator="@android:anim/linear_interpolator"
android:toXScale="1.0"
android:toYScale="0.0" />
</set>
12:-togather
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true"
android:interpolator="@android:anim/linear_interpolator" >
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="4000"
android:fromXScale="1"
android:fromYScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="4"
android:toYScale="4" >
</scale>
<!-- Rotate 180 degrees -->
<rotate
android:duration="500"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite"
android:repeatMode="restart"
android:toDegrees="360" />
</set>
13:- translate
<?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="0"
android:toXDelta="100%p"
android:duration="500"
android:repeatCount="1"
android:repeatMode="reverse"/>
</set>
14:-zoomin
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXScale="1"
android:fromYScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="3"
android:toYScale="3" >
</scale>
</set>
15:-zoomout
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="0.5"
android:toYScale="0.5" >
</scale>
</set>
that solve
manifestfile.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.amit.buttonanimations"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
finish the animation of button or image etc Thanks to all users

No comments:
Post a Comment