We can add animation on activity switching.
First thing that we need to do is to create xml for animation. Here I am using two xml for in and out.
animation_in.xml
set xmlns: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="200"/>
/translate>/set>
animation_out.xml
translate android:fromxdelta="100%" android:toxdelta="0%" android:fromydelta="0%" android:toydelta="0%" android:duration="200">
/translate>/set>
After saving these xml files in anim folder just call intent like this:
Intent animIntent= new Intent(SlidingAnimExample.this,TestingActivity.class);
startActivity(animIntent);
overridePendingTransition(R.anim.animation_in, R.anim. animation _out);
0 Comment(s)