At first I gave the activity to define the switching action, do not know why the effect has not come out, switching actions are the default Android. Later asked others, changed the change finally good, why I do not know. But if you encounter the problem of activity switching, you can directly apply my style, the code is as follows:
1. This is a style file:
<stylename="Thememain"parent="Android:theme"> <Itemname="Android:windowframe"> @null </Item> <Itemname="Android:windowbackground"> @android: color/transparent</Item> <Itemname="Android:background"> @null </Item> <Itemname="Android:colorbackgroundcachehint"> @null </Item> <Itemname="Android:windownotitle">true</Item> <Itemname="Android:windowsoftinputmode">stateunspecified|adjustpan</Item> <Itemname="Android:windowanimationstyle"> @style/style1</Item></style><stylename="Style1"parent="@android: Style/animation.translucent"> <Itemname="Android:windowenteranimation"> @anim/enter_from_left</Item> <Itemname="Android:windowexitanimation"> @anim/exit_to_left</Item></style>
2. This is enter_from_left.xml:
<?XML version="1.0"encoding="Utf-8"?><Setxmlns:android="Http://schemas.android.com/apk/res/android" android:shareinterpolator="false"> <Translate android:fromxdelta=" -100%" android:toxdelta="0%" android:fromydelta="0%" android:toydelta="0%" android:duration="+"/></Set>
3. This is exit_to_left.xml:
<?XML version="1.0"encoding="Utf-8"?><Setxmlns:Android="Http://schemas.android.com/apk/res/android" Android: shareinterpolator="false"> <Translate Android: Fromxdelta="0%" Android: Toxdelta=" -100%" Android: Fromydelta="0%" Android: Toydelta="0%" Android:d uration="+"/></Set>
4. This manifest.xml configuration file:
<Activity Android: Name=". Main. Mainactivity " Android: Theme="@style/thememain"> <Intent-filter> <ActionAndroid: Name="Android.intent.action.MAIN"/> <categoryAndroid: Name="Android.intent.category.LAUNCHER"/> </Intent-filter></Activity>
5. This is the Enter_from_right.xml file:
<?XML version="1.0"encoding="Utf-8"?><Setxmlns:Android="Http://schemas.android.com/apk/res/android" Android: shareinterpolator="false"> <Translate Android: Fromxdelta="100%" Android: Toxdelta="0%" Android: Fromydelta="0%" Android: Toydelta="0%" Android:d uration="+"/></Set>
6. This is the Exit_to_right.xml file:
<?XML version="1.0"encoding="Utf-8"?><Setxmlns:Android="Http://schemas.android.com/apk/res/android" Android: shareinterpolator="false"> <Translate Android: Fromxdelta="0%" Android: Toxdelta="100%" Android: Fromydelta="0%" Android: Toydelta="0%" Android:d uration="+"/></Set>
Everyone according to my template to configure style files and manifest file on the line, there are any questions can leave a message ~ ~ ~
Android activity Toggle-the effect of left and right swipe