mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
[SES-1203] Disable radio buttons
This commit is contained in:
parent
8399771d5d
commit
a9467c7b96
@ -49,6 +49,7 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import org.session.libsession.utilities.recipients.Recipient
|
||||
import org.session.libsession.utilities.runIf
|
||||
import org.thoughtcrime.securesms.components.ProfilePictureView
|
||||
import org.thoughtcrime.securesms.conversation.disappearingmessages.ui.OptionsCard
|
||||
import kotlin.math.min
|
||||
@ -150,7 +151,7 @@ fun <T> TitledRadioButton(option: RadioOption<T>, onClick: () -> Unit) {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||
modifier = Modifier
|
||||
.clickable { if (!option.selected) onClick() }
|
||||
.runIf(option.enabled) { clickable { if (!option.selected) onClick() } }
|
||||
.heightIn(min = 60.dp)
|
||||
.padding(horizontal = 32.dp)
|
||||
.contentDescription(option.contentDescription)
|
||||
|
@ -367,6 +367,8 @@ object Util {
|
||||
}
|
||||
}
|
||||
|
||||
fun <T, R> T.runIf(condition: Boolean, block: T.() -> R): R where T: R = if (condition) block() else this
|
||||
|
||||
fun <T, K: Any> Iterable<T>.associateByNotNull(
|
||||
keySelector: (T) -> K?
|
||||
) = associateByNotNull(keySelector) { it }
|
||||
|
Loading…
Reference in New Issue
Block a user