1. In the Anim directory, create a new Anim folder, the new Tran_in.xml and Tran_out.xml respectively for the next page to switch into, and this page to switch out.
That is, in means the next page moves toward Pan left, and out indicates the same move to pan left to disappear.
Tran_in.xml
- <translate xmlns:android="http://schemas.android.com/apk/res/android"
- android:fromxdelta="100%p" x-axis from 100->0
- android:toxdelta="0"
- android:fromydelta="0"
- android:toydelta="0"
- android:duration="500msec"> Mean time
- </Translate>
Tran_out.xml
- <translate xmlns:android="http://schemas.android.com/apk/res/android"
- android:fromxdelta="0" x-axis from 0->-100
- android:toxdelta=" -100%p"
- android:fromydelta="0"
- android:toydelta="0"
- android:duration="> "
- </Translate>
- //animation effect to be implemented after finish () or startactivity ()
- Overridependingtransition (r.anim.tran_in, r.anim.tran_out);
Android Acitivy Toggle Translation Animation effect implementation