# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Constants | Ctors | Methods | Inherited Methods

# TouchDelegate

`public class TouchDelegate`
`extends Object` ``

java.lang.Object
↳ | android.view.TouchDelegate

Helper class to handle situations where you want a view to have a larger touch area than its actual view bounds. The view whose touch area is changed is called the delegate view. This class should be used by an ancestor of the delegate. To use a TouchDelegate, first create an instance that specifies the bounds that should be mapped to the delegate and the delegate view itself.

The ancestor should then forward all of its touch events received in its `View.onTouchEvent(MotionEvent)` to `onTouchEvent(android.view.MotionEvent)`.

## Summary

### Constants
`int` | `ABOVE` The touchable region of the View extends above its actual extent.
`int` | `BELOW` The touchable region of the View extends below its actual extent.
`int` | `TO_LEFT` The touchable region of the View extends to the left of its actual extent.
`int` | `TO_RIGHT` The touchable region of the View extends to the right of its actual extent.

### Public constructors
`TouchDelegate(Rect bounds, View delegateView)` Constructor

### Public methods
`AccessibilityNodeInfo.TouchDelegateInfo` | `getTouchDelegateInfo()` Return a `TouchDelegateInfo` mapping from regions (in view coordinates) to delegated views for accessibility usage.
`boolean` | `onTouchEvent(MotionEvent event)` Forward touch events to the delegate view if the event is within the bounds specified in the constructor.
`boolean` | `onTouchExplorationHoverEvent(MotionEvent event)` Forward hover events to the delegate view if the event is within the bounds specified in the constructor and touch exploration is enabled.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Constants

### ABOVE

    public static final int ABOVE

The touchable region of the View extends above its actual extent.

Constant Value: 1 (0x00000001)

### BELOW

    public static final int BELOW

The touchable region of the View extends below its actual extent.

Constant Value: 2 (0x00000002)

### TO_LEFT

    public static final int TO_LEFT

The touchable region of the View extends to the left of its actual extent.

Constant Value: 4 (0x00000004)

### TO_RIGHT

    public static final int TO_RIGHT

The touchable region of the View extends to the right of its actual extent.

Constant Value: 8 (0x00000008)

## Public constructors

### TouchDelegate

    public TouchDelegate (Rect bounds,
                    View delegateView)

Constructor

Parameters
`bounds` | `Rect`: Bounds in local coordinates of the containing view that should be mapped to the delegate view
`delegateView` | `View`: The view that should receive motion events

## Public methods

### getTouchDelegateInfo

    public AccessibilityNodeInfo.TouchDelegateInfo getTouchDelegateInfo ()

Return a `TouchDelegateInfo` mapping from regions (in view coordinates) to delegated views for accessibility usage.

Returns
`AccessibilityNodeInfo.TouchDelegateInfo` | A TouchDelegateInfo. This value cannot be `null`.

### onTouchEvent

    public boolean onTouchEvent (MotionEvent event)

Forward touch events to the delegate view if the event is within the bounds specified in the constructor.

Parameters
`event` | `MotionEvent`: The touch event to forward This value cannot be `null`.

Returns
`boolean` | True if the event was consumed by the delegate, false otherwise.

### onTouchExplorationHoverEvent

    public boolean onTouchExplorationHoverEvent (MotionEvent event)

Forward hover events to the delegate view if the event is within the bounds specified in the constructor and touch exploration is enabled.

This method is provided for accessibility purposes so touch exploration, which is commonly used by screen readers, can properly place accessibility focus on views that use touch delegates. Therefore, touch exploration must be enabled for hover events to be dispatched through the delegate.

Parameters
`event` | `MotionEvent`: The hover event to forward This value cannot be `null`.

Returns
`boolean` | True if the event was consumed by the delegate, false otherwise.

See also:

- `AccessibilityManager.isTouchExplorationEnabled()`

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*