https://github.com/pedromassango/doubleclick
A lib To handle double click on android View's components.
https://github.com/pedromassango/doubleclick
android android-development androidlibrary androidstudio java kotlin
Last synced: about 1 month ago
JSON representation
A lib To handle double click on android View's components.
- Host: GitHub
- URL: https://github.com/pedromassango/doubleclick
- Owner: pedromassango
- Created: 2017-12-20T22:44:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-30T18:26:38.000Z (over 6 years ago)
- Last Synced: 2023-03-02T13:35:57.181Z (about 2 years ago)
- Topics: android, android-development, androidlibrary, androidstudio, java, kotlin
- Language: Java
- Homepage: https://dev.to/pedromassango/double-click-listener-on-android-f0j
- Size: 213 KB
- Stars: 47
- Watchers: 1
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://jitpack.io/#pedromassango/doubleClick)
# DoubleClick on Android Views.
A android library lo handle double click on android Views components. You just need to call it on your view `onCLickListener`.
## Requirements
- Android API level 14 or greater
- Your favorite IDE## Version
The current version is: 3.0## Setting up
Gradle:
Step 1. Add the JitPack repository to your build file.
Add it in your root build.gradle at the end of repositories:
```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```Step 2. Add the dependency
```groovyimplementation 'com.github.pedromassango:doubleClick:CURRENT-VERSION'
```
Maven:
Step 1. register jitpack.io
```xml
jitpack.io
https://jitpack.io
```
Step 2. Add the dependency
```xml
com.github.pedromassango
doubleClick
CURRENT-VERSION```
## Basic usage
The class `DoubleClick` extends from `View.OnClickListener` so, just call the `DoubleClick` class on you onClickListener
of the view that you wish to listen, and pass a instance of `DoubleClickListener` class to listen the events.See the sample code below:
```java
Button btn = new Button(this);
btn.setOnClickListener( new DoubleClick(new DoubleClickListener() {
@Override
public void onSingleClick(View view) {// Single tap here.
}@Override
public void onDoubleClick(View view) {// Double tap here.
}
});
// use this to define your own interval
// }, 100));
```