Last active
August 7, 2023 13:19
-
-
Save tpakis/508d1a7c15d495cf3345930123d49418 to your computer and use it in GitHub Desktop.
This file contains 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.setOnCLick(intervalMillis: Long = 0, doClick: (View) -> Unit) = | |
setOnClickListener(DebouncingOnClickListener(intervalMillis = intervalMillis, doClick = doClick)) | |
// use it like this | |
my_button.setOnCLick(intervalMillis = 500) { | |
// Do stuff | |
} | |
// or this | |
my_button.setOnCLick { | |
// Do stuff | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment