I'm trying to do a simple translate animation for two fragments. One comes in from the right while the other goes out to the left. My min SDK is 14. What happens is the transition takes place, but without the actual animation. After the time specified in the animation xml, the fragments just swap. So the animation time is being respected, but there is no actual translation.
My fragment animation code is:
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.setCustomAnimations(R.animator.enter_from_right, R.animator.exit_to_left);
fragmentTransaction.replace(android.R.id.content, termsFragment);
fragmentTransaction.commit();
fragmentManager.executePendingTransactions();
My animation xml files are (enter_from_right):
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromXDelta="100%"
android:toXDelta="0%"
android:duration="1000" />
</set>
and exit_to_left:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromXDelta="0%"
android:toXDelta="-100%"
android:duration="1000"/>
</set>