A boring thing when some more advanced technologies impose their standards is to have to do with the "double click" to perform an action. But what I'm looking for is an easy way to implement it without having to rewrite the code a thousand times.
I would like to implement double click
in my project using Kotlin.
Could someone help me?
Thanks in Advance
just to know: I would like a way to understand how to do double click or to prevent that user do a doubleclick
I implemented this library using Kotlin, you can just define the doubleClick property and override single and double click methods, and finally add it to setOnClickListener of your button
val doubleClick = DoubleClick(object : DoubleClickListener {
override fun onSingleClickEvent(view: View?) {
// DO STUFF SINGLE CLICK
}
override fun onDoubleClickEvent(view: View?) {
// DO STUFF DOUBLE CLICK
}
})
button.setOnClickListener(doubleClick)
https://gitlab.com/developerdeveloperdeveloper/androidutilslibrary
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With