LibreOffice Module android (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.mozilla.gecko.gfx.SimpleScaleGestureDetector Class Reference

A less buggy, and smoother, replacement for the built-in Android ScaleGestureDetector. More...

Collaboration diagram for org.mozilla.gecko.gfx.SimpleScaleGestureDetector:
[legend]

Classes

enum  EventType
 
class  PointerInfo
 
interface  SimpleScaleGestureListener
 

Public Member Functions

 SimpleScaleGestureDetector (SimpleScaleGestureListener listener)
 Creates a new gesture detector with the given listener. More...
 
void onTouchEvent (MotionEvent event)
 Forward touch events to this function. More...
 
float getFocusX ()
 Returns the X coordinate of the focus location (the midpoint of the two fingers). More...
 
float getFocusY ()
 Returns the Y coordinate of the focus location (the midpoint of the two fingers). More...
 
float getCurrentSpan ()
 Returns the most recent distance between the two pointers. More...
 
float getPreviousSpan ()
 Returns the second most recent distance between the two pointers. More...
 
long getEventTime ()
 Returns the time of the last event related to the gesture. More...
 
boolean isInProgress ()
 Returns true if the scale gesture is in progress and false otherwise. More...
 

Private Member Functions

int getPointersDown ()
 
int getActionIndex (MotionEvent event)
 
void onTouchStart (MotionEvent event)
 
void onTouchMove (MotionEvent event)
 
void onTouchEnd (MotionEvent event)
 
void sendScaleGesture (EventType eventType)
 
PointerInfo pointerInfoForEventIndex (MotionEvent event, int index)
 

Private Attributes

SimpleScaleGestureListener mListener
 
long mLastEventTime
 
boolean mScaleResult
 
LinkedList< PointerInfomPointerInfo
 

Static Private Attributes

static final String LOGTAG = "ScaleGestureDetector"
 

Detailed Description

A less buggy, and smoother, replacement for the built-in Android ScaleGestureDetector.

This gesture detector is more reliable than the built-in ScaleGestureDetector because:

Definition at line 36 of file SimpleScaleGestureDetector.java.

Constructor & Destructor Documentation

◆ SimpleScaleGestureDetector()

org.mozilla.gecko.gfx.SimpleScaleGestureDetector.SimpleScaleGestureDetector ( SimpleScaleGestureListener  listener)
inline

Creates a new gesture detector with the given listener.

Definition at line 47 of file SimpleScaleGestureDetector.java.

References org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mListener, and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mPointerInfo.

Member Function Documentation

◆ getActionIndex()

int org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getActionIndex ( MotionEvent  event)
inlineprivate

◆ getCurrentSpan()

float org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getCurrentSpan ( )
inline

◆ getEventTime()

long org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getEventTime ( )
inline

Returns the time of the last event related to the gesture.

Definition at line 196 of file SimpleScaleGestureDetector.java.

References org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mLastEventTime.

◆ getFocusX()

float org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getFocusX ( )
inline

Returns the X coordinate of the focus location (the midpoint of the two fingers).

If only one finger is down, returns the location of that finger.

Definition at line 137 of file SimpleScaleGestureDetector.java.

References org.mozilla.gecko.gfx.SimpleScaleGestureDetector.PointerInfo.getCurrent(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPointersDown(), Log, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.LOGTAG, and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mPointerInfo.

◆ getFocusY()

float org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getFocusY ( )
inline

Returns the Y coordinate of the focus location (the midpoint of the two fingers).

If only one finger is down, returns the location of that finger.

Definition at line 154 of file SimpleScaleGestureDetector.java.

References org.mozilla.gecko.gfx.SimpleScaleGestureDetector.PointerInfo.getCurrent(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPointersDown(), Log, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.LOGTAG, and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mPointerInfo.

◆ getPointersDown()

int org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPointersDown ( )
inlineprivate

◆ getPreviousSpan()

float org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPreviousSpan ( )
inline

◆ isInProgress()

boolean org.mozilla.gecko.gfx.SimpleScaleGestureDetector.isInProgress ( )
inline

Returns true if the scale gesture is in progress and false otherwise.

Definition at line 201 of file SimpleScaleGestureDetector.java.

References org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPointersDown().

Referenced by org.mozilla.gecko.gfx.TouchEventHandler.dispatchEvent().

◆ onTouchEnd()

void org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchEnd ( MotionEvent  event)
inlineprivate

◆ onTouchEvent()

void org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchEvent ( MotionEvent  event)
inline

◆ onTouchMove()

void org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchMove ( MotionEvent  event)
inlineprivate

◆ onTouchStart()

void org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchStart ( MotionEvent  event)
inlineprivate

◆ pointerInfoForEventIndex()

PointerInfo org.mozilla.gecko.gfx.SimpleScaleGestureDetector.pointerInfoForEventIndex ( MotionEvent  event,
int  index 
)
inlineprivate

◆ sendScaleGesture()

void org.mozilla.gecko.gfx.SimpleScaleGestureDetector.sendScaleGesture ( EventType  eventType)
inlineprivate

Member Data Documentation

◆ LOGTAG

final String org.mozilla.gecko.gfx.SimpleScaleGestureDetector.LOGTAG = "ScaleGestureDetector"
staticprivate

◆ mLastEventTime

long org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mLastEventTime
private

◆ mListener

SimpleScaleGestureListener org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mListener
private

◆ mPointerInfo

LinkedList<PointerInfo> org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mPointerInfo
private

◆ mScaleResult

boolean org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mScaleResult
private

The documentation for this class was generated from the following file: