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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -