blob: 9faaf42bda3c64aabec0c686f793b5d3674fe5d2 [file] [log] [blame]
<html devsite="true">
<head>
<title>LazyListLayoutInfo</title>
{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<h1>LazyListLayoutInfo</h1>
<p>
<pre>interface LazyListLayoutInfo</pre>
</p>
<hr>
<p>Contains useful information about the currently displayed layout state of lazy lists like <code><a href="/reference/kotlin/androidx/compose/foundation/lazy/package-summary.html#LazyColumn(Modifier,androidx.compose.foundation.lazy.LazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Vertical,AlignmentHorizontal,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Function1)">LazyColumn</a></code> or <code><a href="/reference/kotlin/androidx/compose/foundation/lazy/package-summary.html#LazyRow(Modifier,androidx.compose.foundation.lazy.LazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Horizontal,AlignmentVertical,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Function1)">LazyRow</a></code>. For example you can get the list of currently displayed item.</p>
<p>Use <code><a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListState.html#layoutInfo()">LazyListState.layoutInfo</a></code> to retrieve this</p>
<h2>Summary</h2>
<div class="devsite-table-wrapper">
<table class="responsive">
<thead>
<tr>
<th colspan="2"><h3>Public properties</h3></th>
</tr>
</thead>
<tbody>
<tr>
<td width="40%"><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td>
<div><code><a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListLayoutInfo.html#totalItemsCount()">totalItemsCount</a></code></div>
<p>The total count of items passed to <code><a href="/reference/kotlin/androidx/compose/foundation/lazy/package-summary.html#LazyColumn(Modifier,androidx.compose.foundation.lazy.LazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Vertical,AlignmentHorizontal,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Function1)">LazyColumn</a></code> or <code><a href="/reference/kotlin/androidx/compose/foundation/lazy/package-summary.html#LazyRow(Modifier,androidx.compose.foundation.lazy.LazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Horizontal,AlignmentVertical,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Function1)">LazyRow</a></code>.</p>
</td>
</tr>
<tr>
<td width="40%"><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td>
<div><code><a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListLayoutInfo.html#viewportEndOffset()">viewportEndOffset</a></code></div>
<p>The end offset of the layout's viewport.</p>
</td>
</tr>
<tr>
<td width="40%"><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></code></td>
<td>
<div><code><a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListLayoutInfo.html#viewportStartOffset()">viewportStartOffset</a></code></div>
<p>The start offset of the layout's viewport.</p>
</td>
</tr>
<tr>
<td width="40%"><code><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html">List</a>&lt;<a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListItemInfo.html">LazyListItemInfo</a>&gt;</code></td>
<td>
<div><code><a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListLayoutInfo.html#visibleItemsInfo()">visibleItemsInfo</a></code></div>
<p>The list of <code><a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListItemInfo.html">LazyListItemInfo</a></code> representing all the currently visible items.</p>
</td>
</tr>
</tbody>
</table>
</div>
<h2>Public properties</h2>
<div><a name="getTotalItemsCount()"></a><a name="setTotalItemsCount()"></a><a name="getTotalItemsCount--"></a><a name="setTotalItemsCount--"></a>
<h3 class="api-name" id="totalItemsCount()">totalItemsCount</h3>
<pre class="api-signature no-pretty-print">val&nbsp;<a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListLayoutInfo.html#totalItemsCount()">totalItemsCount</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></pre>
<p>The total count of items passed to <code><a href="/reference/kotlin/androidx/compose/foundation/lazy/package-summary.html#LazyColumn(Modifier,androidx.compose.foundation.lazy.LazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Vertical,AlignmentHorizontal,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Function1)">LazyColumn</a></code> or <code><a href="/reference/kotlin/androidx/compose/foundation/lazy/package-summary.html#LazyRow(Modifier,androidx.compose.foundation.lazy.LazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Horizontal,AlignmentVertical,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Function1)">LazyRow</a></code>.</p>
</div>
<div><a name="getViewportEndOffset()"></a><a name="setViewportEndOffset()"></a><a name="getViewportEndOffset--"></a><a name="setViewportEndOffset--"></a>
<h3 class="api-name" id="viewportEndOffset()">viewportEndOffset</h3>
<pre class="api-signature no-pretty-print">val&nbsp;<a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListLayoutInfo.html#viewportEndOffset()">viewportEndOffset</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></pre>
<p>The end offset of the layout's viewport. You can think of it as a maximum offset which would be visible. Usually it is a size of the lazy list container plus a content padding.</p>
<p>You can use it to understand what items from <code><a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListLayoutInfo.html#visibleItemsInfo()">visibleItemsInfo</a></code> are fully visible.</p>
</div>
<div><a name="getViewportStartOffset()"></a><a name="setViewportStartOffset()"></a><a name="getViewportStartOffset--"></a><a name="setViewportStartOffset--"></a>
<h3 class="api-name" id="viewportStartOffset()">viewportStartOffset</h3>
<pre class="api-signature no-pretty-print">val&nbsp;<a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListLayoutInfo.html#viewportStartOffset()">viewportStartOffset</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a></pre>
<p>The start offset of the layout's viewport. You can think of it as a minimum offset which would be visible. Usually it is 0, but it can be negative if a content padding was applied as the content displayed in the content padding area is still visible.</p>
<p>You can use it to understand what items from <code><a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListLayoutInfo.html#visibleItemsInfo()">visibleItemsInfo</a></code> are fully visible.</p>
</div>
<div><a name="getVisibleItemsInfo()"></a><a name="setVisibleItemsInfo()"></a><a name="getVisibleItemsInfo--"></a><a name="setVisibleItemsInfo--"></a>
<h3 class="api-name" id="visibleItemsInfo()">visibleItemsInfo</h3>
<pre class="api-signature no-pretty-print">val&nbsp;<a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListLayoutInfo.html#visibleItemsInfo()">visibleItemsInfo</a>:&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html">List</a>&lt;<a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListItemInfo.html">LazyListItemInfo</a>&gt;</pre>
<p>The list of <code><a href="/reference/kotlin/androidx/compose/foundation/lazy/LazyListItemInfo.html">LazyListItemInfo</a></code> representing all the currently visible items.</p>
</div>
</body>
</html>