Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save LethalMaus/a59aaf6f105f93acf73c04514d58c487 to your computer and use it in GitHub Desktop.

Select an option

Save LethalMaus/a59aaf6f105f93acf73c04514d58c487 to your computer and use it in GitHub Desktop.
Post-draw startup deferral pseudocode for article
var postDrawWorkEnabled by remember { mutableStateOf(false) }
onFirstFrameRendered {
markStartupComplete()
postDrawWorkEnabled = true
}
onScreenVisible(postDrawWorkEnabled) {
updateConnectivityFlags()
if (postDrawWorkEnabled) {
probePeripheralState()
validateNetworkState()
}
}
when(postDrawWorkEnabled && networkIsAvailable) {
runInitialServerCheck()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment