SimpleFingerGestures


Source link: https://github.com/championswimmer/SimpleFingerGestures_Android_Library

SimpleFingerGestures

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

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();
  1. Implement the required gestures via this object
mySfg.setOnFingerGestureListener(new SimpleFingerGestures.OnFingerGestureListener() {

 @Override

 public boolean onSwipeUp(int fingers, long gestureDuration, double gestureDistance) {

  grtv.setText("swiped " + fingers + " up");

  return false;

 
}

  @Override

 public boolean onSwipeDown(int fingers, long gestureDuration, double gestureDistance) {

  grtv.setText("swiped " + fingers + " down");

  return false;

 
}

  @Override

 public boolean onSwipeLeft(int fingers, long gestureDuration, double gestureDistance) {

  grtv.setText("swiped " + fingers + " left");

  return false;

 
}

  @Override

 public boolean onSwipeRight(int fingers, long gestureDuration, double gestureDistance) {

  grtv.setText("swiped " + fingers + " right");

  return false;

 
}

  @Override

 public boolean onPinch(int fingers, long gestureDuration, double gestureDistance) {

  grtv.setText("pinch");

  return false;

 
}

  @Override

 public boolean onUnpinch(int fingers, long gestureDuration, double gestureDistance) {

  grtv.setText("unpinch");

  return false;

 
}

  @Override

 public boolean onDoubleTap(int fingers) {

  return false;

 
}

}
);
  1. 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 'in.championswimmer:SimpleFingerGestures_Android_Library:1.2'  
}

Documentation

Find documentation at

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

Resources

A CoordinatorLayout.Behavior<View> which interacts with an AppBarLayout as a dependency for translating and scaling a specific View of your choice.

FastTextView is faster than Android TextView. FastTextView uses StaticLayout to render Spanned String, so it supports most features of Android TextView

Android library convert image to ascii.

A beautiful fancy Button Loading.

Clean Architecture with Advanced Rx + Dagger 2.12 + Architecture Components.

This repo contains a simple list of products and send a simple transaction with apiary.

The simplest way to add reactive validation to your app.

Problem

in your application, there are fields that must be validated. When the number of validation rules becomes greater than 1, to control the display of errors in the fields becomes difficult.

Solve

Separate your validation logic by S in SOLID, into own classes. After that, attach validation rules to your fields and combine validation results for change some ui states (ex. change visibility of button)

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes