Open SimonGenin opened 5 years ago
Here are the two fragments to help you visualize the concept.
From | To |
---|---|
Epoxy and MvRx don't influence the shared element transition at all, it works just like a normal Recyclerview for transitions, so set it up like you would for a regular recyclerview
@SimonGenin I think the trick is to postpone the transition when the fragment is created, and resume it in the onPreDraw
call of the RecyclerView. Here's a post by Chris Banes which illustrates how to do it: Fragment Transitions
That being said, I have always had trouble getting Shared Element Transitions working reliably between two RecyclerViews.
Hi,
I'm currently developing a project using MvRx and epoxy. I'm having troubles to make a simple shared element transition between two fragments build with the epoxy simple controller. Whatever I do, it just doesn't seem to take place.
Somebody asked a question #579 about shared elements before, not so sure if it is closely related to my problem.
First, to help me navigate through my fragments, I have set up this extension function, based on a method found in the BaseFragment code proposed in the samples.
Then, my first fragment is made of ModelViews, the one of interest here being
RouteItem
RouteItem
view codeThe reception fragment is again build with epoxy simple controller, and look as follows
So it's basically empty.
Here are the two xml layouts for my ModelViews. Notice that I set the name of the transitions on the
ImageView
.route_item.xml
, for the index view.And
header_image_component.xml
, for the details view.So, with all that, there's just no transition happening. I'm not really sure what to look into, so any help maybe ?
Also, is there a better way to access epoxy inflated views than what I do here
I don't really like the idea of looking for the view on the listener, but I can't see how I could access the view in another way, everything else I tried ended up in NullPointerException.
Thanks for your help and your great libraries :-)