java.lang.Object | |
↳ | android.view.ScaleGestureDetector |
Detects transformation gestures involving more than one pointer ("multitouch")
using the supplied MotionEvent
s. The ScaleGestureDetector.OnScaleGestureListener
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:
ScaleGestureDetector
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ScaleGestureDetector.OnScaleGestureListener | The listener for receiving notifications when gestures occur. | ||||||||||
ScaleGestureDetector.SimpleOnScaleGestureListener | A convenience class to extend when you only want to listen for a subset of scaling-related events. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the current distance between the two pointers forming the
gesture in progress.
| |||||||||||
Return the current x distance between the two pointers forming the
gesture in progress.
| |||||||||||
Return the current y 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.
| |||||||||||
Get the Y coordinate of the current gesture's focal point.
| |||||||||||
Return the previous distance between the two pointers forming the
gesture in progress.
| |||||||||||
Return the previous x distance between the two pointers forming the
gesture in progress.
| |||||||||||
Return the previous y distance between the two pointers forming the
gesture in progress.
| |||||||||||
Return the scaling factor from the previous scale event to the current
event.
| |||||||||||
Return the time difference in milliseconds between the previous
accepted scaling event and the current scaling event.
| |||||||||||
Returns
true if a two-finger scale gesture is in progress. | |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Return the current distance between the two pointers forming the gesture in progress.
Return the current x distance between the two pointers forming the gesture in progress.
Return the current y 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 previous x distance between the two pointers forming the gesture in progress.
Return the previous y distance between the two pointers forming the gesture in progress.
Return the scaling factor from the previous scale event to the current
event. This value is defined as
(getCurrentSpan()
/ getPreviousSpan()
).
Return the time difference in milliseconds between the previous accepted scaling event and the current scaling event.
Returns true
if a two-finger scale gesture is in progress.
true
if a scale gesture is in progress, false
otherwise.