A collapsible column layout that organizes its children vertically.
RemoteCollapsibleColumnSample
@Sampled
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
@Composable
public fun RemoteCollapsibleColumnSample() {
// 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)
}
}
}