public class

Pinch

extends Gesture
java.lang.Object
   ↳ com.neomades.gesture.Gesture
     ↳ com.neomades.gesture.Pinch

Class Overview

Represents a pinch gesture. A pinch occurs when two fingers press the screen at the same time and get closer (pinch-in) or move away (pinch-out) to each other. This event can be obtained by using onPinchGesture(Pinch, com.neomades.ui.View).

To track for pinch event on a View use a GestureDetector .

Summary

Public Constructors
Pinch()
Public Methods
int getFocusX()
Returns the x coordinate of the center point of the pinch in pixel.
int getFocusY()
Returns the y coordinate of the center point of the pinch in pixel.
float getScale()
Returns the current scale of the pinch

(the ratio is calculated with : the current distance between the 2 fingers / the initial distance between the 2 fingers)

float getVelocity()
[Expand]
Inherited Methods
From class com.neomades.gesture.Gesture
From class java.lang.Object

Public Constructors

public Pinch ()

Public Methods

public int getFocusX ()

Returns the x coordinate of the center point of the pinch in pixel.

Returns
  • the x coordinate of the center point of the pinch

public int getFocusY ()

Returns the y coordinate of the center point of the pinch in pixel.

Returns
  • the y coordinate of the center point of the pinch

public float getScale ()

Returns the current scale of the pinch

(the ratio is calculated with : the current distance between the 2 fingers / the initial distance between the 2 fingers)

Returns
  • the current scale of the pinch

public float getVelocity ()