UseLet
This commit is contained in:
parent
b32cebf2c0
commit
a96351643e
2 changed files with 11 additions and 13 deletions
|
|
@ -61,16 +61,14 @@ fun PreferenceCheckbox(
|
||||||
color = enabled.toEnabledColor(),
|
color = enabled.toEnabledColor(),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
supportingContent = if (supportingText != null) {
|
supportingContent = supportingText?.let {
|
||||||
{
|
{
|
||||||
Text(
|
Text(
|
||||||
style = ElementTheme.typography.fontBodyMdRegular,
|
style = ElementTheme.typography.fontBodyMdRegular,
|
||||||
text = supportingText,
|
text = it,
|
||||||
color = enabled.toSecondaryEnabledColor(),
|
color = enabled.toSecondaryEnabledColor(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
null
|
|
||||||
},
|
},
|
||||||
trailingContent = ListItemContent.Checkbox(
|
trailingContent = ListItemContent.Checkbox(
|
||||||
checked = isChecked,
|
checked = isChecked,
|
||||||
|
|
|
||||||
|
|
@ -90,16 +90,16 @@ fun PreferenceText(
|
||||||
color = tintColor ?: enabled.toSecondaryEnabledColor(),
|
color = tintColor ?: enabled.toSecondaryEnabledColor(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else if (subtitleAnnotated != null) {
|
|
||||||
{
|
|
||||||
Text(
|
|
||||||
style = ElementTheme.typography.fontBodyMdRegular,
|
|
||||||
text = subtitleAnnotated,
|
|
||||||
color = tintColor ?: enabled.toSecondaryEnabledColor(),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
null
|
subtitleAnnotated?.let {
|
||||||
|
{
|
||||||
|
Text(
|
||||||
|
style = ElementTheme.typography.fontBodyMdRegular,
|
||||||
|
text = it,
|
||||||
|
color = tintColor ?: enabled.toSecondaryEnabledColor(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
trailingContent = if (currentValue != null || loadingCurrentValue || showEndBadge) {
|
trailingContent = if (currentValue != null || loadingCurrentValue || showEndBadge) {
|
||||||
ListItemContent.Custom {
|
ListItemContent.Custom {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue