Ash
09/21/2021, 11:51 PMAsh
09/21/2021, 11:51 PMAsh
09/21/2021, 11:52 PMAsh
09/21/2021, 11:53 PMAsh
09/21/2021, 11:56 PMadjpd
09/22/2021, 12:01 AM"This preview was unable to find a CompositionLocal. You might need to define it so it can render correctly. Show Exception"I suspect you're defining your CL high up in your hierarchy. But you're previewing something lower down.
Ash
09/22/2021, 12:22 AMAsh
09/22/2021, 12:23 AMromainguy
09/22/2021, 12:40 AMSurfaceView
or TextureView
won’t preview properly anywayAsh
09/22/2021, 12:47 AMromainguy
09/22/2021, 4:40 AMSurface/TextureView
Carl Benson
09/22/2021, 8:42 AM@Composable
fun ComposableUsingSurfaceView(
...,
surfaceViewComposable: @Composable () -> Unit
) {
...composables
surfaceViewComposable()
...composables
}
@Preview
@Composable
fun PreviewComposable() {
ComposableUsingSurfaceView(...) {
Box(...modifiers) {
Text("Surface preview")
}
}
and in runtime composable you use your surfaceview composableAsh
09/22/2021, 4:22 PM