Overridependingtransition (Enteranim, Exitanim);
Intent Intent =new Intent (this,item2.class); startactivity (Intent); This.finish ();
For the whole application to change the way, then use style control it
1. Create Anim folder in Res folder
2. Add the following files:
Slide_left_in.xml in from the left.
<? xml version= "1.0" encoding= "Utf-8" ?> < set xmlns:android = "Http://schemas.android.com/apk/res/android" > < translate android:duration = " Android:fromxdelta = " -100.0%p" Android:toxdelta = "0.0" /> </ set >
<? xml version= "1.0" encoding= "Utf-8" ?> < set xmlns:android = "Http://schemas.android.com/apk/res/android" > < translate android:duration = " Android:fromxdelta = "0.0" Android:toxdelta = " -100.0%p" /> </ set >
Slide_right_in.xml comes in from the right
<? xml version= "1.0" encoding= "Utf-8" ?> < set xmlns:android = "Http://schemas.android.com/apk/res/android" > < translate android:duration = " Android:fromxdelta = "100.0%p" Android:toxdelta = "0.0" /> </ set >
Slide_right_out.xml Go from the right
<? xml version= "1.0" encoding= "Utf-8" ?> < set xmlns:android = "Http://schemas.android.com/apk/res/android" > < translate android:duration = " Android:fromxdelta = "0.0" Android:toxdelta = "100.0%p" /> </ set >
Properties explained:
Translate position transfer animation effect
Android:fromxdelta= "0"-----------starting from 0 coordinates
Android:toxdelta= " -100%p"------move distance to parent level-100%
Two parameters are the offset distance of the charge relative to the parent
Android:duration= "-----------duration"
3. Modify Theme Styles
<!--application theme. - <stylename= "Apptheme"Parent= "Appbasetheme"> <!--All customizations, that is, specific to a particular api-level can go. - <Itemname= "Android:windowanimationstyle">@style/activityanimation</Item> </style> <stylename= "Activityanimation"Parent= "@android: Style/animation"> <Itemname= "Android:activityopenenteranimation">@anim/slide_right_in</Item> <Itemname= "Android:activityopenexitanimation">@anim/slide_left_out</Item> <Itemname= "Android:activitycloseenteranimation">@anim/slide_left_in</Item> <Itemname= "Android:activitycloseexitanimation">@anim/slide_right_out</Item> </style>
Example Download >>>>>>>>>>>>>