Created
April 9, 2026 19:15
-
-
Save LethalMaus/a59aaf6f105f93acf73c04514d58c487 to your computer and use it in GitHub Desktop.
Post-draw startup deferral pseudocode for article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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