Hi folks, is there a substitute for `ViewTreeObser...
# compose
m
Hi folks, is there a substitute for
ViewTreeObserver.OnPreDrawListener
in Compose? Looking for a way to delay startup due to data initialization. Was looking on https://developer.android.com/about/versions/12/features/splash-screen but can’t connect it with compose.
3
n
reading the example, I'm pretty sure the compose equivalent is :
Copy code
override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContent { 
        val isReady by viewModel.isReady
        if(isReady) {
            //The composable of your app
        }
    }
}
👍 1
m
Imho the result of this code will be a blank screen 🙂
f
Not on Android 12
👍 1
However, I did not find a way to use the Splash Screen API with Compose and custom splash screen animations
m
Thanks, it’s still something! 👍
c
File a bug! I was just talking to the dev that implements this and they said to please file a bug. But file a bug and link it and I will send it to them!