You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to hide certain nested Composables before capturing their parent. I tried it by using a variable like this: var isCapturing by remember { mutableStateOf(false) }
The nested Composable that should be hidden on a Capture looks like this: if (!isCapturing) { IconButton( .... ) { .... } }
Then, I trigger the Capture like this: Button( onClick = { isCapturing = true; captureController.capture() } ) { Text(text = "Save image") }
However, the element that should be hidden still appears on the resulting bitmap. It seems like before the element can hide, the capture() command is executed, that seems to block the Recomposition.
How could I solve this in an elegant way? I am thankful for any ideas and explanations.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to hide certain nested Composables before capturing their parent. I tried it by using a variable like this:
var isCapturing by remember { mutableStateOf(false) }
The nested Composable that should be hidden on a Capture looks like this:
if (!isCapturing) { IconButton( .... ) { .... } }
Then, I trigger the Capture like this:
Button( onClick = { isCapturing = true; captureController.capture() } ) { Text(text = "Save image") }
However, the element that should be hidden still appears on the resulting bitmap. It seems like before the element can hide, the capture() command is executed, that seems to block the Recomposition.
How could I solve this in an elegant way? I am thankful for any ideas and explanations.
Beta Was this translation helpful? Give feedback.
All reactions