I have written an xml that works well to move an activity from right to left on click. But now what exactly I want is to convert that xml in code that will move an activity from bottom to top on click.
Here is my xml for right to left
right1.xml
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fillAfter="true">
<translate
android:fromXDelta="-100%p"
android:toXDelta="0%p"
android:duration="200" />
</set>
And here is another xml right2.xml
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fillAfter="true">
<translate
android:fromXDelta="0%p"
android:toXDelta="100%p"
android:duration="200" />
</set>
And here I used this code for switching between activities
Intent intent = new Intent(Activity1.this, Activity2.class);
startActivity(intent);
Activity1.this.overridePendingTransition(R.anim.right1, R.anim.right2);
Now I want it to change to bottom top move, that is to move activity from bottom to top. Any help will be highly appreciated. Thanks in advance.