out_to_left.xml:
<?xml version="1.0" encoding="utf-8"?>
<!--从屏幕左边退出,先退后2%p位置,再向左退出 -->
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >
<translate
android:duration="200"
android:fromXDelta="0%p"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toXDelta="2%p" />
<translate
android:duration="1000"
android:fromXDelta="2%p"
android:interpolator="@android:anim/accelerate_interpolator"
android:startOffset="200"
android:toXDelta="-100%p" />
</set>
in_from_right.xml:
<?xml version="1.0" encoding="utf-8"?>
<!--从屏幕右边偏离2%位置开始进入,到达终点后有超出在返回终点的动态效果 -->
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXDelta="102%p"
android:interpolator="@android:anim/anticipate_overshoot_interpolator"
android:startOffset="200"
android:toXDelta="0%p" />
<?xml version="1.0" encoding="utf-8"?>
<!--从屏幕左边退出,先退后2%p位置,再向左退出 -->
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >
<translate
android:duration="200"
android:fromXDelta="0%p"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toXDelta="2%p" />
<translate
android:duration="1000"
android:fromXDelta="2%p"
android:interpolator="@android:anim/accelerate_interpolator"
android:startOffset="200"
android:toXDelta="-100%p" />
</set>
in_from_right.xml:
<?xml version="1.0" encoding="utf-8"?>
<!--从屏幕右边偏离2%位置开始进入,到达终点后有超出在返回终点的动态效果 -->
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXDelta="102%p"
android:interpolator="@android:anim/anticipate_overshoot_interpolator"
android:startOffset="200"
android:toXDelta="0%p" />
intent.putExtra("idnumber", IDCARD);
startActivity(intent);
//设置切换动画,从右边进入,左边退出
overridePendingTransition(R.xml.in_from_right, R.xml.out_to_left);
startActivity(intent);
//设置切换动画,从右边进入,左边退出
overridePendingTransition(R.xml.in_from_right, R.xml.out_to_left);