Introduce Modifier.drawInContainer() and .drawInOverlay() (1/2)
This CL introduces 3 new modifiers:
- Modifier.container() to define a container in which composables can
be drawn.
- Modifier.drawInContainer() to conditionally draw a composable in a
container.
- Modifier.drawInOverlay() to draw a composable in an Android overlay,
i.e. above everything.
Most of the logic in DrawInContainer.kt was forked from AndroidX
implementation of RenderInTransitionOverlayNodeElement.kt [1]. I decided
to change the name "overlay" there to "container" to avoid confusing
them with Android overlays or even SceneTransitionLayout overlays.
The drawInOverlay() modifier is currently a @Composable factory because
of b/374907972.
[1] http://shortn/_hUx8cyTKAw
Bug: 373799480
Test: atest DrawInContainerScreenshotTest
Flag: com.android.systemui.scene_container
Change-Id: I415c6079e8ac8cf28804ca0fef350dc5d66b3609
2 files changed