# Openable

# Openable

Artifact:[androidx.customview:customview](https://developer.android.com/jetpack/androidx/releases/customview)  
[View Source](https://cs.android.com/search?q=file:androidx/customview/widget/Openable.java+class:androidx.customview.widget.Openable)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/customview#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/customview/widget/Openable "View this page in Java")

<br />

```
interface Openable
```

<br />

Known direct subclasses  
[DrawerLayout](https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout),[SlidingPaneLayout](https://developer.android.com/reference/kotlin/androidx/slidingpanelayout/widget/SlidingPaneLayout)  

|-------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DrawerLayout](https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout)                | DrawerLayout acts as a top-level container for window content that allows for interactive "drawer" views to be pulled out from one or both vertical edges of the window. |
| [SlidingPaneLayout](https://developer.android.com/reference/kotlin/androidx/slidingpanelayout/widget/SlidingPaneLayout) | SlidingPaneLayout provides a horizontal, multi-pane layout for use at the top level of a UI.                                                                             |

*** ** * ** ***

A layout that has two states: opened and closed.

## Summary

|                                ### Public functions                                 |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [close](https://developer.android.com/reference/kotlin/androidx/customview/widget/Openable#close())`()` Move the layout to the closed state.                    |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isOpen](https://developer.android.com/reference/kotlin/androidx/customview/widget/Openable#isOpen())`()` Check if the layout is currently in the opened state. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [open](https://developer.android.com/reference/kotlin/androidx/customview/widget/Openable#open())`()` Move the layout to the opened state.                      |

## Public functions

### close

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/customview#1.1.0)  

```
fun close(): Unit
```

Move the layout to the closed state.  

### isOpen

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/customview#1.1.0)  

```
fun isOpen(): Boolean
```

Check if the layout is currently in the opened state.  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|--------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the layout's state is considered opened. |

### open

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/customview#1.1.0)  

```
fun open(): Unit
```

Move the layout to the opened state.