RemoteCollapsibleRowScope


Scope for the children of RemoteCollapsibleRow.

Summary

Public constructors

android

Public functions

RemoteModifier

Sets the collapsible priority of the child.

android
RemoteModifier
RemoteModifier.weight(
    weight: @FloatRange(from = 0.0, fromInclusive = false) Float
)

Sets the horizontal weight of the child.

android
RemoteModifier

Sets the horizontal weight of the child.

android

Public constructors

RemoteCollapsibleRowScope

RemoteCollapsibleRowScope()

Public functions

RemoteModifier.collapsiblePriority

fun RemoteModifier.collapsiblePriority(priority: Float): RemoteModifier

Sets the collapsible priority of the child.

Priority determines the order in which children are hidden when space is limited. Higher priority items remain visible longer. Items with the same priority are hidden sequentially in reverse layout order (last child with same priority is hidden first).

Example of assigning collapsible priorities to children in a RemoteCollapsibleRow:

import androidx.compose.remote.creation.compose.layout.RemoteBox
import androidx.compose.remote.creation.compose.layout.RemoteCollapsibleRow
import androidx.compose.remote.creation.compose.layout.RemoteText
import androidx.compose.remote.creation.compose.modifier.RemoteModifier
import androidx.compose.remote.creation.compose.modifier.background
import androidx.compose.remote.creation.compose.modifier.height
import androidx.compose.remote.creation.compose.modifier.width
import androidx.compose.remote.creation.compose.state.rc
import androidx.compose.remote.creation.compose.state.rdp
import androidx.compose.remote.creation.compose.state.rs
import androidx.compose.ui.graphics.Color

// A row with fixed width, children exceed this width.
RemoteCollapsibleRow(
    modifier = RemoteModifier.height(200.rdp).width(150.rdp).background(Color.LightGray.rc)
) {
    // Child 1: No explicit priority (Default: Float.MAX_VALUE - Highest)
    RemoteBox(
        modifier = RemoteModifier.width(100.rdp).height(200.rdp).background(Color.Red.rc)
    ) {
        RemoteText("Required".rs)
    }

    // Child 2: Low priority (1f)
    RemoteBox(
        modifier =
            RemoteModifier.collapsiblePriority(1f)
                .width(100.rdp)
                .height(200.rdp)
                .background(Color.Blue.rc)
    ) {
        RemoteText("Low".rs)
    }

    // Child 3: Medium priority (5f)
    RemoteBox(
        modifier =
            RemoteModifier.collapsiblePriority(5f)
                .width(100.rdp)
                .height(200.rdp)
                .background(Color.Green.rc)
    ) {
        RemoteText("Medium".rs)
    }
}
Parameters
priority: Float

The priority of the child. Can be any float value; higher values are prioritized to remain visible longer.

Returns
RemoteModifier

a RemoteModifier that assigns horizontal collapsible priority to the child

RemoteModifier.weight

fun RemoteModifier.weight(
    weight: @FloatRange(from = 0.0, fromInclusive = false) Float
): RemoteModifier

Sets the horizontal weight of the child.

Parameters
weight: @FloatRange(from = 0.0, fromInclusive = false) Float

The weight of the child.

Returns
RemoteModifier

a RemoteModifier that assigns horizontal weight to the child

RemoteModifier.weight

fun RemoteModifier.weight(weight: RemoteFloat): RemoteModifier

Sets the horizontal weight of the child.

Parameters
weight: RemoteFloat

The weight of the child.

Returns
RemoteModifier

a RemoteModifier that assigns horizontal weight to the child