Tin Tran
11/09/2023, 4:51 PMSurfaceView
like this. It’s seems like Modifier.alpha
do not have any affect.
The view is a video frame rendered by MediaCodec
so every time the surface is destroyed I release the MediaCode
so I don’t want it to be destroyed and recreated unless i’m done with it. How can I hide it on condition?
AndroidView(
factory = {
view.holder.addCallback(surfaceCallback)
view
},
modifier = Modifier
.alpha(if (condition) 1f else 0f)
.matchParentSize(),
)
shikasd
11/09/2023, 8:31 PMSurfaceView
is weird one because it does not really draw on regular canvas, that's why alpha has no effect.
I wonder if setting SurfaceView
to View.INVISIBLE
will have any effect here?Chris Fillmore
11/09/2023, 10:19 PMTin Tran
11/10/2023, 2:56 AMView.INVISIBLE
resulted in the underlying surface recreated which I don’t want….TextureView
solved my problem. Thanks guys