pocmo / recompose

recompose is a tool for converting Android layouts in XML to Kotlin code using Jetpack Compose.
Apache License 2.0
783 stars 49 forks source link

Add support for Switch #93

Closed pocmo closed 3 years ago

pocmo commented 3 years ago

XML: https://developer.android.com/reference/android/widget/Switch

Composable: ?

jerryOkafor commented 3 years ago

@pocmo I have searched for the documentation of Compose Switch, I could not find anything. I am sure it exists because I have used it before:

val checkedState = remember { mutableStateOf(singlePlayer) }

    Switch(checked = checkedState.value, onCheckedChange = {
        checkedState.value = it
        onCheckedChange(it)
    })
Foso commented 3 years ago

https://foso.github.io/Jetpack-Compose-Playground/material/switch/ https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#switch