Is there a setSharedElementsUseOverlay () method for Fragment transitions?

Over the course of a common element. Activity transition. By default, separated items are drawn in the decor ViewOverlay window. If necessary, the developer can disable this default behavior by calling the Window#setSharedElementsUseOverlay(false) method. However, the Fragment class does not declare a similar method for Fragment transitions.

For Fragment transitions, are common elements also pulled in the view overlet over the default hierarchy of fragment views? If so, is there a way to disable the default behavior, as in the activity transition API?

+6
source share
1 answer

No, common elements in the Fragments transitions do not overlap the overlay by default. However, ChangeTransform can pull the common element into the overlay when it discovers that its transformation and its parent transformation are different. You can disable this in the case of the ChangeTransform transition by setting

 android:reparentWithOverlay="false" 
+7
source

Source: https://habr.com/ru/post/980841/


All Articles