How to start shared element transition using Fragments?

前端 未结 8 1377
心在旅途
心在旅途 2020-12-04 06:32

I am trying to implement transitions between fragments which have \"shared elements\" as described in the new material design specs. The only method I can find is the Activi

8条回答
  •  失恋的感觉
    2020-12-04 07:28

    The shared element fragment transitions do work with ListViews, as long as the source and target views have the same (and unique) transitionName.

    If you make your list view adapter to set unique transitionNames to the views you want (e.g. some constant + specific item id) and also change your detail fragment to set the same transitionNames to the target views at runtime (onCreateView), the transitions actually work!

提交回复
热议问题