java.lang.Object | |
↳ | sofia.view.RotateGestureDetector |
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 MotionEvent
s reported via touch.
To use this class:
RotateGestureDetector
for your
View
onTouchEvent(MotionEvent)
method ensure you call
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) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Return the current distance between the two pointers forming the gesture in progress.
Return the event time of the current event being processed.
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.
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.
Return the previous distance between the two pointers forming the gesture in progress.
Return the rotation factor from the previous rotation event to the current event. This value is defined as (#getCurrentAngle() / #getPreviousAngle()).
Return the time difference in milliseconds between the previous accepted rotation event and the current rotation event.
Returns true
if a two-finger rotate gesture is in progress.
true
if a rotate gesture is in progress, false
otherwise.