Detects transformation gestures involving more than one pointer ("multitouch")
using the supplied MotionEvents. The RotateGestureDetector.OnRotateGestureListener
callback will notify users when a particular gesture event has occurred.
This class should only be used with MotionEvents reported via touch.
To use this class:
RotateGestureDetector
for your
View
onTouchEvent(MotionEvent)
. The methods defined in your
callback will be executed when the events occur.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | RotateGestureDetector.OnRotateGestureListener | The listener for receiving notifications when gestures occur. | |||||||||
class | RotateGestureDetector.SimpleOnRotateGestureListener | A convenience class to extend when you only want to listen for a subset of rotation-related events. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
RotateGestureDetector(Context context, RotateGestureDetector.OnRotateGestureListener listener)
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
float
|
getCurrentSlope()
Return the current distance between the two pointers forming the
gesture in progress.
| ||||||||||
long
|
getEventTime()
Return the event time of the current event being processed.
| ||||||||||
float
|
getFocusX()
Get the X coordinate of the current gesture's focal point.
| ||||||||||
float
|
getFocusY()
Get the Y coordinate of the current gesture's focal point.
| ||||||||||
float
|
getPreviousSlope()
Return the previous distance between the two pointers forming the
gesture in progress.
| ||||||||||
float
|
getRotation()
Return the rotation factor from the previous rotation event to the current
event.
| ||||||||||
long
|
getTimeDelta()
Return the time difference in milliseconds between the previous
accepted rotation event and the current rotation event.
| ||||||||||
boolean
|
isInProgress()
Returns
true if a two-finger rotate gesture is in progress. | ||||||||||
boolean
|
onTouchEvent(MotionEvent event)
|
Methods inherited from
class
java.lang.Object
| |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Object
|
clone()
| ||||||||||
boolean
|
equals(Object arg0)
| ||||||||||
void
|
finalize()
| ||||||||||
final
Class<?>
|
getClass()
| ||||||||||
int
|
hashCode()
| ||||||||||
final
void
|
notify()
| ||||||||||
final
void
|
notifyAll()
| ||||||||||
String
|
toString()
| ||||||||||
final
void
|
wait()
| ||||||||||
final
void
|
wait(long arg0, int arg1)
| ||||||||||
final
void
|
wait(long arg0)
|
Return the current distance between the two pointers forming the gesture in progress.
Distance between pointers in pixels.
Return the event time of the current event being processed.
Current event time in milliseconds.
Get the X coordinate of the current gesture's focal point.
If a gesture is in progress, the focal point is directly between
the two pointers forming the gesture.
If a gesture is ending, the focal point is the location of the
remaining pointer on the screen.
If isInProgress()
would return false, the result of this
function is undefined.
X coordinate of the focal point in pixels.
Get the Y coordinate of the current gesture's focal point.
If a gesture is in progress, the focal point is directly between
the two pointers forming the gesture.
If a gesture is ending, the focal point is the location of the
remaining pointer on the screen.
If isInProgress()
would return false, the result of this
function is undefined.
Y coordinate of the focal point in pixels.
Return the previous distance between the two pointers forming the gesture in progress.
Previous distance between pointers in pixels.
Return the rotation factor from the previous rotation event to the current event. This value is defined as (#getCurrentAngle() / #getPreviousAngle()).
The current rotation factor.
Return the time difference in milliseconds between the previous accepted rotation event and the current rotation event.
Time difference since the last rotation event in milliseconds.
Returns true
if a two-finger rotate gesture is in progress.
true
if a rotate gesture is in progress, false
otherwise.