# BottomSheetDragHandleView

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/bottomsheet/BottomSheetDragHandleView.java)

*** ** * ** ***


```
public class BottomSheetDragHandleView
```

<br />

*** ** * ** ***

A drag handle view that can be added to bottom sheets associated with `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior`. This view will automatically handle the accessibility interaction when the accessibility service is enabled. When you add a drag handle to a bottom sheet and the user enables the accessibility service, the drag handle will become important for accessibility and clickable. Clicking the drag handle will toggle the bottom sheet between its collapsed, half expanded, and expanded states.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDragHandleView#BottomSheetDragHandleView(Context)(Context context)` |
| `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDragHandleView#BottomSheetDragHandleView(Context,AttributeSet)(Context context, AttributeSet attrs)` |
| `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDragHandleView#BottomSheetDragHandleView(Context,AttributeSet,int)( Context context, AttributeSet attrs, int defStyleAttr )` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDragHandleView#onAccessibilityStateChanged(boolean)(boolean enabled)` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDragHandleView#onKeyDown(int,KeyEvent)(int keyCode, KeyEvent event)` |
| `boolean` | `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDragHandleView#onTouchEvent(MotionEvent)(MotionEvent event)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDragHandleView#setOnClickListener(OnClickListener)(OnClickListener l)` |
| `void` | `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDragHandleView#setOnTouchListener(OnTouchListener)(OnTouchListener l)` |

| ### Protected methods |
|---|---|
| `void` | `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDragHandleView#onAttachedToWindow()()` |
| `void` | `https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetDragHandleView#onDetachedFromWindow()()` |

## Public constructors

### BottomSheetDragHandleView

```
public BottomSheetDragHandleView(Context context)
```

### BottomSheetDragHandleView

```
public BottomSheetDragHandleView(Context context, AttributeSet attrs)
```

### BottomSheetDragHandleView

```
public BottomSheetDragHandleView(
    Context context,
    AttributeSet attrs,
    int defStyleAttr
)
```

## Public methods

### onAccessibilityStateChanged

```
public void onAccessibilityStateChanged(boolean enabled)
```

### onKeyDown

```
public boolean onKeyDown(int keyCode, KeyEvent event)
```

### onTouchEvent

```
public boolean onTouchEvent(MotionEvent event)
```

### setOnClickListener

```
public void setOnClickListener(OnClickListener l)
```

### setOnTouchListener

```
public void setOnTouchListener(OnTouchListener l)
```

## Protected methods

### onAttachedToWindow

```
protected void onAttachedToWindow()
```

### onDetachedFromWindow

```
protected void onDetachedFromWindow()
```