Je veux une animation entre les fragments. Le deuxième fragment devrait sortir de la partie inférieure droite et le premier (le fragment actuel devrait rester tel quel) cela devrait se produire au clic d'un bouton FAB.Animation entre fragments
Ce que j'ai essayé.
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>
Le problème est que je ne suis pas en mesure de voir le glissement réel dans Qu'ai-je manqué ici.?
s'il vous plaît se référer https://stackoverflow.com/questions/4932462/animate-the-transition-between-fragments –