LibreOffice Module android (master) 1
|
A less buggy, and smoother, replacement for the built-in Android ScaleGestureDetector. More...
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< PointerInfo > | mPointerInfo |
Static Private Attributes | |
static final String | LOGTAG = "ScaleGestureDetector" |
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.
|
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.
|
inlineprivate |
Definition at line 80 of file SimpleScaleGestureDetector.java.
Referenced by org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchEnd(), and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchStart().
|
inline |
Returns the most recent distance between the two pointers.
Definition at line 168 of file SimpleScaleGestureDetector.java.
References org.mozilla.gecko.gfx.PointUtils.distance(), 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.
|
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.
|
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.
|
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.
|
inlineprivate |
Definition at line 76 of file SimpleScaleGestureDetector.java.
References org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mPointerInfo.
Referenced by org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getCurrentSpan(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getFocusX(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getFocusY(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPreviousSpan(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.isInProgress(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchEnd(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchEvent(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchMove(), and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchStart().
|
inline |
Returns the second most recent distance between the two pointers.
Definition at line 179 of file SimpleScaleGestureDetector.java.
References a, org.mozilla.gecko.gfx.PointUtils.distance(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.PointerInfo.getCurrent(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPointersDown(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.PointerInfo.getPrevious(), Log, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.LOGTAG, and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mPointerInfo.
|
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().
|
inlineprivate |
Definition at line 107 of file SimpleScaleGestureDetector.java.
References action, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.EventType.END, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getActionIndex(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.PointerInfo.getId(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPointersDown(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mLastEventTime, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mPointerInfo, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.PointerInfo.recycle(), and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.sendScaleGesture().
Referenced by org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchEvent().
|
inline |
Forward touch events to this function.
Definition at line 53 of file SimpleScaleGestureDetector.java.
References org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPointersDown(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchEnd(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchMove(), and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchStart().
Referenced by org.mozilla.gecko.gfx.TouchEventHandler.dispatchEvent().
|
inlineprivate |
Definition at line 93 of file SimpleScaleGestureDetector.java.
References org.mozilla.gecko.gfx.SimpleScaleGestureDetector.EventType.CONTINUE, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPointersDown(), i, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mLastEventTime, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.pointerInfoForEventIndex(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.PointerInfo.populate(), and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.sendScaleGesture().
Referenced by org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchEvent().
|
inlineprivate |
Definition at line 85 of file SimpleScaleGestureDetector.java.
References org.mozilla.gecko.gfx.SimpleScaleGestureDetector.EventType.BEGIN, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.PointerInfo.create(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getActionIndex(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPointersDown(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mLastEventTime, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mPointerInfo, and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.sendScaleGesture().
Referenced by org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchEvent().
|
inlineprivate |
Definition at line 228 of file SimpleScaleGestureDetector.java.
References index, and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mPointerInfo.
Referenced by org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchMove().
|
inlineprivate |
Definition at line 206 of file SimpleScaleGestureDetector.java.
References BEGIN, END, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mListener, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.mScaleResult, org.mozilla.gecko.gfx.SimpleScaleGestureDetector.SimpleScaleGestureListener.onScale(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.SimpleScaleGestureListener.onScaleBegin(), and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.SimpleScaleGestureListener.onScaleEnd().
Referenced by org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchEnd(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchMove(), and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchStart().
|
staticprivate |
Definition at line 37 of file SimpleScaleGestureDetector.java.
Referenced by org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getCurrentSpan(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getFocusX(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getFocusY(), and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPreviousSpan().
|
private |
Definition at line 40 of file SimpleScaleGestureDetector.java.
Referenced by org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getEventTime(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchEnd(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchMove(), and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchStart().
|
private |
Definition at line 39 of file SimpleScaleGestureDetector.java.
Referenced by org.mozilla.gecko.gfx.SimpleScaleGestureDetector.sendScaleGesture(), and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.SimpleScaleGestureDetector().
|
private |
Definition at line 44 of file SimpleScaleGestureDetector.java.
Referenced by org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getCurrentSpan(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getFocusX(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getFocusY(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPointersDown(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.getPreviousSpan(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchEnd(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.onTouchStart(), org.mozilla.gecko.gfx.SimpleScaleGestureDetector.pointerInfoForEventIndex(), and org.mozilla.gecko.gfx.SimpleScaleGestureDetector.SimpleScaleGestureDetector().
|
private |
Definition at line 41 of file SimpleScaleGestureDetector.java.
Referenced by org.mozilla.gecko.gfx.SimpleScaleGestureDetector.sendScaleGesture().