gesto

Additional

Language
Java
Version
0.1.1 (Jul 18, 2018)
Created
Jan 13, 2018
Updated
Jul 18, 2018
Owner
Gaurav (aboutgaurav)
Contributor
Gaurav (aboutgaurav)
1
Activity
Badge
Generate
Download
Source code
APK file

Announcement

gesto

A simple gesture detection library for android.

USES

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{
 implementation 'com.github.aboutgaurav:gesto:0.1.1'
}

Step 3. Obtain your view refernce and set listener

//Obtain your view reference
    View view = findViewById(R.id.view);

//Set listener
    view.setOnTouchListener(new OnGestureListener(this) {
        @Override
        public void onSwipeRight() {
            super.onSwipeRight();
            //todo
        }

        @Override
        public void onSwipeLeft() {
            super.onSwipeLeft();
            //todo
        }

        @Override
        public void onSwipeTop() {
            super.onSwipeTop();
            //todo
        }

        @Override
        public void onSwipeBottom() {
            super.onSwipeBottom();
            //todo
        }

        @Override
        public void onClick() {
            super.onClick();
            //todo
        }

        @Override
        public void onDoubleClick() {
            super.onDoubleClick();
            //todo
        }

        @Override
        public void onLongClick() {
            super.onLongClick();
            //todo
        }}

    );

To remove gesture listener

view.setOnTouchListener(null);