public class TransformedMotionEvent
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TransformedMotionEvent.TransformDiff |
Modifier and Type | Method and Description |
---|---|
static float |
calcSnapArea(float radius,
float snapRangeInPixel,
float pixelDensity) |
static float |
distance(float[] pos1,
float[] pos2) |
static float |
distance(float pos1X,
float pos1Y,
float pos2X,
float pos2Y) |
int |
getActionMasked()
Return the kind of action being performed.
|
float[] |
getInterpolatedPosition(float[] dest) |
int |
getPointerCount()
The number of pointers of data contained in this event.
|
float[] |
getPosition(int index)
Get the transformed pos of the point.
|
float[] |
getPosition(int index,
float[] dest)
Get the transformed pos of the point.
|
android.view.MotionEvent |
getRawEvent() |
TransformedMotionEvent |
getScreenEvent() |
TransformedMotionEvent.TransformDiff |
getTransformDifference()
Return the differences to the checkpoint.
|
boolean |
hasClicked()
Check if the event is a click.
|
boolean |
hasDoubleTapped() |
boolean |
hasFixedCenterPoint()
Return if the event has a fixed center point to emulate a multitouch rotating and scaling Event.
|
boolean |
isCheckpoint()
If this return true you must saveImage your current state.
|
boolean |
isRelease() |
static float |
mapFromSnapSystem(float angle,
float[] sortedSnapPoints,
float snapArea) |
static float |
mapToSnapSystem(float angle,
float[] sortedSnapPoints,
float snapArea) |
static TransformedMotionEvent |
obtain(android.view.MotionEvent event) |
static TransformedMotionEvent |
obtain(android.view.MotionEvent event,
android.graphics.Matrix matrix) |
void |
recycle() |
void |
setFixedCenterPoint(float[] pos)
Set a center point to emulate a multitouch rotating and scaling Event
|
void |
setFixedCenterPoint(float x,
float y)
Set a center point to emulate a multitouch rotating and scaling Event
|
public static TransformedMotionEvent obtain(android.view.MotionEvent event)
public static TransformedMotionEvent obtain(android.view.MotionEvent event, android.graphics.Matrix matrix)
public void recycle()
public static float distance(float pos1X, float pos1Y, float pos2X, float pos2Y)
public static float distance(float[] pos1, float[] pos2)
@NonNull public TransformedMotionEvent.TransformDiff getTransformDifference()
public int getPointerCount()
public void setFixedCenterPoint(float[] pos)
pos
- center point array {x, y}.public void setFixedCenterPoint(float x, float y)
x
- center point x.y
- center point y.public boolean isCheckpoint()
getTransformDifference()
public android.view.MotionEvent getRawEvent()
public TransformedMotionEvent getScreenEvent()
public boolean hasFixedCenterPoint()
public boolean hasClicked()
public boolean hasDoubleTapped()
public boolean isRelease()
public int getActionMasked()
getActionMasked()
and MotionEvent.getActionIndex()
to retrieve
the separate masked action and pointer index.MotionEvent.ACTION_DOWN
or
the combination of MotionEvent.ACTION_POINTER_DOWN
with a shifted pointer index.public float[] getPosition(int index)
index
- point index @see #getPointerCountpublic float[] getPosition(int index, float[] dest)
index
- point index @see #getPointerCountpublic float[] getInterpolatedPosition(float[] dest)
@CheckResult public static float calcSnapArea(float radius, float snapRangeInPixel, float pixelDensity)
@CheckResult public static float mapToSnapSystem(float angle, float[] sortedSnapPoints, float snapArea)
@CheckResult public static float mapFromSnapSystem(float angle, float[] sortedSnapPoints, float snapArea)