android - Fragment enter and exit transitions are not executed at the same time -
running simple slide left animation both entering , existing fragment produces effect of entering fragment overlapping exit fragment. leads me think both transition not executed @ same time. clue or confirmation of behavior?
the desired effect slide fragments left @ same time, without overlap.
the code:
fragment current = ...; fragment fragment = ...; transition slidein = transitioninflater.from(this) .inflatetransition(r.transition.fragment_indicator_enter) .setduration(300) .setinterpolator(new linearinterpolator()); fragment.setentertransition(slidein); currentfragment.setexittransition(transitioninflater.from(this) .inflatetransition(r.transition.fragment_indicator_exit) .setduration(300) .setinterpolator(new linearinterpolator())); getsupportfragmentmanager() .begintransaction() .replace(r.id.fragment_container, fragment) .addtobackstack(null) .commit();
the workaround know has been add setstartdelay(30) entering transition. weird thing, have different transitions different fragments , startdelay has different produce effect of both fragment sliding left @ same time.
did try placing animations directly in transaction call?
getsupportfragmentmanager() .setcustomanimations(r.transition.fragment_indicator_enter, r.transition.fragment_indicator_exit) .begintransaction() .replace(r.id.fragment_container, fragment) .addtobackstack(null) .commit();
Comments
Post a Comment