LayoutCoordinator
The LayoutCoordinator
annotation is useful to indicate the components which are just coordinator of the specific components designed for the specific size classes
Usage example
@Composable
@NonRestartableComposable
@LayoutCoordinator(
classes = [EXPANDED_CONTENT, MEDIUM_CONTENT, MEDIUM_EXPANDED_CONTENT, COMPACT_CONTENT] // not mandatory
)
fun Passwords() {
ResponsiveContent(
onExpandedSizeClass = {
PasswordsGrid()
},
onMediumSizeClass = {
PasswordsGrid()
},
onMediumWidthExpandedHeight = {
PasswordsList()
},
onCompactSizeClass = {
PasswordsList()
}
)
}
@Composable
@NonRestartableComposable
@ResponsiveClassComponent(
classes = [EXPANDED_CONTENT, MEDIUM_CONTENT]
)
private fun PasswordsGrid() {
// the specific code of the component
}
@Composable
@NonRestartableComposable
@ResponsiveClassComponent(
classes = [MEDIUM_EXPANDED_CONTENT, COMPACT_CONTENT]
)
private fun PasswordsList() {
// the specific code of the component
}
Content copied to clipboard
Author
N7ghtm4r3 - Tecknobit
Since
1.1.0