android - Fragment ReenterTransition not working. Need help clarifying the various Fragment transitions -


i implementing fragment transition animations between items in recyclerview, , fragment showing details of clicked item. in other words relatively common...

"click on card in list , expands detailed view while rest of list disappears"

...kind of thing.

the transition recyclerview item detailed view working fine. shared elements of item transitioning new state while rest of recyclerview items fade away.

however, when backstack popped shared elements transition old state, other recyclerview items not fade in. appear instantly @ start of animation instead, can see in screen video

the activity handles quite few fragments, transaction in following generalized method:

@targetapi(build.version_codes.lollipop) public void setfragment(int fragid, bundle args, list<pair> transitionviews,         string tag, int containerid) {      // setup new fragment , transaction     fragment newfragment = fragmentfactory.newfragment(fragid, args);     fragmenttransaction fragmenttransaction = getsupportfragmentmanager().begintransaction();     fragmenttransaction.replace(containerid, newfragment, tag);     fragmenttransaction.addtobackstack(tag);      if (build.version.sdk_int >= build.version_codes.lollipop && transitionviews != null) {          // add shared elements         (int = 0; < transitionviews.size(); i++) {             final pair pair = transitionviews.get(i);             fragmenttransaction.addsharedelement((view) pair.first, (string) pair.second);         }          // setup transitions         transition transitionmove = transitioninflater.from(this).inflatetransition(android.r.transition.move);         transition transitionfade = transitioninflater.from(this).inflatetransition(android.r.transition.fade);     //        transitionfade.setduration(500);  // slow down transition see what's happening          // apply relevant transitions each fragment         newfragment.setsharedelemententertransition(transitionmove);         newfragment.setentertransition(transitionfade);         newfragment.setexittransition(transitionfade);         mcurrentfragment.setexittransition(transitionfade);         mcurrentfragment.setreentertransition(transitionfade);         mcurrentfragment.setsharedelementreturntransition(transitionmove);     }      fragmenttransaction.commit(); } 
  • i have tried playing allowing/disallowing transition overlap on enter/return.
  • i have tried playing various transition setting methods fragments.
  • i have read through loads of blogs , questions on topic.

i found http://www.androiddesignpatterns.com/2014/12/activity-fragment-transitions-in-android-lollipop-part1.html blog on topic, , brockoli's sample code helpful, have been unable solve problem.


perhaps problem understanding of each transition for?
here's how understand it.

my mcurrentfragment , newfragment have 5 different transition setters each:

  1. setsharedelemententertransition sets transition used shared elements transferred content scene.
  2. setsharedelementreturntransition sets transition used shared elements transferred during pop of stack.
  3. setentertransition sets transition used move views initial scene.
  4. setexittransition sets transition used move views out of scene when fragment removed, hidden, or detached when not popping stack.
  5. setreentertransition sets transition used move views in scene when returning due popping stack.

when setfragment method called, animation played transitioning mcurrentfragment newfragment following properties:

  • the newfragment sharedelemententertransition defines how shared elements transition newfragment.
    (in case clicked item's cardview expands , 1 of textview's contains moved)
  • the newfragment entertransition defines how remaining newfragment child views not shared elements transition onto screen.
    (in case toolbar fades in @ bottom of screen. toolbar fading in behind exiting recyclerview. there way swap it's in front?)
  • the mcurrentfragment exittransition defines how mcurrentfragment child views not shared elements transition off of screen.
    (in case mcurrentfragment contains recyclerview, effect rest of recyclerview elements fade away in background)

when backstack popped expect following occur:

  • the sharedelementreturntransition mcurrentfragment defines how shared elements transition mcurrentfragment.
    (in case cardview contracts down recyclerview item size , textview contains moved back).
  • the exittransition newfragment defines how newfragment child views not shared elements transition off of screen.
    (in case bottom toolbar fades out)
  • the reentertransition mcurrentfragment defines how remaining mcurrentfragment child views not shared elements transition onto screen.
    (in case other recyclerview items should fade in, not happening. instantly visible behind transitioning shared elements).

have misunderstood anything?


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -