Browse Source

UseLet

pull/2922/head
Benoit Marty 4 months ago
parent
commit
414e2bb3f1
  1. 6
      libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt
  2. 18
      libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceText.kt

6
libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt

@ -61,16 +61,14 @@ fun PreferenceCheckbox( @@ -61,16 +61,14 @@ fun PreferenceCheckbox(
color = enabled.toEnabledColor(),
)
},
supportingContent = if (supportingText != null) {
supportingContent = supportingText?.let {
{
Text(
style = ElementTheme.typography.fontBodyMdRegular,
text = supportingText,
text = it,
color = enabled.toSecondaryEnabledColor(),
)
}
} else {
null
},
trailingContent = ListItemContent.Checkbox(
checked = isChecked,

18
libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceText.kt

@ -90,16 +90,16 @@ fun PreferenceText( @@ -90,16 +90,16 @@ fun PreferenceText(
color = tintColor ?: enabled.toSecondaryEnabledColor(),
)
}
} else if (subtitleAnnotated != null) {
{
Text(
style = ElementTheme.typography.fontBodyMdRegular,
text = subtitleAnnotated,
color = tintColor ?: enabled.toSecondaryEnabledColor(),
)
}
} else {
null
subtitleAnnotated?.let {
{
Text(
style = ElementTheme.typography.fontBodyMdRegular,
text = it,
color = tintColor ?: enabled.toSecondaryEnabledColor(),
)
}
}
},
trailingContent = if (currentValue != null || loadingCurrentValue || showEndBadge) {
ListItemContent.Custom {

Loading…
Cancel
Save