public static final class MotionEvent.PointerCoords extends Object
MotionEvent
objects and to query pointer coordinates
in bulk.
Refer to InputDevice
for information about how different kinds of
input devices and sources represent pointer coordinates.Modifier and Type | Field and Description |
---|---|
float |
orientation
The orientation of the touch area and tool area in radians clockwise from vertical.
|
float |
pressure
A normalized value that describes the pressure applied to the device
by a finger or other tool.
|
float |
size
A normalized value that describes the approximate size of the pointer touch area
in relation to the maximum detectable size of the device.
|
float |
toolMajor
The length of the major axis of an ellipse that describes the size of
the approaching tool.
|
float |
toolMinor
The length of the minor axis of an ellipse that describes the size of
the approaching tool.
|
float |
touchMajor
The length of the major axis of an ellipse that describes the touch area at
the point of contact.
|
float |
touchMinor
The length of the minor axis of an ellipse that describes the touch area at
the point of contact.
|
float |
x
The X component of the pointer movement.
|
float |
y
The Y component of the pointer movement.
|
Constructor and Description |
---|
MotionEvent.PointerCoords()
Creates a pointer coords object with all axes initialized to zero.
|
MotionEvent.PointerCoords(MotionEvent.PointerCoords other)
Creates a pointer coords object as a copy of the
contents of another pointer coords object.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the contents of this object.
|
void |
copyFrom(MotionEvent.PointerCoords other)
Copies the contents of another pointer coords object.
|
static MotionEvent.PointerCoords[] |
createArray(int size) |
float |
getAxisValue(int axis)
Gets the value associated with the specified axis.
|
void |
setAxisValue(int axis,
float value)
Sets the value associated with the specified axis.
|
public float x
MotionEvent.AXIS_X
public float y
MotionEvent.AXIS_Y
public float pressure
MotionEvent.AXIS_PRESSURE
public float size
MotionEvent.AXIS_SIZE
public float touchMajor
MotionEvent.AXIS_TOUCH_MAJOR
public float touchMinor
MotionEvent.AXIS_TOUCH_MINOR
public float toolMajor
MotionEvent.AXIS_TOOL_MAJOR
public float toolMinor
MotionEvent.AXIS_TOOL_MINOR
public float orientation
MotionEvent.AXIS_ORIENTATION
public MotionEvent.PointerCoords()
public MotionEvent.PointerCoords(MotionEvent.PointerCoords other)
other
- The pointer coords object to copy.public static MotionEvent.PointerCoords[] createArray(int size)
public void clear()
public void copyFrom(MotionEvent.PointerCoords other)
other
- The pointer coords object to copy.public float getAxisValue(int axis)
axis
- The axis identifier for the axis value to retrieve.MotionEvent.AXIS_X
,
MotionEvent.AXIS_Y
public void setAxisValue(int axis, float value)
axis
- The axis identifier for the axis value to assign.value
- The value to set.MotionEvent.AXIS_X
,
MotionEvent.AXIS_Y