3

I'm postponing transition between two fragments which both contain RecyclerViews with the trick of creating a fragment, hiding it and only show it when the RecyclerView is ready...

Like explained very well here: https://halfthought.wordpress.com/2015/06/04/postponing-fragment-transitions/

My problem is, that this does not work, as the views of the recyclerview seem to not be layout out correctly when the RecyclerView is predrawn, this results in wrong transitions (in my case the child views of the RecyclerView calculate their sizes in onCreateViewHolder and this MUST finish before the transitin starts). Now I adjusted my adapter in that way that the adapter reports when all relevant views are bound, so that I can continue the transition, but this does not work, as then the RecyclerView does not start laying out it's child views, probably because the RecyclerView is not visible yet...

Can I somehow force the RecyclerView to layout it's children even though it's hidden? Any other suggestions?

prom85
  • 16,896
  • 17
  • 122
  • 242

0 Answers0