title |
---|
Android |
TileGroup
component is used for wrapping tiles to show related interactions.
TileGroup
allows to add multiple Tile
s and wrapping in a single elevated component.
@Composable
fun Example() {
TileGroup(
modifier = Modifier.padding(16.dp),
) {
Tile(
title = { Text("Title") },
onClick = {},
)
Tile(
title = { Text("Title") },
onClick = {},
icon = { Icon(Icons.Airplane, contentDescription = null) },
description = { Text("Description") },
)
}
}
Slotting API allows you to configure the particular child Tile
s with testTags.
composeTestRule.setContent {
TileGroup(
modifier = Modifier.padding(16.dp),
) {
Tile(
modifier = Modifier.testTag("title")
title = { Text("Title") },
onClick = {},
)
Tile(
title = { Text("Title") },
onClick = {},
icon = { Icon(Icons.Airplane, contentDescription = null) },
description = { Text("Description") },
)
}
}
composeTestRule.onNodeWithTag("title").assertTextEquals("Title")
separatorStartIndent
can configure the start indentation of separators in-between child Tile
s.