public class DragInfo extends Object
This class stores data specific to a dragging gesture that has been identified, and returns the data with the callback function.
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
Point |
downPoint |
Indicates the coordinate of the position where the finger touches the screen.
|
Point |
startPoint |
Indicates the coordinate of the position where the finger starts dragging.
|
Point |
updatePoint |
Indicates the coordinate of the update position when the finger is dragging.
|
double |
xOffset |
Indicates the horizontal offset.
|
double |
xVelocity |
Indicates the velocity of horizontal dragging, in unit of pixels per second.
|
double |
yOffset |
Indicates the vertical offset.
|
double |
yVelocity |
Indicates the velocity of vertical dragging, in unit of pixels per second.
|
public final Point downPoint
public final Point startPoint
Once the dragging gesture is identified, where the finger presses against is regarded as the
startPoint.
public final Point updatePoint
public final double xOffset
The horizontal offset is obtained compared with the previous horizontal dragging.
public final double xVelocity
public final double yOffset
The vertical offset is obtained compared with the previous vertical dragging.
public final double yVelocity
public DragInfo(Point downPoint, Point startPoint, Point updatePoint, double xOffset, double yOffset, double xVelocity, double yVelocity)
downPoint - Indicates the coordinate of the position where the finger touches the screen.startPoint - Indicates the coordinate of the position where the finger starts dragging.updatePoint - Indicates the coordinate of the update position when the finger is dragging.xOffset - Indicates the horizontal offset, in unit of pixels.yOffset - Indicates the vertical offset, in unit of pixels.xVelocity - Indicates the horizontal velocity, in unit of pixels per second.yVelocity - Indicates the vertical velocity, in unit of pixels per second.