Colton Idle
12/07/2021, 8:48 PMCasey Brooks
12/07/2021, 9:02 PMColton Idle
12/07/2021, 9:32 PMCasey Brooks
12/07/2021, 9:39 PMrunBlocking
is part of the core coroutines library on JVM/Android, and is a useful tool for anytime you have a coroutines-based API that needs to be used in a synchronous context. You need to really be careful with it and know what you're doing though, as it can very easily lead to slow or unresponsive UI if abused.Casey Brooks
12/07/2021, 9:42 PMColton Idle
12/07/2021, 9:44 PMFrancesc
12/08/2021, 12:41 AMonPredrawListener
that returns false
until whatever needs to take place has completed, in this case, reading your value from datastore. This way you can read it on a background thread and the app is responsive (albeit just showing the splash logo or animation), rather than blocking the main thread
https://developer.android.com/guide/topics/ui/splash-screen#suspend-drawingFrancesc
12/08/2021, 12:46 AM