# ScaleGestureDetector.SimpleOnScaleGestureListener

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# SimpleOnScaleGestureListener

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/view/ScaleGestureDetector.SimpleOnScaleGestureListener "View this page in Java")  

```
open class SimpleOnScaleGestureListener : ScaleGestureDetector.OnScaleGestureListener
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                                   ||
| ↳ | [android.view.ScaleGestureDetector.SimpleOnScaleGestureListener](https://developer.android.com/reference/kotlin/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[OnScaleGestureListener](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector.OnScaleGestureListener)but does nothing.[OnScaleGestureListener.onScale(ScaleGestureDetector)](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector.OnScaleGestureListener#onScale(android.view.ScaleGestureDetector))returns`false`so that a subclass can retrieve the accumulated scale factor in an overridden onScaleEnd.[OnScaleGestureListener.onScaleBegin(ScaleGestureDetector)](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector.OnScaleGestureListener#onScaleBegin(android.view.ScaleGestureDetector))returns`true`.

## Summary

|                                                                                    Public constructors                                                                                     ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [SimpleOnScaleGestureListener](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector.SimpleOnScaleGestureListener#SimpleOnScaleGestureListener())`()` <br /> |

|                                                                                                                                                                                                                 Public methods                                                                                                                                                                                                                  ||
|----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onScale](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector.SimpleOnScaleGestureListener#onScale(android.view.ScaleGestureDetector))`(`detector:` `[ScaleGestureDetector](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector)`)` Responds to scaling events for a gesture in progress.     |
| open[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onScaleBegin](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector.SimpleOnScaleGestureListener#onScaleBegin(android.view.ScaleGestureDetector))`(`detector:` `[ScaleGestureDetector](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector)`)` Responds to the beginning of a scaling gesture. |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)       | [onScaleEnd](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector.SimpleOnScaleGestureListener#onScaleEnd(android.view.ScaleGestureDetector))`(`detector:` `[ScaleGestureDetector](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector)`)` Responds to the end of a scale gesture.             |

## Public constructors

### SimpleOnScaleGestureListener

```
SimpleOnScaleGestureListener()
```

## Public methods

### onScale

Added in[API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onScale(detector: ScaleGestureDetector): Boolean
```

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

|                                                                    Parameters                                                                    ||
|------------|--------------------------------------------------------------------------------------------------------------------------------------|
| `detector` | [ScaleGestureDetector](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector):This value cannot be`null`. |

|                                                                                                                                                                                            Return                                                                                                                                                                                            ||
|------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | 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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onScaleBegin(detector: ScaleGestureDetector): Boolean
```

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

|                                                                    Parameters                                                                    ||
|------------|--------------------------------------------------------------------------------------------------------------------------------------|
| `detector` | [ScaleGestureDetector](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector):This value cannot be`null`. |

|                                                                                                                                                              Return                                                                                                                                                              ||
|------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | 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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun onScaleEnd(detector: ScaleGestureDetector): Unit
```

Responds to the end of a scale gesture. Reported by existing pointers going up. Once a scale has ended,[ScaleGestureDetector.getFocusX()](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector#getFocusX())and[ScaleGestureDetector.getFocusY()](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector#getFocusY())will return focal point of the pointers remaining on the screen.

|                                                                    Parameters                                                                    ||
|------------|--------------------------------------------------------------------------------------------------------------------------------------|
| `detector` | [ScaleGestureDetector](https://developer.android.com/reference/kotlin/android/view/ScaleGestureDetector):This value cannot be`null`. |