Skip to content

Commit

Permalink
Fix checkbox and switch position on long texts on M2 (#146)
Browse files Browse the repository at this point in the history
Co-authored-by: Niels Kristian Lyshøj Jesnen <niels.kristian.jensen@dencrypt.dk>
  • Loading branch information
NKJe and Niels Kristian Lyshøj Jesnen committed May 9, 2023
1 parent 963b4a6 commit 02ef972
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.alorma.compose.settings.ui

import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.selection.toggleable
Expand Down Expand Up @@ -59,8 +58,7 @@ fun SettingsCheckbox(
) {
WrapContentColor(enabled = enabled) {
SettingsTileIcon(icon = icon)
SettingsTileTexts(title = title, subtitle = subtitle)
Spacer(modifier = Modifier.weight(1f))
SettingsTileTexts(modifier = Modifier.weight(1f), title = title, subtitle = subtitle)
SettingsTileAction {
Checkbox(
enabled = enabled,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.alorma.compose.settings.ui

import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.selection.toggleable
Expand Down Expand Up @@ -59,8 +58,7 @@ fun SettingsSwitch(
) {
WrapContentColor(enabled = enabled) {
SettingsTileIcon(icon = icon)
SettingsTileTexts(title = title, subtitle = subtitle)
Spacer(modifier = Modifier.weight(1f))
SettingsTileTexts(modifier = Modifier.weight(1f), title = title, subtitle = subtitle)
SettingsTileAction {
Switch(
checked = storageValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal fun RowScope.SettingsTileTexts(
subtitle: @Composable (() -> Unit)?,
) {
Column(
modifier = Modifier,
modifier = modifier,
verticalArrangement = Arrangement.Center,
) {
SettingsTileTitle(title)
Expand Down

0 comments on commit 02ef972

Please sign in to comment.