Added in [API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/widget/ZoomButtonsController#nestedclasses) \| [Ctors](https://developer.android.com/reference/android/widget/ZoomButtonsController#pubctors) \| [Methods](https://developer.android.com/reference/android/widget/ZoomButtonsController#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/widget/ZoomButtonsController#inhmethods)

# ZoomButtonsController

*** ** * ** ***

` public class ZoomButtonsController `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/view/View.OnTouchListener `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.widget.ZoomButtonsController |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 26.**   

This functionality and UI is better handled with custom views and layouts rather than a dedicated zoom-control widget

The `https://developer.android.com/reference/android/widget/ZoomButtonsController` handles showing and hiding the zoom controls and positioning it relative to an owner view. It also gives the client access to the zoom controls container, allowing for additional accessory buttons to be shown in the zoom controls window.

Typically, clients should call `https://developer.android.com/reference/android/widget/ZoomButtonsController#setVisible(boolean)` on a touch down or move (no need to call `https://developer.android.com/reference/android/widget/ZoomButtonsController#setVisible(boolean)` since it will time out on its own). Also, whenever the owner cannot be zoomed further, the client should update `https://developer.android.com/reference/android/widget/ZoomButtonsController#setZoomInEnabled(boolean)` and `https://developer.android.com/reference/android/widget/ZoomButtonsController#setZoomOutEnabled(boolean)`.

If you are using this with a custom View, please call `https://developer.android.com/reference/android/widget/ZoomButtonsController#setVisible(boolean)` from `https://developer.android.com/reference/android/view/View#onDetachedFromWindow()` and from `https://developer.android.com/reference/android/view/View#onVisibilityChanged(android.view.View,%20int)` when `visibility != View.VISIBLE`.

## Summary

| ### Nested classes ||
|---|---|
| ` interface` | `https://developer.android.com/reference/android/widget/ZoomButtonsController.OnZoomListener` Interface that will be called when the user performs an interaction that triggers some action, for example zooming. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/widget/ZoomButtonsController#ZoomButtonsController(android.view.View)(https://developer.android.com/reference/android/view/View ownerView) ` Constructor for the `https://developer.android.com/reference/android/widget/ZoomButtonsController`. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/view/ViewGroup` | ` https://developer.android.com/reference/android/widget/ZoomButtonsController#getContainer()() ` Gets the container that is the parent of the zoom controls. |
| ` https://developer.android.com/reference/android/view/View` | ` https://developer.android.com/reference/android/widget/ZoomButtonsController#getZoomControls()() ` Gets the view for the zoom controls. |
| ` boolean` | ` https://developer.android.com/reference/android/widget/ZoomButtonsController#isAutoDismissed()() ` Whether the zoom controls will be automatically dismissed after showing. |
| ` boolean` | ` https://developer.android.com/reference/android/widget/ZoomButtonsController#isVisible()() ` Whether the zoom controls are visible to the user. |
| ` boolean` | ` https://developer.android.com/reference/android/widget/ZoomButtonsController#onTouch(android.view.View,%20android.view.MotionEvent)(https://developer.android.com/reference/android/view/View v, https://developer.android.com/reference/android/view/MotionEvent event) ` The ZoomButtonsController implements the OnTouchListener, but this does not need to be shown in its public API. |
| ` void` | ` https://developer.android.com/reference/android/widget/ZoomButtonsController#setAutoDismissed(boolean)(boolean autoDismiss) ` Sets whether the zoom controls will be automatically dismissed after showing. |
| ` void` | ` https://developer.android.com/reference/android/widget/ZoomButtonsController#setFocusable(boolean)(boolean focusable) ` Sets whether the zoom controls should be focusable. |
| ` void` | ` https://developer.android.com/reference/android/widget/ZoomButtonsController#setOnZoomListener(android.widget.ZoomButtonsController.OnZoomListener)(https://developer.android.com/reference/android/widget/ZoomButtonsController.OnZoomListener listener) ` Sets the `https://developer.android.com/reference/android/widget/ZoomButtonsController.OnZoomListener` listener that receives callbacks to zoom. |
| ` void` | ` https://developer.android.com/reference/android/widget/ZoomButtonsController#setVisible(boolean)(boolean visible) ` Sets whether the zoom controls should be visible to the user. |
| ` void` | ` https://developer.android.com/reference/android/widget/ZoomButtonsController#setZoomInEnabled(boolean)(boolean enabled) ` Whether to enable the zoom in control. |
| ` void` | ` https://developer.android.com/reference/android/widget/ZoomButtonsController#setZoomOutEnabled(boolean)(boolean enabled) ` Whether to enable the zoom out control. |
| ` void` | ` https://developer.android.com/reference/android/widget/ZoomButtonsController#setZoomSpeed(long)(long speed) ` Sets the delay between zoom callbacks as the user holds a zoom button. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/view/View.OnTouchListener ` ` abstract boolean` ` https://developer.android.com/reference/android/view/View.OnTouchListener#onTouch(android.view.View,%20android.view.MotionEvent)(https://developer.android.com/reference/android/view/View v, https://developer.android.com/reference/android/view/MotionEvent event) `

Called when a touch event is dispatched to a view.

## Public constructors

### ZoomButtonsController

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

```
public ZoomButtonsController (View ownerView)
```

Constructor for the `https://developer.android.com/reference/android/widget/ZoomButtonsController`.

<br />

| Parameters ||
|---|---|
| `ownerView` | `View`: The view that is being zoomed by the zoom controls. The zoom controls will be displayed aligned with this view. <br /> |

## Public methods

### getContainer

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

```
public ViewGroup getContainer ()
```

Gets the container that is the parent of the zoom controls.

The client can add other views to this container to link them with the zoom controls.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/ViewGroup` | The container of the zoom controls. It will be a layout that respects the gravity of a child's layout parameters. <br /> |

### getZoomControls

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

```
public View getZoomControls ()
```

Gets the view for the zoom controls.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/View` | The zoom controls view. <br /> |

### isAutoDismissed

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

```
public boolean isAutoDismissed ()
```

Whether the zoom controls will be automatically dismissed after showing.

<br />

| Returns ||
|---|---|
| `boolean` | Whether the zoom controls will be auto dismissed after showing. <br /> |

### isVisible

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

```
public boolean isVisible ()
```

Whether the zoom controls are visible to the user.

<br />

| Returns ||
|---|---|
| `boolean` | Whether the zoom controls are visible to the user. <br /> |

### onTouch

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

```
public boolean onTouch (View v, 
                MotionEvent event)
```

The ZoomButtonsController implements the OnTouchListener, but this does not need to be shown in its public API.

<br />

| Parameters ||
|---|---|
| `v` | `View`: The view the touch event has been dispatched to. <br /> |
| `event` | `MotionEvent`: The MotionEvent object containing full information about the event. <br /> |

| Returns ||
|---|---|
| `boolean` | True if the listener has consumed the event, false otherwise. <br /> |

### setAutoDismissed

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

```
public void setAutoDismissed (boolean autoDismiss)
```

Sets whether the zoom controls will be automatically dismissed after showing.

<br />

| Parameters ||
|---|---|
| `autoDismiss` | `boolean` <br /> |

### setFocusable

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

```
public void setFocusable (boolean focusable)
```

Sets whether the zoom controls should be focusable. If the controls are focusable, then trackball and arrow key interactions are possible. Otherwise, only touch interactions are possible.

<br />

| Parameters ||
|---|---|
| `focusable` | `boolean`: Whether the zoom controls should be focusable. <br /> |

### setOnZoomListener

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

```
public void setOnZoomListener (ZoomButtonsController.OnZoomListener listener)
```

Sets the `https://developer.android.com/reference/android/widget/ZoomButtonsController.OnZoomListener` listener that receives callbacks to zoom.

<br />

| Parameters ||
|---|---|
| `listener` | `ZoomButtonsController.OnZoomListener`: The listener that will be told to zoom. <br /> |

### setVisible

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

```
public void setVisible (boolean visible)
```

Sets whether the zoom controls should be visible to the user.

<br />

| Parameters ||
|---|---|
| `visible` | `boolean`: Whether the zoom controls should be visible to the user. <br /> |

### setZoomInEnabled

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

```
public void setZoomInEnabled (boolean enabled)
```

Whether to enable the zoom in control.

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: Whether to enable the zoom in control. <br /> |

### setZoomOutEnabled

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

```
public void setZoomOutEnabled (boolean enabled)
```

Whether to enable the zoom out control.

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: Whether to enable the zoom out control. <br /> |

### setZoomSpeed

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

```
public void setZoomSpeed (long speed)
```

Sets the delay between zoom callbacks as the user holds a zoom button.

<br />

| Parameters ||
|---|---|
| `speed` | `long`: The delay in milliseconds between zoom callbacks. <br /> |