An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

        

[![](https://jitpack.io/v/pedromassango/doubleClick.svg)](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`.

![alt tag](http://chevronscode.com/media/images/android_press_again_to_exit.jpg)

## 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
```groovy

implementation '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));
```