Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 330
Alex Lockwood Avatar asked Jan 11 '15 20:01

Alex Lockwood


1 Answers

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"
like image 168
George Mount Avatar answered Oct 20 '22 20:10

George Mount