From dacee2f1448fc56819e486ba49d7ae07d7cf3d58 Mon Sep 17 00:00:00 2001 From: Roman Sedaikin Date: Fri, 22 Jan 2021 18:52:23 +0300 Subject: [PATCH] Revert: Fixed layout in Toggles - Align radio buttons. --- .../com/jetbrains/compose/widgets/Toggles.kt | 47 ++++++------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/examples/intelliJPlugin/src/main/kotlin/com/jetbrains/compose/widgets/Toggles.kt b/examples/intelliJPlugin/src/main/kotlin/com/jetbrains/compose/widgets/Toggles.kt index 23c5186908..c319dca756 100755 --- a/examples/intelliJPlugin/src/main/kotlin/com/jetbrains/compose/widgets/Toggles.kt +++ b/examples/intelliJPlugin/src/main/kotlin/com/jetbrains/compose/widgets/Toggles.kt @@ -1,11 +1,9 @@ package com.jetbrains.compose.widgets import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material.Checkbox @@ -49,41 +47,26 @@ fun Toggles() { modifier = Modifier.padding(16.dp) ) { var selected by remember { mutableStateOf("Kotlin") } - Row { + Row(verticalAlignment = Alignment.CenterVertically) { RadioButton(selected = selected == "Kotlin", onClick = { selected = "Kotlin" }) - Box( - modifier = Modifier.height(30.dp), - contentAlignment = Alignment.CenterStart - ) { - Text( - text = "Kotlin", - modifier = Modifier.clickable(onClick = { selected = "Kotlin" }).padding(start = 4.dp) - ) - } + Text( + text = "Kotlin", + modifier = Modifier.clickable(onClick = { selected = "Kotlin" }).padding(start = 4.dp) + ) } - Row { + Row(verticalAlignment = Alignment.CenterVertically) { RadioButton(selected = selected == "Java", onClick = { selected = "Java" }) - Box( - modifier = Modifier.height(30.dp), - contentAlignment = Alignment.CenterStart - ) { - Text( - text = "Java", - modifier = Modifier.clickable(onClick = { selected = "Java" }).padding(start = 4.dp) - ) - } + Text( + text = "Java", + modifier = Modifier.clickable(onClick = { selected = "Java" }).padding(start = 4.dp) + ) } - Row { + Row(verticalAlignment = Alignment.CenterVertically) { RadioButton(selected = selected == "Swift", onClick = { selected = "Swift" }) - Box( - modifier = Modifier.height(30.dp), - contentAlignment = Alignment.CenterStart - ) { - Text( - text = "Swift", - modifier = Modifier.clickable(onClick = { selected = "Swift" }).padding(start = 4.dp) - ) - } + Text( + text = "Swift", + modifier = Modifier.clickable(onClick = { selected = "Swift" }).padding(start = 4.dp) + ) } } }