I'm trying to animate transitions between Activities in my application. I have right_to_left.xml which is working on Portrait screen orientation.
Here is right_to_left.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_shortAnimTime"
android:fromXDelta="100%"
android:interpolator="@android:anim/linear_interpolator"
android:toXDelta="0" />
</set>
Here is right_to_left_slide_out.xml (to slide out previous activity on transition.)
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_shortAnimTime"
android:fromXDelta="0"
android:interpolator="@android:anim/linear_interpolator"
android:toXDelta="-100%p" />
</set>
I was using it after startActivity() and there was no problem on Portrait mode.
But I added an option to change screen orientation to Landscape mode.
If landscape mode is enabled, I set requested orientation with code below in onCreate().
//SCREEN ORIENTATION
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
This works well, activity is created in Landscape mode without any issue. But when I try to start activity with overridePendingTransition(R.anim.right_to_left, R.anim.right_to_left_slide_out) which is working on Portrait mode, no transition animation seems on Landscape mode.
Is there something I've missed?
EDIT: I've tried to create a new animation xml file that works with YDelta. It didn't work either.