RemoteCollapsibleColumn

Functions summary

Unit
@RemoteComposable
@Composable
RemoteCollapsibleColumn(
    modifier: RemoteModifier,
    verticalArrangement: RemoteArrangement.Vertical,
    horizontalAlignment: RemoteAlignment.Horizontal,
    content: @Composable RemoteCollapsibleColumnScope.() -> Unit
)

A collapsible column layout that organizes its children vertically.

Functions

@RemoteComposable
@Composable
fun RemoteCollapsibleColumn(
    modifier: RemoteModifier = RemoteModifier,
    verticalArrangement: RemoteArrangement.Vertical = RemoteArrangement.Top,
    horizontalAlignment: RemoteAlignment.Horizontal = RemoteAlignment.Start,
    content: @Composable RemoteCollapsibleColumnScope.() -> Unit
): Unit

A collapsible column layout that organizes its children vertically.

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

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

import androidx.compose.remote.creation.compose.layout.RemoteBox
import androidx.compose.remote.creation.compose.layout.RemoteCollapsibleColumn
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 column with fixed height, children exceed this height.
RemoteCollapsibleColumn(
    modifier = RemoteModifier.height(150.rdp).width(200.rdp).background(Color.LightGray.rc)
) {
    // Child 1: No explicit priority (Default: Float.MAX_VALUE - Highest)
    RemoteBox(
        modifier = RemoteModifier.height(100.rdp).width(200.rdp).background(Color.Red.rc)
    ) {
        RemoteText("Required (Default Priority)".rs)
    }

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

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

The modifier to apply to this layout.

verticalArrangement: RemoteArrangement.Vertical = RemoteArrangement.Top

The vertical arrangement of the children.

horizontalAlignment: RemoteAlignment.Horizontal = RemoteAlignment.Start

The horizontal alignment of the children.

content: @Composable RemoteCollapsibleColumnScope.() -> Unit

The children of the column.