RemoteCollapsibleRow

Functions summary

Unit
@RemoteComposable
@Composable
RemoteCollapsibleRow(
    modifier: RemoteModifier,
    horizontalArrangement: RemoteArrangement.Horizontal,
    verticalAlignment: RemoteAlignment.Vertical,
    content: @Composable RemoteCollapsibleRowScope.() -> Unit
)

A collapsible row layout that organizes its children horizontally.

Functions

@RemoteComposable
@Composable
fun RemoteCollapsibleRow(
    modifier: RemoteModifier = RemoteModifier,
    horizontalArrangement: RemoteArrangement.Horizontal = RemoteArrangement.Start,
    verticalAlignment: RemoteAlignment.Vertical = RemoteAlignment.Top,
    content: @Composable RemoteCollapsibleRowScope.() -> Unit
): Unit

A collapsible row layout that organizes its children horizontally.

When available horizontal space is insufficient, children are hidden (collapsed) rather than shrunk or wrapped. Children are hidden based on their RemoteCollapsibleRowScope.collapsiblePriority, with lower priority items being hidden first. Children without priority set have the highest priority.

Children can be configured with RemoteCollapsibleRowScope.weight and RemoteCollapsibleRowScope.collapsiblePriority to control how they behave when the row is collapsed.

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
modifier: RemoteModifier = RemoteModifier

The modifier to apply to this layout.

horizontalArrangement: RemoteArrangement.Horizontal = RemoteArrangement.Start

The horizontal arrangement of the children.

verticalAlignment: RemoteAlignment.Vertical = RemoteAlignment.Top

The vertical alignment of the children.

content: @Composable RemoteCollapsibleRowScope.() -> Unit

The children of the row.