To get a Git project into your build:
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.CormacKrum:Double-Click-Listener:0.1.3'
}
The class DoubleClickListener
extends from View.OnClickListener
so, just call the DoubleClickListener
class on your onClickListener
of the view that you wish to listen, and pass an object of DoubleClickListener.Callback
class to listen the events.You can also add custom time difference betweens click by default is 1000ms.
- Kotlin
button.setOnClickListener(
DoubleClickListener(
callback = object : DoubleClickListener.Callback {
override fun doubleClicked() {
}
},1000
)
)
- Java
button.setOnClickListener(
DoubleClickListener(
object = new DoubleClickListener.Callback {
override fun doubleClicked() {
}
},1000
)
)
Share this release: