czuckie
03/28/2022, 10:28 AMComposeView
inside a Fragment
- it works well with our current navigation system, but we're noticing things like TextField
will not update consistently on text entry. The exact same composable in a ComponentActivity
works as expected. Is there some particular stuff I need to be wary of when using JC with Fragments?Stylianos Gakis
03/28/2022, 11:31 AMczuckie
03/28/2022, 11:39 AMLog.d
in, I can see that onValueChange IS being called and the value that should be rendered is being stored, and in fact, UI tests seem to think everything is hunky dory (indicating that the underlying semantic values are correct? Don't know, still new to compose 😞 ).
Currently using compose version 1.0.5 and Kotlin 1.5.31, and it's not trivial to upgrade to 1.6.10 and 1.1.0 as it's an old codebase with maybe 200+ fragments all using android synthetics that are subject to compiler issues in kotlin 1.6 I believeStylianos Gakis
03/28/2022, 11:44 AMczuckie
03/28/2022, 12:21 PMStylianos Gakis
03/28/2022, 12:26 PMsetViewCompositionStrategy(DisposeOnViewTreeLifecycleDestroyed)
. That’s the only “weird” thing we’ve had to do on the interop of these systemsczuckie
03/28/2022, 12:39 PMoverride fun onCreateView(...) {
return ComposeView(requireContext()).apply {
setContent {
// Compose magic
}
}
}
That's legit right?Stylianos Gakis
03/28/2022, 12:47 PMsetViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
in thereczuckie
03/28/2022, 12:50 PMStylianos Gakis
03/28/2022, 3:18 PM