Is there a "setSharedElementsUseOverlay()" method for Fragment transitions?
Asked Answered
E

1

8

During a shared element Activity transition, shared elements are drawn in the window decor view's ViewOverlay by default. If necessary, the developer can disable this default behavior by calling the Window#setSharedElementsUseOverlay(false) method. The Fragment class, however, does not seem to declare a similar method for Fragment transitions.

For Fragment transitions, are shared elements also drawn in a view overlay on top of the fragment's view hierarchy by default? If so, is there a way to disable the default behavior as there is in the Activity transitions API?

Eydie answered 11/1, 2015 at 20:59 Comment(0)
B
11

No, shared elements in Fragment Transitions are not drawn in the overlay by default. However, ChangeTransform can pull a shared element into the overlay when it detects that its transform and its parent transform differ. You can disable this in the ChangeTransform transition by setting

android:reparentWithOverlay="false"
Bowyer answered 12/1, 2015 at 16:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.