Add disabled group options

This commit is contained in:
andrew 2023-08-28 09:37:19 +09:30
parent 9f6dd728d5
commit bfd2370730
2 changed files with 4 additions and 1 deletions

View File

@ -285,6 +285,7 @@ fun TitledRadioButton(option: OptionModel) {
}
RadioButton(
selected = option.selected,
enabled = option.enabled,
onClick = option.onClick,
modifier = Modifier
.height(26.dp)

View File

@ -142,7 +142,8 @@ class ExpirationSettingsViewModel(
title: GetString = GetString { ExpirationUtil.getExpirationDisplayValue(it, duration.inWholeSeconds.toInt()) },
) = OptionModel(
title = title,
selected = state.expiryMode?.duration == duration
selected = state.expiryMode?.duration == duration,
enabled = state.isSelfAdmin
) { setTime(duration.inWholeSeconds) }
private fun noteToSelfOption(
@ -244,6 +245,7 @@ data class OptionModel(
val title: GetString,
val subtitle: GetString? = null,
val selected: Boolean = false,
val enabled: Boolean = true,
val onClick: () -> Unit = {}
)