Skip to content

A lib lo handle double click on android Views components.

Notifications You must be signed in to change notification settings

AlexJuca/doubleClick

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Requirements

  • Android API level 14 or greater
  • Your favorite IDE

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:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
	        compile 'com.github.pedromassango:doubleClick:v1.1'
	}

Maven:

Step 1. register jitpack.io

<repositories>
	<repository>
	    <id>jitpack.io</id>
	    <url>https://jitpack.io</url>
	</repository>
</repositories>

Step 2. Add the dependency

<dependency>
    <groupId>com.github.pedromassango</groupId>
    <artifactId>doubleClick</artifactId>
    <version>v1.1</version>
</dependency>

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:

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.
            }
        });

About

A lib lo handle double click on android Views components.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 63.9%
  • Kotlin 36.1%