File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ [ ![ ] ( https://jitpack.io/v/m0er/androidannotations-interval-click-plugin.svg )] ( https://jitpack.io/#m0er/androidannotations-interval-click-plugin )
2+
3+ # AndroidAnnotations Interval Click Plugin
4+ An [ Android Annotations] ( https://github.com/androidannotations/androidannotations/ ) custom plugin to prevent multiple click.
5+
6+ ## Usage
7+
8+ Add it in your root build.gradle at the end of repositories:
9+
10+ ``` groovy
11+ allprojects {
12+ repositories {
13+ ...
14+ maven { url "https://jitpack.io" }
15+ }
16+ }
17+ ```
18+
19+ Add the dependency:
20+
21+ ``` groovy
22+ dependencies {
23+ apt 'org.androidannotations:androidannotations:4.1.0'
24+ compile 'org.androidannotations:androidannotations-api:4.1.0'
25+ apt 'com.github.m0er.androidannotations-interval-click-plugin:intervalclick:1.0.1'
26+ compile 'com.github.m0er.androidannotations-interval-click-plugin:intervalclick-api:1.0.1'
27+ }
28+ ```
29+
30+ Default interval delay is 600ms.
31+
32+ ``` java
33+ @IntervalClick
34+ void someButton() {
35+ Toast . makeText(this , " Click!!" , Toast . LENGTH_SHORT ). show();
36+ }
37+ ```
38+
39+ You can customize it:
40+
41+ ``` java
42+ @IntervalClick (intervalMilliseconds = 1000 )
43+ void someButton() {
44+ Toast . makeText(this , " Click!!" , Toast . LENGTH_SHORT ). show();
45+ }
46+ ```
You can’t perform that action at this time.
0 commit comments