MCPcopy Index your code
hub / github.com/championswimmer/SimpleFingerGestures_Android_Library

github.com/championswimmer/SimpleFingerGestures_Android_Library @1.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.2 ↗ · + Follow
155 symbols 321 edges 12 files 11 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SimpleFingerGestures

An android library to implement simple 1 or 2 finger gestures easily

Build Status Android Arsenal Release

Example


Library

The library is inside the libSFG folder

Sample App

The sample App is inside the sample folder

Implementing SimpleFingerGestures

  1. Create an object of class SimpleFingerGestures

    private SimpleFingerGestures mySfg = new SimpleFingerGestures();
    
  2. Implement the required gestures via this object

    mySfg.setOnFingerGestureListener(new SimpleFingerGestures.OnFingerGestureListener() {
                @Override
                public boolean onSwipeUp(int fingers, long gestureDuration) {
                    grtv.setText("swiped " + fingers + " up");
                    return false;
                }
    
                @Override
                public boolean onSwipeDown(int fingers, long gestureDuration) {
                    grtv.setText("swiped " + fingers + " down");
                    return false;
                }
    
                @Override
                public boolean onSwipeLeft(int fingers, long gestureDuration) {
                    grtv.setText("swiped " + fingers + " left");
                    return false;
                }
    
                @Override
                public boolean onSwipeRight(int fingers, long gestureDuration) {
                    grtv.setText("swiped " + fingers + " right");
                    return false;
                }
    
                @Override
                public boolean onPinch(int fingers, long gestureDuration) {
                    grtv.setText("pinch");
                    return false;
                }
    
                @Override
                public boolean onUnpinch(int fingers, long gestureDuration) {
                    grtv.setText("unpinch");
                    return false;
                }
            });
    
  3. And finally set this object onto your view's OnTouchListener

    myView.setOnTouchListener(mySfg);
    

    This can be set as the OnTouchListener of any object that is derived from android.view.View

How to add to your project

The easiest way to add to your project is the download the latest zip from the Releases tab. Inside you'll find a compiled library in .jar format that you can just drop in to the libs folder of your Android app project for it to get automatically added as a library

Also you can add it using jitpack maven distribution.
Add the jitpack maven repository

    repositories {
        jcenter()
        maven {
            url "https://jitpack.io"
        }
    }

Add the dependency

    dependencies {
            compile 'com.github.championswimmer:SimpleFingerGestures_Android_Library:1.1'
    }

Documentation

Find documentation at

http://championswimmer.github.io/SimpleFingerGestures_Android_Library/documentation

Extension points exported contracts — how you extend this code

OnFingerGestureListener (Interface)
Interface definition for the callback to be invoked when 2-finger gestures are performed [1 implementers]
libSFG/src/main/java/in/championswimmer/sfg/lib/SimpleFingerGestures.java

Core symbols most depended-on inside this repo

getGestureDuration
called by 22
libSFG/src/main/java/in/championswimmer/sfg/lib/GestureAnalyser.java
getGestureDistance
called by 22
libSFG/src/main/java/in/championswimmer/sfg/lib/GestureAnalyser.java
initialFingDist
called by 16
libSFG/src/main/java/in/championswimmer/sfg/lib/GestureAnalyser.java
finalFingDist
called by 16
libSFG/src/main/java/in/championswimmer/sfg/lib/GestureAnalyser.java
y
called by 14
documentation/assets/prettify.js
writeCookie
called by 10
documentation/assets/doclava-developer-docs.js
C
called by 10
documentation/assets/prettify.js
readCookie
called by 9
documentation/assets/doclava-developer-docs.js

Shape

Function 111
Method 39
Class 4
Interface 1

Languages

TypeScript72%
Java28%

Modules by API surface

documentation/assets/doclava-developer-docs.js30 symbols
documentation/assets/prettify.js26 symbols
documentation/assets/jquery-resizable.min.js24 symbols
documentation/assets/doclava-developer-reference.js19 symbols
libSFG/src/main/java/in/championswimmer/sfg/lib/SimpleFingerGestures.java18 symbols
libSFG/src/main/java/in/championswimmer/sfg/lib/GestureAnalyser.java17 symbols
documentation/assets/search_autocomplete.js11 symbols
sample/src/main/java/in/championswimmer/sfg/sample/MainActivity.java9 symbols
documentation/assets/jquery-history.js1 symbols

For agents

$ claude mcp add SimpleFingerGestures_Android_Library \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact