I want animation between fragments. The second fragment should slide out from bottom right and the first(current fragment should stay as it is) this should happen on click of a FAB Button.
What I have tried.
ft.setCustomAnimations(R.anim.slide_in_from_bottom_right,R.anim.stay);
ft.replace(R.id.sample_content_fragment, fragment, "XYZ");
ft.addToBackStack("XYZ");
Bundle bundle = new Bundle();
fragment.setArguments(bundle);
ft.commit();
slide_in_from_bottom_right.xml
:-
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="100%p" android:fromXDelta="100%p" android:toYDelta="0%p"
android:duration="600"
android:fillAfter="true"
android:interpolator="@android:anim/linear_interpolator"
/>
</set>
stay.xml
:-
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:duration="600"/>
</set>
The problem is that I am not able to see the actual sliding in. What have I missed here?