Entirely out of my depth so any help most welcome!...
# compose-wear
g
Entirely out of my depth so any help most welcome! 🙂
y
I like this, the screen implicitly knows that it shouldn't be open as soon as there is a connection by any means.
s
Looks good to me. I can see that the app now has just one Scaffold and is passing UIState into the screens, including the navHostController - and the check for whether the screen is in the background or foreground is working too. The LaunchedEffect code above looks like the right approach - you might need to key it on both screenStarted and connectionStatus so that it reacts when either of them changes.
g
Thanks! I'll take another look. And I've realised I'm setting the visibility of timetext directly in the compostable. Is this wrong? Does this constitute a side effect so I should be doing in the LaunchedEffect?
s
Yes, state changes should be made in one of the SideEffect APIs, so LaunchedEffect, DisposableEffect or SideEffect.
👍 1
👍🏻 1