5

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 was going to achive is to have an entering fragment on top of the exiting fragment, (add method wont do because I need to animate exit and entering of fragments when it is pop from the backstack).

What is really happening is that when the fragment is changed the exiting fragment will animate on top of the entering fragment.

How can I change the z index of the exiting fragment to be underneath the entering fragment.

BTW popped fragment animations work the way it is

Rod_Algonquin
  • 26,074
  • 6
  • 52
  • 63
  • try changing order of animations in setCustomAnimations(); – Harin Apr 21 '15 at 08:01
  • There is no animation order. You can firstly hide and then show but it will show white background under fragment being hidden while animating. – ypresto Aug 19 '16 at 01:58
  • Duplicate of http://stackoverflow.com/questions/13005961/fragmenttransaction-animation-to-slide-in-over-top – ypresto Aug 19 '16 at 02:48

0 Answers0