【动画】【特效】 17种常用动画特效_xml 【动画】【特效】 17种常用动画特效_动画效果_02 【动画】【特效】 17种常用动画特效_xml_03 【动画】【特效】 17种常用动画特效_xml_04

主Activity的布局文件xml


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget33"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/back"
android:orientation="vertical" >

<TextView
android:id="@+id/widget34"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />

<LinearLayout
android:id="@+id/widget36"
android:layout_width="fill_parent"
android:layout_height="40px"
android:background="@drawable/bt_group_back" >

<Button
android:id="@+id/button_Last"
android:layout_width="64px"
android:layout_height="fill_parent"
android:background="@drawable/ic_cmd_last" />

<Button
android:id="@+id/button_Replay"
android:layout_width="64px"
android:layout_height="fill_parent"
android:background="@drawable/ic_cmd_replay" />

<Button
android:id="@+id/button_Next"
android:layout_width="64px"
android:layout_height="fill_parent"
android:background="@drawable/ic_cmd_next" />

<Button
android:id="@+id/button_List"
android:layout_width="64px"
android:layout_height="fill_parent"
android:background="@drawable/ic_cmd_list" />

<Button
android:id="@+id/button_Exit"
android:layout_width="65sp"
android:layout_height="fill_parent"
android:background="@drawable/ic_cmd_power" />
</LinearLayout>

<ImageButton
android:id="@+id/Button01"
android:layout_width="90sp"
android:layout_height="80sp"
android:layout_marginLeft="100sp"
android:layout_marginTop="80sp"
android:background="@drawable/favorite"
android:contentDescription="五角星图片" />

</LinearLayout>

View Code

主Activity


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


package zyf.myAnimation;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.Toast;

public class myAnimation extends Activity implements OnClickListener {

private ImageButton button_toTestAnimation;
private Button bt_last, bt_replay, bt_next, bt_list, bt_exit;
protected Animation animation;
private int[] ID;
private MenuItem back_Menu, next_Menu, restart_Menu, selsect_Menu,
exit_Menu;
private final int Back_Menu_ID = Menu.FIRST + 1;
private final int Next_Menu_ID = Menu.FIRST + 2;
private final int Selsect_Menu_ID = Menu.FIRST + 3;
private final int Restart_Menu_ID = Menu.FIRST + 4;
private final int Exit_Menu_ID = Menu.FIRST + 5;
private int the_Animation_ID = 0;
private int i = 0;
private int requestCode = 110;
private Bundle bundle;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ID = new int[] {
R.anim.myanimation_simple, R.anim.my_alpha_action,
R.anim.my_scale_action, R.anim.my_translate_action,
R.anim.my_rotate_action, R.anim.alpha_scale,
R.anim.alpha_translate, R.anim.alpha_rotate,
R.anim.scale_translate, R.anim.scale_rotate,
R.anim.translate_rotate, R.anim.alpha_scale_translate,
R.anim.alpha_scale_rotate, R.anim.alpha_translate_rotate,
R.anim.scale_translate_rotate,
R.anim.alpha_scale_translate_rotate, R.anim.myown_design };
findMyButton();
myButtonSetListener();
}

private void myButtonSetListener() {
bt_last.setOnClickListener(this);
bt_replay.setOnClickListener(this);
bt_next.setOnClickListener(this);
bt_list.setOnClickListener(this);
bt_exit.setOnClickListener(this);
}

private void findMyButton() {
button_toTestAnimation = (ImageButton) findViewById(R.id.Button01);
bt_last = (Button) findViewById(R.id.button_Last);
bt_replay = (Button) findViewById(R.id.button_Replay);
bt_next = (Button) findViewById(R.id.button_Next);
bt_list = (Button) findViewById(R.id.button_List);
bt_exit = (Button) findViewById(R.id.button_Exit);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
back_Menu = menu.add(0, this.Back_Menu_ID, 1, "上一个动画");
next_Menu = menu.add(0, this.Next_Menu_ID, 2, "下一个动画");
restart_Menu = menu.add(0, this.Restart_Menu_ID, 3, "重新播放");
selsect_Menu = menu.add(0, this.Selsect_Menu_ID, 4, "选择动画");
exit_Menu = menu.add(0, this.Exit_Menu_ID, 5, "退出");
back_Menu.setIcon(R.drawable.ic_menu_back);
next_Menu.setIcon(R.drawable.ic_menu_next);
restart_Menu.setIcon(R.drawable.ic_menu_restart);
selsect_Menu.setIcon(R.drawable.ic_menu_select);
exit_Menu.setIcon(R.drawable.ic_power);
return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == this.Exit_Menu_ID) {
finish();
} else if (item.getItemId() == this.Selsect_Menu_ID) {
Intent forIntent = new Intent();
forIntent.setClass(myAnimation.this, MYListActivity.class);
startActivityForResult(forIntent, requestCode);
} else {
switch (item.getItemId()) {
case Back_Menu_ID: {
toLastIndex();
}
break;
case Next_Menu_ID: {
toNextIndex();
}
break;
default:
break;
}
load_start_Animation(i);
}
return super.onOptionsItemSelected(item);
}

private void load_start_Animation(int i) {
the_Animation_ID = ID[i];
if (the_Animation_ID != 0) {
animation = AnimationUtils.loadAnimation(this, the_Animation_ID);
button_toTestAnimation.startAnimation(animation);
}
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == this.requestCode) {
if (resultCode == RESULT_OK) {
try {
bundle = data.getExtras();
i = bundle.getInt("INDEX");
load_start_Animation(i);
} catch (Exception e) {
Toast.makeText(this, "ERROR", Toast.LENGTH_LONG).show();
}
} else {
Toast.makeText(this, "返回取消", Toast.LENGTH_LONG).show();
}
} else {
Toast.makeText(this, "无返回!", Toast.LENGTH_LONG).show();
}

}

public void onClick(View v) {
if (v.equals(bt_exit)) {
finish();
} else if (v.equals(bt_list)) {
Intent forIntent = new Intent();
forIntent.setClass(myAnimation.this, MYListActivity.class);
startActivityForResult(forIntent, requestCode);
} else {
switch (v.getId()) {
case R.id.button_Last: {
toLastIndex();
}
break;
case R.id.button_Next: {
toNextIndex();
}
break;
default:
break;
}
load_start_Animation(i);
}
}

private void toLastIndex() {
--i;
if (i < 0) {
i = ID.length - 1;
}
}

private void toNextIndex() {
++i;
if (i >= ID.length) {
i = 0;
}
}
}

View Code

ListView布局文件xml


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ListView
android:id="@+id/ListView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/back" />
</LinearLayout>

View Code

ListView的Activity


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


package zyf.myAnimation;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemSelectedListener;

public class MYListActivity extends Activity implements OnItemClickListener,
OnItemSelectedListener {
private ListView mylist;
private ArrayAdapter<String> arrayAdapter;
private String[] contentString;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list_layout);
contentString = new String[] {
"示例", "透明动画",
"伸缩动画", "移动动画",
"旋转动画", "透明_伸缩",
"透明_移动", "透明_旋转",
"伸缩_移动","伸缩_旋转",
"移动_旋转", "透明_伸缩_移动",
"透明_伸缩_旋转", "透明_移动_旋转",
"伸缩_移动_旋转",
"透明_伸缩_移动_旋转", "myown_Design"
};
arrayAdapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_single_choice,
contentString);
mylist = (ListView) findViewById(R.id.ListView01);
mylist.setAdapter(arrayAdapter);
mylist.setOnItemClickListener(this);
mylist.setOnItemSelectedListener(this);
mylist.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// TODO Auto-generated method stub
return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// TODO Auto-generated method stub
return super.onOptionsItemSelected(item);
}

public void onItemClick(AdapterView<?> arg0, View arg1, int index, long arg3) {
// TODO Auto-generated method stub
Intent back_intent= new Intent();
Bundle back_Bundle=new Bundle();

back_Bundle.putInt("INDEX", index);
back_intent.putExtras(back_Bundle);
setResult(RESULT_OK, back_intent);
finish();
}

public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
setTitle(arrayAdapter.getItem(arg2));
mylist.setItemChecked(arg2, true);
}

public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub

}
}

View Code

 

 

R.anim.myanimation_simple,  "示例"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<scale
android:duration="700"
android:fillAfter="false"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.4"
android:toYScale="0.6" />

<set android:interpolator="@android:anim/decelerate_interpolator" >
<scale
android:duration="400"
android:fillBefore="false"
android:fromXScale="1.4"
android:fromYScale="0.6"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="700"
android:toXScale="0.0"
android:toYScale="0.0" />

<rotate
android:duration="400"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="700"
android:toDegrees="-45"
android:toYScale="0.0" />
</set>

</set>

View Code

 

R.anim.my_alpha_action,  "透明动画"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

<alpha
android:duration="3000"
android:fromAlpha="0.1"
android:toAlpha="1.0" />
<!--
透明度控制动画效果 alpha
浮点型值:
fromAlpha 属性为动画起始时透明度
toAlpha 属性为动画结束时透明度
说明:
0.0表示完全透明
1.0表示完全不透明
以上值取0.0-1.0之间的float数据类型的数字

长整型值:
duration 属性为动画持续时间
说明:
时间以毫秒为单位
-->

</set>

View Code

 

R.anim.my_scale_action,  "伸缩动画"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

<scale
android:duration="700"
android:fillAfter="false"
android:fromXScale="0.0"
android:fromYScale="0.0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.4"
android:toYScale="1.4" />

</set><!--
尺寸伸缩动画效果 scale

属性:interpolator 指定一个动画的插入器

在我试验过程中,使用android.res.anim中的资源时候发现有三种动画插入器

accelerate_decelerate_interpolator 加速-减速 动画插入器
accelerate_interpolator 加速-动画插入器
decelerate_interpolator 减速- 动画插入器

其他的属于特定的动画效果


浮点型值:

fromXScale 属性为动画起始时 X坐标上的伸缩尺寸
toXScale 属性为动画结束时 X坐标上的伸缩尺寸

fromYScale 属性为动画起始时Y坐标上的伸缩尺寸
toYScale 属性为动画结束时Y坐标上的伸缩尺寸

说明:
以上四种属性值

0.0表示收缩到没有
1.0表示正常无伸缩
值小于1.0表示收缩
值大于1.0表示放大


pivotX 属性为动画相对于物件的X坐标的开始位置
pivotY 属性为动画相对于物件的Y坐标的开始位置

说明:
以上两个属性值 从0%-100%中取值
50%为物件的X或Y方向坐标上的中点位置

长整型值:
duration 属性为动画持续时间
说明:
时间以毫秒为单位


布尔型值:
fillAfter 属性 当设置为true ,该动画转化在动画结束后被应用
-->

View Code

 

R.anim.my_translate_action,  "移动动画"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

<translate
android:duration="2000"
android:fromXDelta="30"
android:fromYDelta="30"
android:toXDelta="-80"
android:toYDelta="300" />
<!--
translate 位置转移动画效果
整型值:
fromXDelta 属性为动画起始时 X坐标上的位置
toXDelta 属性为动画结束时 X坐标上的位置

fromYDelta 属性为动画起始时 Y坐标上的位置
toYDelta 属性为动画结束时 Y坐标上的位置
注意:
没有指定fromXType toXType fromYType toYType 时候,默认是以自己为相对参照物


长整型值:
duration 属性为动画持续时间
说明:
时间以毫秒为单位
-->

</set>

View Code

 

R.anim.my_rotate_action,  "旋转动画"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

<rotate
android:duration="3000"
android:fromDegrees="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="+350" />

<!--
rotate 旋转动画效果


属性:interpolator 指定一个动画的插入器

在我试验过程中,使用android.res.anim中的资源时候发现有三种动画插入器

accelerate_decelerate_interpolator 加速-减速 动画插入器
accelerate_interpolator 加速-动画插入器
decelerate_interpolator 减速- 动画插入器

其他的属于特定的动画效果


浮点数型值:

fromDegrees 属性为动画起始时物件的角度
toDegrees 属性为动画结束时物件旋转的角度 可以大于360度

说明:
当角度为负数——表示逆时针旋转
当角度为正数——表示顺时针旋转

(负数from——to正数:顺时针旋转)
(负数from——to负数:逆时针旋转)
(正数from——to正数:顺时针旋转)
(正数from——to负数:逆时针旋转)


pivotX 属性为动画相对于物件的X坐标的开始位置
pivotY 属性为动画相对于物件的Y坐标的开始位置

说明:
以上两个属性值 从0%-100%中取值
50%为物件的X或Y方向坐标上的中点位置


长整型值:
duration 属性为动画持续时间
说明:
时间以毫秒为单位
-->

</set>

View Code

 

R.anim.alpha_scale,  "透明_伸缩"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<alpha
android:duration="500"
android:fromAlpha="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:repeatCount="0"
android:toAlpha="1.0" >
</alpha>

<scale
android:duration="500"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="0"
android:startOffset="500"
android:toXScale="0.5"
android:toYScale="1.4" >
</scale>

</set>

View Code

 

R.anim.alpha_translate,  "透明_移动"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<alpha
android:duration="2000"
android:fromAlpha="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:repeatCount="0"
android:toAlpha="1.0" >
</alpha>

<translate
android:duration="2000"
android:fromXDelta="30"
android:fromYDelta="30"
android:toXDelta="-80"
android:toYDelta="300" />

</set>

View Code

 

