MCPcopy Index your code
hub / github.com/Kalabasa/FreeformGestureDetector

github.com/Kalabasa/FreeformGestureDetector @1.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.0 ↗ · + Follow
19 symbols 34 edges 3 files 11 documented · 58% updated 5y ago1.0.0 · 2018-02-06★ 33
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

FreeformGestureDetector

:raised_hand: Multi-touch transform gesture detector for Android.

Sample

sample animation

sample repo

Usage

The FreeformGestureDetector class acts like a regular gesture detector. It receives a stream of MotionEvents and outputs a stream of transformation matrices.

Create an instance for your View. The callback implements FreeformGestureDetector.OnGestureListener.

FreeformGestureDetector freeformGestureDetector = new FreeformGestureDetector(getContext(), callback);

In the View's touch event handler, unconditionally call freeformGestureDetector.onTouchEvent(MotionEvent).

@Override
public boolean onTouch(View v, MotionEvent e) {
    freeformGestureDetector.onTouchEvent(e);
    // ...
}

The callback will be executed for each resulting transform event. The transformation is based on touch movements.

The transform parameter contains the accumulated transformation since the last call that the callback has returned true (Similar behavior as ScaleGestureDetector).

@Override
public boolean onTransform(MotionEvent ev, Matrix transform) {
    // Handle transform events here
    myMatrix.postConcat(transform);
    return true;
}

Installation

Add JitPack to your root build.gradle's repositories.

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

In your app's build.gradle dependencies:

dependencies {
    implementation 'com.github.Kalabasa:FreeformGestureDetector:1.0.0'
}

You can check the latest version in the Releases tab.

License

MIT.

See LICENSE file

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 15
Class 3
Interface 1

Languages

Java100%

Modules by API surface

freeformgesturedetector/src/main/java/com/github/kalabasa/freeformgesturedetector/FreeformGestureDetector.java15 symbols
freeformgesturedetector/src/test/java/com/github/kalabasa/freeformgesturedetector/ExampleUnitTest.java2 symbols
freeformgesturedetector/src/androidTest/java/com/github/kalabasa/freeformgesturedetector/ExampleInstrumentedTest.java2 symbols

For agents

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

⬇ download graph artifact

Ask about this repo answers extend the page