BeyondBoundsLayout
-
Cmn
interface BeyondBoundsLayout
Layout extra items in the specified direction.
A BeyondBoundsLayout
instance can be obtained by consuming the BeyondBoundsLayout modifier local
. It can be used to send a request to layout more items in a particular direction
. This can be useful when composition or layout is determined lazily, as with a LazyColumn. The request is received by any parent up the hierarchy that provides this modifier local.
Summary
Nested types |
---|
interface BeyondBoundsLayout.BeyondBoundsScope The scope used in |
value class BeyondBoundsLayout.LayoutDirection The direction (from the visible bounds) that a |
Public functions |
||
---|---|---|
T? |
<T : Any?> layout( Send a request to layout more items in the specified |
Cmn
|
Public functions
layout
fun <T : Any?> layout(
direction: BeyondBoundsLayout.LayoutDirection,
block: BeyondBoundsLayout.BeyondBoundsScope.() -> T?
): T?
Send a request to layout more items in the specified direction
. The request is received by a parent up the hierarchy. The parent adds one item at a time and calls block
after each item is added. The parent continues adding new items as long as block
returns null. Once you have all the items you need, you can perform some operation and return a non-null value. Returning this value stops the laying out of beyond bounds items. (Note that you have to return a non-null value stop iterating).
Parameters | |
---|---|
direction: BeyondBoundsLayout.LayoutDirection |
The direction from the visible bounds in which more items are requested. |
block: BeyondBoundsLayout.BeyondBoundsScope.() -> T? |
Continue to layout more items until this block returns a non null item. |