trailingContent and supportingContent should be null if there is nothing to display.
This commit is contained in:
parent
8339a6f1f3
commit
ea93579b23
1 changed files with 36 additions and 28 deletions
|
|
@ -82,22 +82,27 @@ fun PreferenceText(
|
|||
color = tintColor ?: enabled.toEnabledColor(),
|
||||
)
|
||||
},
|
||||
supportingContent = {
|
||||
if (subtitle != null) {
|
||||
supportingContent = if (subtitle != null) {
|
||||
{
|
||||
Text(
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
text = subtitle,
|
||||
color = tintColor ?: enabled.toSecondaryEnabledColor(),
|
||||
)
|
||||
}
|
||||
} else if (subtitleAnnotated != null) {
|
||||
{
|
||||
Text(
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
text = subtitleAnnotated,
|
||||
color = tintColor ?: enabled.toSecondaryEnabledColor(),
|
||||
)
|
||||
}
|
||||
} else {
|
||||
null
|
||||
},
|
||||
trailingContent = ListItemContent.Custom {
|
||||
trailingContent = if (currentValue != null || loadingCurrentValue || showEndBadge) {
|
||||
ListItemContent.Custom {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
|
|
@ -123,7 +128,10 @@ fun PreferenceText(
|
|||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
} else {
|
||||
null
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue