其实就是两个动画而已
```java
public class SecActivity extends Activity {
private ImageView img_lastPager_left;
private ImageView img_lastPager_right;
private Animation translate_down;
private Animation translate_up;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
img_lastPager_left = (ImageView) findViewById(R.id.img_lastPager_down);
img_lastPager_right = (ImageView) findViewById(R.id.img_lastPager_up);
translate_down = AnimationUtils.loadAnimation(this,
R.anim.translate_down);
translate_up = AnimationUtils.loadAnimation(this, R.anim.translate_up);
translate_up.setFillEnabled(true);
translate_up.setFillAfter(true);
translate_down.setFillEnabled(true);
translate_down.setFillAfter(true);
img_lastPager_left.setAnimation(translate_down);
img_lastPager_right.setAnimation(translate_up);
}
}
```
```java
<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="false" >
<translate
android:duration="1000"
android:fromXDelta="0.0"
android:fromYDelta="0.0"
android:toYDelta="0.0"
android:toXDelta="100.0%p" />
</set>
```
```java
<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="false" >
<translate
android:duration="1000"
android:fromXDelta="0.0"
android:fromYDelta="0.0"
android:toYDelta="0.0"
android:toXDelta="-100.0%p" />
</set>
```
```java
<RelativeLayout 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:background="#F0F"
tools:context=".MainActivity" >
<ImageView
android:id="@+id/img_lastPager_up"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/up" />
<ImageView
android:id="@+id/img_lastPager_down"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/up" />
</RelativeLayout>
```
```java
public class SecActivity extends Activity {
private ImageView img_lastPager_left;
private ImageView img_lastPager_right;
private Animation translate_down;
private Animation translate_up;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
img_lastPager_left = (ImageView) findViewById(R.id.img_lastPager_down);
img_lastPager_right = (ImageView) findViewById(R.id.img_lastPager_up);
translate_down = AnimationUtils.loadAnimation(this,
R.anim.translate_down);
translate_up = AnimationUtils.loadAnimation(this, R.anim.translate_up);
translate_up.setFillEnabled(true);
translate_up.setFillAfter(true);
translate_down.setFillEnabled(true);
translate_down.setFillAfter(true);
img_lastPager_left.setAnimation(translate_down);
img_lastPager_right.setAnimation(translate_up);
}
}
```
```java
<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="false" >
<translate
android:duration="1000"
android:fromXDelta="0.0"
android:fromYDelta="0.0"
android:toYDelta="0.0"
android:toXDelta="100.0%p" />
</set>
```
```java
<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="false" >
<translate
android:duration="1000"
android:fromXDelta="0.0"
android:fromYDelta="0.0"
android:toYDelta="0.0"
android:toXDelta="-100.0%p" />
</set>
```
```java
<RelativeLayout 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:background="#F0F"
tools:context=".MainActivity" >
<ImageView
android:id="@+id/img_lastPager_up"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/up" />
<ImageView
android:id="@+id/img_lastPager_down"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/up" />
</RelativeLayout>
```