R.anim.alpha_rotate,  "透明_旋转"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<alpha
android:duration="3000"
android:fromAlpha="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:repeatCount="0"
android:toAlpha="1.0" >
</alpha>

<rotate
android:duration="3000"
android:fromDegrees="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="+350" />

</set>

View Code

 

R.anim.scale_translate,  "伸缩_移动"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<scale
android:duration="2000"
android:fromXScale="0.0"
android:fromYScale="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="0"
android:startOffset="300"
android:toXScale="1.0"
android:toYScale="1.0" >
</scale>

<translate
android:duration="2000"
android:fromXDelta="30"
android:fromYDelta="30"
android:toXDelta="-80"
android:toYDelta="250" />

</set>

View Code

 

R.anim.scale_rotate,  "伸缩_旋转"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<scale
android:duration="3000"
android:fromXScale="0.0"
android:fromYScale="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="0"
android:startOffset="300"
android:toXScale="1.0"
android:toYScale="1.0" >
</scale>

<rotate
android:duration="3000"
android:fromDegrees="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="+355" />

</set>

View Code

 

R.anim.translate_rotate,  "移动_旋转"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<translate
android:duration="3000"
android:fromXDelta="120"
android:fromYDelta="30"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toXDelta="110"
android:toYDelta="50" />

<rotate
android:duration="5000"
android:fromDegrees="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="800"
android:toDegrees="+360" />

</set>

View Code

 

R.anim.alpha_scale_translate,  "透明_伸缩_移动"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<alpha
android:duration="3000"
android:fromAlpha="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:toAlpha="1.0" >
</alpha>

<scale
android:duration="3000"
android:fromXScale="0.0"
android:fromYScale="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.0"
android:toYScale="1.0" >
</scale>

<translate
android:duration="3000"
android:fromXDelta="120"
android:fromYDelta="30"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toXDelta="30"
android:toYDelta="250" />

</set>

View Code

 

R.anim.alpha_scale_rotate,  "透明_伸缩_旋转"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<alpha
android:duration="3000"
android:fromAlpha="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:toAlpha="1.0" >
</alpha>

<scale
android:duration="3000"
android:fromXScale="0.0"
android:fromYScale="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.0"
android:toYScale="1.0" >
</scale>

<rotate
android:duration="3000"
android:fromDegrees="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="+355" />

</set>

View Code

 

R.anim.alpha_translate_rotate,  "透明_移动_旋转"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<alpha
android:duration="3000"
android:fromAlpha="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:toAlpha="1.0" />

<translate
android:duration="3000"
android:fromXDelta="120"
android:fromYDelta="30"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toXDelta="30"
android:toYDelta="250" />

<rotate
android:duration="5000"
android:fromDegrees="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="800"
android:toDegrees="+360" />

</set>

View Code

 

R.anim.scale_translate_rotate,  "伸缩_移动_旋转"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<scale
android:duration="3000"
android:fromXScale="0.0"
android:fromYScale="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.0"
android:toYScale="1.0" >
</scale>

<translate
android:duration="3000"
android:fromXDelta="120"
android:fromYDelta="30"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toXDelta="30"
android:toYDelta="250" />

<rotate
android:duration="3000"
android:fromDegrees="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="+355" />

</set>

View Code

 

R.anim.alpha_scale_translate_rotate,  "透明_伸缩_移动_旋转"


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<alpha
android:duration="3000"
android:fromAlpha="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:toAlpha="1.0" >
</alpha>

<scale
android:duration="3000"
android:fromXScale="0.0"
android:fromYScale="0.0"
android:interpolator="@android:res/anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.0"
android:toYScale="1.0" >
</scale>

<translate
android:duration="3000"
android:fromXDelta="120"
android:fromYDelta="30"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toXDelta="30"
android:toYDelta="250" />

<rotate
android:duration="3000"
android:fromDegrees="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="+360" />

</set>

View Code

 

R.anim.myown_design,  "myown_Design"

 


【动画】【特效】 17种常用动画特效_xml_05【动画】【特效】 17种常用动画特效_bundle_06


<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >

<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >
<translate
android:duration="800"
android:fromYDelta="-100"
android:interpolator="@android:anim/accelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:toYDelta="0" >
</translate>
</set>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >
<scale
android:duration="400"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:pivotX="50%"
android:pivotY="100%"
android:startOffset="790"
android:toXScale="1.0"
android:toYScale="0.3" >
</scale>
</set>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >
<translate
android:duration="400"
android:fromYDelta="0"
android:interpolator="@android:anim/decelerate_interpolator"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="1190"
android:toYDelta="-60" >
</translate>
</set>

</set>

View Code