Created
March 3, 2025 16:08
-
-
Save vitoksmile/4faa0b57049678f96ef444660f715789 to your computer and use it in GitHub Desktop.
Mastering delays in Android
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
fun View.postDelayed(timeout: Duration, action: Runnable) { | |
postDelayed(action, timeout.inWholeMilliseconds) | |
doOnDetach { removeCallbacks(action) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment