Skip to content

Commit

Permalink
Add readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoiAiden authored and ChoiAiden committed Dec 12, 2016
1 parent 1ec3e85 commit 907d4da
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[![](https://jitpack.io/v/m0er/androidannotations-interval-click-plugin.svg)](https://jitpack.io/#m0er/androidannotations-interval-click-plugin)

# AndroidAnnotations Interval Click Plugin
An [Android Annotations](https://github.com/androidannotations/androidannotations/) custom plugin to prevent multiple click.

## Usage

Add it in your root build.gradle at the end of repositories:

```groovy
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```

Add the dependency:

```groovy
dependencies {
apt 'org.androidannotations:androidannotations:4.1.0'
compile 'org.androidannotations:androidannotations-api:4.1.0'
apt 'com.github.m0er.androidannotations-interval-click-plugin:intervalclick:1.0.1'
compile 'com.github.m0er.androidannotations-interval-click-plugin:intervalclick-api:1.0.1'
}
```

Default interval delay is 600ms.

```java
@IntervalClick
void someButton() {
Toast.makeText(this, "Click!!", Toast.LENGTH_SHORT).show();
}
```

You can customize it:

```java
@IntervalClick(intervalMilliseconds = 1000)
void someButton() {
Toast.makeText(this, "Click!!", Toast.LENGTH_SHORT).show();
}
```

0 comments on commit 907d4da

Please sign in to comment.