mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-17 13:58:25 +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.unit.sp
|
||||||
import androidx.compose.ui.viewinterop.AndroidView
|
import androidx.compose.ui.viewinterop.AndroidView
|
||||||
import org.session.libsession.utilities.recipients.Recipient
|
import org.session.libsession.utilities.recipients.Recipient
|
||||||
|
import org.session.libsession.utilities.runIf
|
||||||
import org.thoughtcrime.securesms.components.ProfilePictureView
|
import org.thoughtcrime.securesms.components.ProfilePictureView
|
||||||
import org.thoughtcrime.securesms.conversation.disappearingmessages.ui.OptionsCard
|
import org.thoughtcrime.securesms.conversation.disappearingmessages.ui.OptionsCard
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
@ -150,7 +151,7 @@ fun <T> TitledRadioButton(option: RadioOption<T>, onClick: () -> Unit) {
|
|||||||
Row(
|
Row(
|
||||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clickable { if (!option.selected) onClick() }
|
.runIf(option.enabled) { clickable { if (!option.selected) onClick() } }
|
||||||
.heightIn(min = 60.dp)
|
.heightIn(min = 60.dp)
|
||||||
.padding(horizontal = 32.dp)
|
.padding(horizontal = 32.dp)
|
||||||
.contentDescription(option.contentDescription)
|
.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(
|
fun <T, K: Any> Iterable<T>.associateByNotNull(
|
||||||
keySelector: (T) -> K?
|
keySelector: (T) -> K?
|
||||||
) = associateByNotNull(keySelector) { it }
|
) = associateByNotNull(keySelector) { it }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user