Android library which makes detecting gestures a breeze.
The library is built for simplicity and ease of use. It eliminates most boilerplate code for dealing with setting up gesture detection on Android.
Starting with 1.0.1, Changes exist in the releases tab.
- Flip
- onFaceUp
- onFaceDown
- Light
- onDark
- onLight
- Orientation
- onTopSideUp
- onBottomSideUp
- onLeftSideUp
- onRightSideUp
- PinchScale
- OnScale
- OnScaleStart
- OnScaleEnd
- Proximity
- onNear
- onFar
- Shake
- TouchType
- onDoubleTap
- onScroll(direction)
- onSingleTap
- onSwipeLeft
- onSwipeRight
- onLongPress
- onTwoFingerSingleTap
- onThreeFingerSingleTap
- Sensey is available in the MavenCentral, so getting it as simple as adding it as a dependency
compile 'com.github.nisrulz:sensey:1.4.0'- Initialize Sensey under your onCreate() in the activity/service
Sensey.getInstance().init(context);-
Next to enable shake detection
- Create an instance of ShakeListener
ShakeDetector.ShakeListener shakeListener=new ShakeDetector.ShakeListener() { @Override public void onShakeDetected() { // Shake detected, do something } };
- Now to start listening for Shake gesture, pass the instance
shakeListenertostartShakeDetection()function
Sensey.getInstance().startShakeDetection(shakeListener);
If you want to modify the
threshold, pass anintas valueSensey.getInstance().startShakeDetection(threshold,shakeListener);
- To stop listening for Shake gesture, pass the instance
shakeListenertostopShakeDetection()function
Sensey.getInstance().stopShakeDetection(shakeListener);
📃 For more info , check the Wiki Docs
I welcome and encourage all pull requests. It usually will take me within 24-48 hours to respond to any issue or request. Here are some basic rules to follow to ensure timely addition of your request:
- Match coding style (braces, spacing, etc.) This is best achieved using CMD+Option+L (Reformat code) on Mac (not sure for Windows) with Android Studio defaults.
- If its a feature, bugfix, or anything please only change code to what you specify.
- Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)
- Pull requests must be made against
developbranch. Any other branch (unless specified by the maintainers) will get rejected. - Check for existing issues first, before filing an issue.
- Have fun!
