https://github.com/jayantgoel001/double-click-listener
https://github.com/jayantgoel001/double-click-listener
android double-click jitpack kotlin
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jayantgoel001/double-click-listener
- Owner: JayantGoel001
- Created: 2020-07-30T20:05:23.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-30T21:25:39.000Z (about 5 years ago)
- Last Synced: 2025-04-07T03:36:20.067Z (6 months ago)
- Topics: android, double-click, jitpack, kotlin
- Language: Kotlin
- Homepage:
- Size: 143 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Double-Click-Listener
How to
To get a Git project into your build:
## Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
## Step 2. Add the dependency
dependencies {
implementation 'com.github.CormacKrum:Double-Click-Listener:0.1.3'
}# Basic Usage
The class
DoubleClickListener
extends fromView.OnClickListener
so, just call theDoubleClickListener
class on your onClickListener
of the view that you wish to listen, and pass an object ofDoubleClickListener.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:
[](https://jitpack.io/#CormacKrum/Double-Click-Listener)