diff --git a/app/src/main/java/helium314/keyboard/settings/Preference.kt b/app/src/main/java/helium314/keyboard/settings/Preference.kt index 6ea75f1d5..55f98b8bd 100644 --- a/app/src/main/java/helium314/keyboard/settings/Preference.kt +++ b/app/src/main/java/helium314/keyboard/settings/Preference.kt @@ -78,58 +78,49 @@ fun Preference( @DrawableRes icon: Int? = null, value: @Composable (RowScope.() -> Unit)? = null, ) { - Column( + Row( modifier = modifier .fillMaxWidth() .clickable { onClick() } - .heightIn(min = 48.dp) - .padding(16.dp), - verticalArrangement = Arrangement.spacedBy( - space = 0.dp, - alignment = Alignment.CenterVertically - ) + .heightIn(min = 40.dp) + .padding(12.dp), + horizontalArrangement = Arrangement.spacedBy(12.dp), + verticalAlignment = Alignment.CenterVertically ) { - Row( - modifier = modifier.fillMaxWidth(), - horizontalArrangement = Arrangement.SpaceBetween, - verticalAlignment = Alignment.CenterVertically - ) { - if (icon != null) - Icon(painterResource(icon), name, modifier = Modifier.size(48.dp).padding(end = 8.dp)) - Column(modifier = Modifier.weight(2 / 3f)) { - Text(text = name,) - if (description != null) { - CompositionLocalProvider( - LocalTextStyle provides MaterialTheme.typography.bodyMedium, - LocalContentColor provides MaterialTheme.colorScheme.onSurfaceVariant - ) { - Text( - text = description, - modifier = Modifier.padding(top = 8.dp) - ) - } - } - - } - if (value != null) { + if (icon != null) + Icon(painterResource(icon), name, modifier = Modifier.size(36.dp)) + Column(modifier = Modifier.weight(2 / 3f)) { + Text(text = name) + if (description != null) { CompositionLocalProvider( - LocalTextStyle provides LocalTextStyle.current.copy( - textAlign = TextAlign.End, - hyphens = Hyphens.Auto - ), + LocalTextStyle provides MaterialTheme.typography.bodyMedium, LocalContentColor provides MaterialTheme.colorScheme.onSurfaceVariant ) { - Row( - horizontalArrangement = Arrangement.spacedBy( - space = 8.dp, - alignment = Alignment.End - ), - verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.weight(1 / 3f) - ) { value() } + Text( + text = description, + modifier = Modifier.padding(top = 2.dp) + ) } } } + if (value != null) { + CompositionLocalProvider( + LocalTextStyle provides LocalTextStyle.current.copy( + textAlign = TextAlign.End, + hyphens = Hyphens.Auto + ), + LocalContentColor provides MaterialTheme.colorScheme.onSurfaceVariant + ) { + Row( + horizontalArrangement = Arrangement.spacedBy( + space = 8.dp, + alignment = Alignment.End + ), + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.weight(1 / 3f) + ) { value() } + } + } } } diff --git a/app/src/main/java/helium314/keyboard/settings/dialogs/ReorderDialog.kt b/app/src/main/java/helium314/keyboard/settings/dialogs/ReorderDialog.kt index 006f02b8d..4a496d825 100644 --- a/app/src/main/java/helium314/keyboard/settings/dialogs/ReorderDialog.kt +++ b/app/src/main/java/helium314/keyboard/settings/dialogs/ReorderDialog.kt @@ -68,7 +68,7 @@ fun ReorderDialog( text = { LazyColumn( state = listState, - verticalArrangement = Arrangement.spacedBy(12.dp), + verticalArrangement = Arrangement.spacedBy(4.dp), ) { items(reorderableItems, key = getKey) { item -> ReorderableItem( diff --git a/app/src/main/java/helium314/keyboard/settings/dialogs/ToolbarKeysCustomizer.kt b/app/src/main/java/helium314/keyboard/settings/dialogs/ToolbarKeysCustomizer.kt index 2c2994880..5edcf9e0f 100644 --- a/app/src/main/java/helium314/keyboard/settings/dialogs/ToolbarKeysCustomizer.kt +++ b/app/src/main/java/helium314/keyboard/settings/dialogs/ToolbarKeysCustomizer.kt @@ -1,6 +1,7 @@ package helium314.keyboard.settings.dialogs import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.lazy.LazyColumn @@ -24,6 +25,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.TextFieldValue import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp import androidx.compose.ui.window.DialogProperties import androidx.core.content.edit import helium314.keyboard.keyboard.internal.KeyboardIconsSet @@ -64,7 +66,9 @@ fun ToolbarKeysCustomizer( }, title = { Text(stringResource(R.string.customize_toolbar_key_codes)) }, text = { - LazyColumn { + LazyColumn( + verticalArrangement = Arrangement.spacedBy(4.dp) + ) { items(ToolbarKey.entries) { Row( verticalAlignment = Alignment.CenterVertically, diff --git a/app/src/main/java/helium314/keyboard/settings/screens/AboutScreen.kt b/app/src/main/java/helium314/keyboard/settings/screens/AboutScreen.kt index c4da740df..13e69c5d8 100644 --- a/app/src/main/java/helium314/keyboard/settings/screens/AboutScreen.kt +++ b/app/src/main/java/helium314/keyboard/settings/screens/AboutScreen.kt @@ -62,7 +62,7 @@ fun createAboutPrefs(context: Context) = listOf( name = it.title, description = it.description, onClick = { }, - icon = R.drawable.ic_launcher_foreground + icon = R.drawable.ic_launcher_foreground // todo: maybe use the bitmap trick here? ) }, PrefDef(context, NonSettingsPrefs.VERSION, R.string.version) {