Activity Animation Jump (overridePendingTransition)

overridePendingTransition: This function takes two parameters, a parameter is animated when the first activity to enter, another parameter is the animation of the second activity exit.

Special Instructions:
1. it must immediately startActivity () or finish () function is called after
2 is only applicable version android2.0 above (including 2.0)

Use: next is two clicks with pre event ( panning animation )
Here Insert Picture Description
Little mention: animation xml files need to be placed anim folder in, DURATION time to showHere Insert Picture Description
four animation files as follows:
anim_settingtop_next_go.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" android:duration="500">
    <translate android:fromXDelta="100%" android:toXDelta="0"></translate>

</set>

anim_settingtop_next_to.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" android:duration="500">
<translate android:fromXDelta="0" android:toXDelta="-100%"></translate>

</set>

anim_settingtop_pre_go.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" android:duration="500">
    <translate android:fromXDelta="-100%" android:toXDelta="0"></translate>

</set>

anim_settingtop_pre_to.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" android:duration="500">
<translate android:fromXDelta="0" android:toXDelta="100%"></translate>

</set>

Welcome Message

Published 77 original articles · won praise 411 · views 270 000 +

Guess you like

Origin blog.csdn.net/qq_42761395/article/details/99840048