Skip to content

Most visited

Recently visited

navigation

ScaleGestureDetector.SimpleOnScaleGestureListener

public static class ScaleGestureDetector.SimpleOnScaleGestureListener
extends Object implements ScaleGestureDetector.OnScaleGestureListener

java.lang.Object
   ↳ android.view.ScaleGestureDetector.SimpleOnScaleGestureListener


A convenience class to extend when you only want to listen for a subset of scaling-related events. This implements all methods in ScaleGestureDetector.OnScaleGestureListener but does nothing. onScale(ScaleGestureDetector) returns false so that a subclass can retrieve the accumulated scale factor in an overridden onScaleEnd. onScaleBegin(ScaleGestureDetector) returns true.

Summary

Public constructors

ScaleGestureDetector.SimpleOnScaleGestureListener()

Public methods

boolean onScale(ScaleGestureDetector detector)

Responds to scaling events for a gesture in progress.

boolean onScaleBegin(ScaleGestureDetector detector)

Responds to the beginning of a scaling gesture.

void onScaleEnd(ScaleGestureDetector detector)

Responds to the end of a scale gesture.

Inherited methods

From class java.lang.Object
From interface android.view.ScaleGestureDetector.OnScaleGestureListener

Public constructors

ScaleGestureDetector.SimpleOnScaleGestureListener

Added in API level 8
ScaleGestureDetector.SimpleOnScaleGestureListener ()

Public methods

onScale

Added in API level 8
boolean onScale (ScaleGestureDetector detector)

Responds to scaling events for a gesture in progress. Reported by pointer motion.

Parameters
detector ScaleGestureDetector: The detector reporting the event - use this to retrieve extended info about event state.
Returns
boolean Whether or not the detector should consider this event as handled. If an event was not handled, the detector will continue to accumulate movement until an event is handled. This can be useful if an application, for example, only wants to update scaling factors if the change is greater than 0.01.

onScaleBegin

Added in API level 8
boolean onScaleBegin (ScaleGestureDetector detector)

Responds to the beginning of a scaling gesture. Reported by new pointers going down.

Parameters
detector ScaleGestureDetector: The detector reporting the event - use this to retrieve extended info about event state.
Returns
boolean Whether or not the detector should continue recognizing this gesture. For example, if a gesture is beginning with a focal point outside of a region where it makes sense, onScaleBegin() may return false to ignore the rest of the gesture.

onScaleEnd

Added in API level 8
void onScaleEnd (ScaleGestureDetector detector)

Responds to the end of a scale gesture. Reported by existing pointers going up. Once a scale has ended, getFocusX() and getFocusY() will return focal point of the pointers remaining on the screen.

Parameters
detector ScaleGestureDetector: The detector reporting the event - use this to retrieve extended info about event state.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.