Open WildOrangutan opened 4 days ago
I guess code should look like below. But I think this should be handled by rememberOnGestureListener
. What do you think?
@Composable
private fun AR(selectedOption: String?) {
val currentOption by rememberUpdatedState(selectedOption)
ARScene(
onGestureListener = rememberOnGestureListener(
onSingleTapConfirmed = { event, node ->
Log.d("AR", "Single tap confirmed (option: $currentOption)")
}
)
)
}
Hi,
Yes, you're right, a lambda shouldn't be remembered. Could you please create a PR to fix it?
Thanks
Could you please create a PR to fix it?
Can't make any promises, sorry. I'm not invested in your library yet. I'm still exploring my options for AR implementation.
Problem
When
rememberOnGestureListener
is recomposed, listeners are not updated.Example
Please see example below.
After "option" is selected by using bottom sheet (e.g. "First"), you would expect that
"Single tap confirmed (option: First)"
is printed to console. Instead"Single tap confirmed (option: null)"
is shown.