blob: ba31f4b0580b7b6e3cf170120ec8b8aef795a0f2 [file] [log] [blame]
<html devsite="true">
<head>
<title>BottomDrawerState</title>
{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<div id="metadata-info-block"></div>
<h1>BottomDrawerState</h1>
<p>
<pre>@<a href="/reference/androidx/compose/material/ExperimentalMaterialApi.html">ExperimentalMaterialApi</a><br>public final class <a href="/reference/androidx/compose/material/BottomDrawerState.html">BottomDrawerState</a> extends <a href="/reference/androidx/compose/material/SwipeableState.html">SwipeableState</a></pre>
</p>
<div class="devsite-table-wrapper">
<table class="jd-inheritance-table">
<tbody>
<tr>
<td colspan="3"><a href="https://developer.android.com/reference/java/lang/Object.html">java.lang.Object</a></td>
</tr>
<tr>
<td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
<td colspan="2"><a href="/reference/androidx/compose/material/SwipeableState.html">androidx.compose.material.SwipeableState</a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td class="jd-inheritance-space">&nbsp;&nbsp;&nbsp;↳</td>
<td colspan="1"><a href="/reference/androidx/compose/material/BottomDrawerState.html">androidx.compose.material.BottomDrawerState</a></td>
</tr>
</tbody>
</table>
</div>
<hr>
<p>State of the <code><a href="/reference/androidx/compose/material/package-summary.html#BottomDrawer(kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.material.BottomDrawerState,kotlin.Boolean,androidx.compose.ui.graphics.Shape,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,kotlin.Function0)">BottomDrawer</a></code> composable.</p>
<h2>Summary</h2>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%"><h3>Nested types</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td>
<div><code>public static class <a href="/reference/androidx/compose/material/BottomDrawerState.Companion.html">BottomDrawerState.Companion</a></code></div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%"><h3>Public fields</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>final boolean</code></td>
<td>
<div><code><a href="/reference/androidx/compose/material/BottomDrawerState.html#isClosed()">isClosed</a></code></div>
<p>Whether the drawer is closed.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final boolean</code></td>
<td>
<div><code><a href="/reference/androidx/compose/material/BottomDrawerState.html#isExpanded()">isExpanded</a></code></div>
<p>Whether the drawer is expanded.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final boolean</code></td>
<td>
<div><code><a href="/reference/androidx/compose/material/BottomDrawerState.html#isOpen()">isOpen</a></code></div>
<p>Whether the drawer is open, either in opened or expanded state.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%"><h3>Public constructors</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td>
<div><code><a href="/reference/androidx/compose/material/BottomDrawerState.html#BottomDrawerState(androidx.compose.material.BottomDrawerValue,kotlin.Function1)">BottomDrawerState</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/material/BottomDrawerValue.html">BottomDrawerValue</a>&nbsp;initialValue,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/material/BottomDrawerValue.html">BottomDrawerValue</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Boolean.html">Boolean</a>&gt;&nbsp;confirmStateChange<br>)</code></div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%"><h3>Public methods</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>final void</code></td>
<td>
<div><code><a href="/reference/androidx/compose/material/BottomDrawerState.html#close()">close</a>()</code></div>
<p>Close the drawer with animation and suspend until it if fully closed or animation has been cancelled.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final void</code></td>
<td>
<div><code><a href="/reference/androidx/compose/material/BottomDrawerState.html#expand()">expand</a>()</code></div>
<p>Expand the drawer with animation and suspend until it if fully expanded or animation has been cancelled.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final void</code></td>
<td>
<div><code><a href="/reference/androidx/compose/material/BottomDrawerState.html#open()">open</a>()</code></div>
<p>Open the drawer with animation and suspend until it if fully opened or animation has been cancelled.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive" id="inhmethods">
<thead>
<tr>
<th colspan="100%"><h3>Inherited fields</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td><devsite-expandable><span class="expand-control">From <a href="/reference/androidx/compose/material/SwipeableState.html">androidx.compose.material.SwipeableState</a></span>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<tbody class="list">
<tr>
<td width="40%"><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/material/BottomDrawerValue.html">BottomDrawerValue</a></code></td>
<td>
<div><code><a href="/reference/androidx/compose/material/SwipeableState.html#currentValue()">currentValue</a></code></div>
<p>The current value of the state.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final float</code></td>
<td>
<div><code>@<a href="/reference/androidx/compose/material/ExperimentalMaterialApi.html">ExperimentalMaterialApi</a><br><a href="/reference/androidx/compose/material/SwipeableState.html#direction()">direction</a></code></div>
<p>The direction in which the <code><a href="/reference/androidx/compose/material/package-summary.html#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp)">swipeable</a></code> is moving, relative to the current <code><a href="/reference/androidx/compose/material/SwipeableState.html#currentValue()">currentValue</a></code>.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final boolean</code></td>
<td>
<div><code><a href="/reference/androidx/compose/material/SwipeableState.html#isAnimationRunning()">isAnimationRunning</a></code></div>
<p>Whether the state is currently animating.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/State.html">State</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Float.html">Float</a>&gt;</code></td>
<td>
<div><code><a href="/reference/androidx/compose/material/SwipeableState.html#offset()">offset</a></code></div>
<p>The current position (in pixels) of the <code><a href="/reference/androidx/compose/material/package-summary.html#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp)">swipeable</a></code>.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/runtime/State.html">State</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Float.html">Float</a>&gt;</code></td>
<td>
<div><code><a href="/reference/androidx/compose/material/SwipeableState.html#overflow()">overflow</a></code></div>
<p>The amount by which the <code><a href="/reference/androidx/compose/material/package-summary.html#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp)">swipeable</a></code> has been swiped past its bounds.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/material/SwipeProgress.html">SwipeProgress</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/material/BottomDrawerValue.html">BottomDrawerValue</a>&gt;</code></td>
<td>
<div><code>@<a href="/reference/androidx/compose/material/ExperimentalMaterialApi.html">ExperimentalMaterialApi</a><br><a href="/reference/androidx/compose/material/SwipeableState.html#progress()">progress</a></code></div>
<p>Information about the ongoing swipe or animation, if any.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/material/BottomDrawerValue.html">BottomDrawerValue</a></code></td>
<td>
<div><code>@<a href="/reference/androidx/compose/material/ExperimentalMaterialApi.html">ExperimentalMaterialApi</a><br><a href="/reference/androidx/compose/material/SwipeableState.html#targetValue()">targetValue</a></code></div>
<p>The target value of the state.</p>
</td>
</tr>
</tbody>
</table>
</div>
</devsite-expandable> </td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive" id="inhmethods">
<thead>
<tr>
<th colspan="100%"><h3>Inherited methods</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td><devsite-expandable><span class="expand-control">From <a href="/reference/androidx/compose/material/SwipeableState.html">androidx.compose.material.SwipeableState</a></span>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<tbody class="list">
<tr>
<td width="40%"><code>final void</code></td>
<td>
<div><code>@<a href="/reference/androidx/compose/material/ExperimentalMaterialApi.html">ExperimentalMaterialApi</a><br><a href="/reference/androidx/compose/material/SwipeableState.html#animateTo(androidx.compose.material.BottomDrawerValue,androidx.compose.animation.core.AnimationSpec)">animateTo</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/material/BottomDrawerValue.html">BottomDrawerValue</a>&nbsp;targetValue,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/animation/core/AnimationSpec.html">AnimationSpec</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Float.html">Float</a>&gt;&nbsp;anim<br>)</code></div>
<p>Set the state to the target value by starting an animation.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final float</code></td>
<td>
<div><code><a href="/reference/androidx/compose/material/SwipeableState.html#performDrag(kotlin.Float)">performDrag</a>(float&nbsp;delta)</code></div>
<p>Force <code><a href="/reference/androidx/compose/material/package-summary.html#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp)">swipeable</a></code> to consume drag delta provided from outside of the regular <code><a href="/reference/androidx/compose/material/package-summary.html#(androidx.compose.ui.Modifier).swipeable(androidx.compose.material.SwipeableState,kotlin.collections.Map,androidx.compose.foundation.gestures.Orientation,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function2,androidx.compose.material.ResistanceConfig,androidx.compose.ui.unit.Dp)">swipeable</a></code> gesture flow.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final void</code></td>
<td>
<div><code><a href="/reference/androidx/compose/material/SwipeableState.html#performFling(kotlin.Float)">performFling</a>(float&nbsp;velocity)</code></div>
<p>Perform fling with settling to one of the anchors which is determined by the given <code><a href="/reference/androidx/compose/material/SwipeableState.html#performFling(kotlin.Float)">velocity</a></code>.</p>
</td>
</tr>
<tr>
<td width="40%"><code>final void</code></td>
<td>
<div><code>@<a href="/reference/androidx/compose/material/ExperimentalMaterialApi.html">ExperimentalMaterialApi</a><br><a href="/reference/androidx/compose/material/SwipeableState.html#snapTo(androidx.compose.material.BottomDrawerValue)">snapTo</a>(@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/material/BottomDrawerValue.html">BottomDrawerValue</a>&nbsp;targetValue)</code></div>
<p>Set the state without any animation and suspend until it's set</p>
</td>
</tr>
</tbody>
</table>
</div>
</devsite-expandable> </td>
</tr>
</tbody>
</table>
</div>
<div class="list">
<h2>Public fields</h2>
<div class="api-item"><a name="getIsClosed()"></a><a name="setIsClosed()"></a><a name="getIsClosed--"></a><a name="setIsClosed--"></a>
<h3 class="api-name" id="isClosed()">isClosed</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;boolean&nbsp;<a href="/reference/androidx/compose/material/BottomDrawerState.html#isClosed()">isClosed</a></pre>
<p>Whether the drawer is closed.</p>
</div>
<div class="api-item"><a name="getIsExpanded()"></a><a name="setIsExpanded()"></a><a name="getIsExpanded--"></a><a name="setIsExpanded--"></a>
<h3 class="api-name" id="isExpanded()">isExpanded</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;boolean&nbsp;<a href="/reference/androidx/compose/material/BottomDrawerState.html#isExpanded()">isExpanded</a></pre>
<p>Whether the drawer is expanded.</p>
</div>
<div class="api-item"><a name="getIsOpen()"></a><a name="setIsOpen()"></a><a name="getIsOpen--"></a><a name="setIsOpen--"></a>
<h3 class="api-name" id="isOpen()">isOpen</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;boolean&nbsp;<a href="/reference/androidx/compose/material/BottomDrawerState.html#isOpen()">isOpen</a></pre>
<p>Whether the drawer is open, either in opened or expanded state.</p>
</div>
</div>
<div class="list">
<h2>Public constructors</h2>
<div class="api-item"><a name="BottomDrawerState(androidx.compose.material.BottomDrawerValue, kotlin.Function1)"></a><a name="BottomDrawerState-androidx.compose.material.BottomDrawerValue-kotlin.Function1-"></a><a name="bottomdrawerstate"></a>
<h3 class="api-name" id="BottomDrawerState(androidx.compose.material.BottomDrawerValue,kotlin.Function1)">BottomDrawerState</h3>
<pre class="api-signature no-pretty-print">public&nbsp;<a href="/reference/androidx/compose/material/BottomDrawerState.html#BottomDrawerState(androidx.compose.material.BottomDrawerValue,kotlin.Function1)">BottomDrawerState</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/material/BottomDrawerValue.html">BottomDrawerValue</a>&nbsp;initialValue,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/material/BottomDrawerValue.html">BottomDrawerValue</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Boolean.html">Boolean</a>&gt;&nbsp;confirmStateChange<br>)</pre>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/material/BottomDrawerValue.html">BottomDrawerValue</a>&nbsp;initialValue</code></td>
<td>
<p>The initial value of the state.</p>
</td>
</tr>
<tr>
<td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/material/BottomDrawerValue.html">BottomDrawerValue</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Boolean.html">Boolean</a>&gt;&nbsp;confirmStateChange</code></td>
<td>
<p>Optional callback invoked to confirm or veto a pending state change.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="list">
<h2>Public methods</h2>
<div class="api-item"><a name="close--"></a><a name="close"></a>
<h3 class="api-name" id="close()">close</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;void&nbsp;<a href="/reference/androidx/compose/material/BottomDrawerState.html#close()">close</a>()</pre>
<p>Close the drawer with animation and suspend until it if fully closed or animation has been cancelled.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Throws</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code><a href="https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-cancellation-exception/index.html">kotlinx.coroutines.CancellationException</a>&nbsp;kotlinx.coroutines.CancellationException</code></td>
<td>
<p>if the animation is interrupted</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="expand--"></a><a name="expand"></a>
<h3 class="api-name" id="expand()">expand</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;void&nbsp;<a href="/reference/androidx/compose/material/BottomDrawerState.html#expand()">expand</a>()</pre>
<p>Expand the drawer with animation and suspend until it if fully expanded or animation has been cancelled.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Throws</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code><a href="https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-cancellation-exception/index.html">kotlinx.coroutines.CancellationException</a>&nbsp;kotlinx.coroutines.CancellationException</code></td>
<td>
<p>if the animation is interrupted</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="open--"></a><a name="open"></a>
<h3 class="api-name" id="open()">open</h3>
<pre class="api-signature no-pretty-print">public&nbsp;final&nbsp;void&nbsp;<a href="/reference/androidx/compose/material/BottomDrawerState.html#open()">open</a>()</pre>
<p>Open the drawer with animation and suspend until it if fully opened or animation has been cancelled. If the content height is less than <code><a href="/reference/androidx/compose/material/package-summary.html#BottomDrawerOpenFraction()">BottomDrawerOpenFraction</a></code>, the drawer state will move to <code><a href="/reference/androidx/compose/material/BottomDrawerValue.html#Expanded">BottomDrawerValue.Expanded</a></code> instead.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Throws</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td width="40%"><code><a href="https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-cancellation-exception/index.html">kotlinx.coroutines.CancellationException</a>&nbsp;kotlinx.coroutines.CancellationException</code></td>
<td>
<p>if the animation is interrupted</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>