Update Compose

Fixes #7004

(cherry picked from commit 393fc14630)
This commit is contained in:
arkon
2022-05-11 22:29:28 -04:00
committed by Jobobby04
parent 61ff7f8b21
commit 6d1dcf0deb
4 changed files with 17 additions and 18 deletions
@@ -66,7 +66,7 @@ fun PreferenceRow(
Icon(
painter = painter,
modifier = Modifier
.padding(horizontal = horizontalPadding)
.padding(start = horizontalPadding, end = 16.dp)
.size(24.dp),
tint = MaterialTheme.colorScheme.primary,
contentDescription = null,
@@ -74,7 +74,7 @@ fun PreferenceRow(
}
Column(
Modifier
.padding(horizontal = horizontalPadding)
.padding(horizontal = 16.dp)
.weight(1f),
) {
Text(
@@ -99,7 +99,11 @@ fun PreferenceRow(
// SY <--
}
if (action != null) {
Box(Modifier.widthIn(min = 56.dp)) {
Box(
Modifier
.widthIn(min = 56.dp)
.padding(end = horizontalPadding),
) {
action()
}
}
@@ -122,11 +126,7 @@ fun SwitchPreference(
title = title,
subtitle = subtitle,
painter = painter,
action = {
Switch(checked = preference.value, onCheckedChange = null)
// TODO: remove this once switch checked state is fixed: https://issuetracker.google.com/issues/228336571
Text(preference.value.toString())
},
action = { Switch(checked = preference.value, onCheckedChange = null) },
onClick = { preference.value = !preference.value },
// SY -->
subtitleAnnotated = subtitleAnnotated,