SetCustomAnimations is always replaced at the top to exit the fragment

I have this code:

FragmentTransaction transaction = manager.beginTransaction();

            stopMain = new OTDMainStopsFragment();
            transaction.setCustomAnimations(R.anim.right_left_anim_x_left,R.anim.fragment_scale_out, R.anim.fragment_scale_in, R.anim.left_right_anim_x_right);
            transaction.replace(R.id.main_fragment_container, stopMain).addToBackStack("OTDMainStopsFragment");
            transaction.commit();

      

What I'm going to achieve is to have the inbound fragment on top of the outbound fragment (the add method won't do because I need to animate the output and the inbound of the fragments when it pops out of the backstack).

What really happens is that when you change the fragment, the outgoing fragment will animate over the incoming fragment.

How do I change the z index for the outgoing chunk that is below the incoming chunk.

Refined BTW snippet animations work as if it were

+3
java android fragment android-animation


source to share


No one has answered this question yet

See similar questions:

61
FragmentTransaction animation for transition from above

or similar:

2248
Is a finally block always executable in Java?
1207
Strange memory issue when loading image into Bitmap object
1002
Grid motion detection
740
Dilemma: when to use Fragments vs Activities:
173
Fragment onResume () & onPause () is not called on the stack
61
FragmentTransaction animation for transition from above
52
Pop snippet backstack no play Pop-Animation
29
Replacing the ViewPager with a Fragment - then navigating back
fourteen
Android Fragment Animation onResume
five
Clear backstack and replace current snippet with top-level snippet



All Articles
Loading...
X
Show
Funny
Dev
Pics