}
Translate.setOnClickListener (new
translate = (Button)
v.startAnimation (translateAnimation);
import android.view.animation.AlphaAnimation;
1.rotateAnimation rotation animation
set = new AnimationSet (true);
public void onClick (View arg0)
alpha = (Button)
complete set of animations to the animation set to < br /> AnimationSet
/ /
set.addAnimation (translateAnimation );//< br /> rotateAnimation = new RotateAnimation (0, 360, / / ??
scale = (Button)
AnimationSet
/ /
set the duration of the animation moves to create animation
{
Animation.RELATIVE_TO_SELF,
v = (ImageView)
animation . setDuration (5000);
0); / / from 1 -> 0 from the full display to no
1. rotation, 2 zoom, 3 fade, 4 mobile

findViewById (R.id.imageView1);
Animation.RELATIVE_TO_SELF,
Animation.RELATIVE_TO_PARENT,
}
class alphaListnener implements
import android.os.Bundle;
import android.view.animation.ScaleAnimation;
/ /
AnimationSet
findViewById (R.id.alphaButton);
}
Animation.RELATIVE_TO_SELF,
2.TranslateAnimation mobile animation
import android.view.View.OnClickListener; < br /> Animation animation2 =
0.5f); / / set the Y coordinate axis, the first argument: to themselves as the benchmark, the second argument: his half of the Y-axis
alpha.setOnClickListener (new
3.AlphaAnimation fade animation
class translatevListnener implements
public void onCreate (Bundle savedInstanceState)
{
Tween animation can be divided into four categories:
RotateAnimation
set = new AnimationSet (true);

translateAnimation.setDuration (5000 );//< br /> 1: reduce the size of the first X, 2: narrow After the size of X, 3: reduce the size of the former Y-4: reduce the size of the Y after
package com.test;
set the animation duration, time to play once
Animation.RELATIVE_TO_SELF,
import android.view.animation.AnimationSet;
Animation.RELATIVE_TO_PARENT,
set to complete the animation add to the collection
We need to be defined in XML Animation:
}
v.startAnimation (set);
import android.view.animation.TranslateAnimation;
android in the animation can be divided into two categories:
android: duration = “5000″>
set.addAnimation (rotateAnimation );//< br /> android: fromAlpha = “0″
char b =
OnClickListener {
}
setContentView (R.layout.main);
XML code into the next:
TranslateAnimation
Animation in Android animation using the Animation This is the parent class, the class has used the following five categories are as follows:
@ Override
{
rotateListnener ());< br /> findViewById (R.id.rotate);
5.AnimationSet animation collection, we can add to the previous three animated animation collection, along with playing
rotate.setOnClickListener (new
animation.setDuration (5000); / / set the animation time
@ Override
class rotateListnener implements OnClickListener
here introduces Tween animation
public void onClick (View arg0)
class scaleListnener implements OnClickListener
set = new AnimationSet (true);
set = new AnimationSet (true);
}
AnimationUtils.loadAnimation (getApplicationContext (),
}
0.5f, / / ??narrow the reference X-pumping
public void onClick (View arg0)
}
public void onClick (View arg0)
@ Override
animation = new ScaleAnimation (1f, 0.1f, 1f, 0.1f, / / ??parameter in the code
class by AnimationUtils the Load method to get the specific animation:
AnimationSet
}
rotate = (Button)
specific for each animation:
scale.setOnClickListener (new
import android.widget.ImageView;
scaleListnener ());
set.addAnimation (animation); / / add animation to the collection
set.setFillAfter (true); / / set the animation is finished playing, to keep
AlphaAnimation
4.ScaleAnimation zoom animation
R.anim.rotate);
0.7f); / / own basis, 0.5 times the width. set to move to the Y-axis coordinate
ScaleAnimation
}
findViewById (R.id.translateButton);
import android.app.Activity;
rotated from 0 degrees to 360 degrees, just around
{
0.9 f, / / ??to the parent container as the base, 0.9 times the width. set to move to the X-axis coordinate
import android.view.animation.Animation;
translateAnimation = new TranslateAnimation (
import android.widget.Button;
public class AnimationActivity extends Activity {
set.addAnimation (animation);
2.Frame animation: animation feature
{
0.3 f, / / ??to the parent container as the base, 0.3 times the width. Set the Y-axis coordinate
v.startAnimation (animation);
quot; < br /> above animation is in the code achieve, because according to JAVA development experience, this is very beneficial to update and maintain the code redundancy in excess
Animation.RELATIVE_TO_PARENT,
translatevListnener ());< br /> {
android: toAlpha = “1″
1.Tween animation: to achieve special effects functions
private ImageView v;
0.5f); / / Y pumping reduced the benchmark
@ Override
super.onCreate (savedInstanceState);
findViewById (R.id.scaleButton);
{
v.startAnimation (set );//< br /> to start the animation collection The animation
animation = new AlphaAnimation (1,
import android.view.animation.RotateAnimation;
create animation collection
private Button rotate, translate, scale,
@ Override
0.5f, / / ??Set the X coordinate axis, the first parameter: the parent container as the base, the second argument: the parent container half
alpha;
alphaListnener ()) ;
we can control the object needs to set the animation
import android.view.View;
rotateAnimation.setDuration (5000 );//< br /> encoding = “utf-8 “?>
Animation.RELATIVE_TO_PARENT,
0.5f, / / ??to the parent container as the base, 0.5 times the width. set the X axis coordinate
/ / set.setFillBefore (false); < br /> OnClickListener {
create animation collection