Fix detekt issues in develop (#1004)
Co-authored-by: Marco Romano <marcor@element.io>
This commit is contained in:
parent
f1d438e701
commit
eb80f5bbfe
3 changed files with 8 additions and 9 deletions
|
|
@ -52,7 +52,7 @@ fun Dp.applyScaleUp(): Dp = with(LocalDensity.current) {
|
|||
|
||||
@Preview
|
||||
@Composable
|
||||
fun DpScalePreview_0_75f() = WithFontScale(0.75f) {
|
||||
internal fun DpScalePreview_0_75f() = WithFontScale(0.75f) {
|
||||
ElementPreviewLight {
|
||||
val fontSizeInDp = 16.dp
|
||||
Column(
|
||||
|
|
@ -77,7 +77,7 @@ fun DpScalePreview_0_75f() = WithFontScale(0.75f) {
|
|||
|
||||
@Preview
|
||||
@Composable
|
||||
fun DpScalePreview_1_0f() = WithFontScale(1f) {
|
||||
internal fun DpScalePreview_1_0f() = WithFontScale(1f) {
|
||||
ElementPreviewLight {
|
||||
val fontSizeInDp = 16.dp
|
||||
Column(
|
||||
|
|
@ -102,7 +102,7 @@ fun DpScalePreview_1_0f() = WithFontScale(1f) {
|
|||
|
||||
@Preview
|
||||
@Composable
|
||||
fun DpScalePreview_1_5f() = WithFontScale(1.5f) {
|
||||
internal fun DpScalePreview_1_5f() = WithFontScale(1.5f) {
|
||||
ElementPreviewLight {
|
||||
val fontSizeInDp = 16.dp
|
||||
Column(
|
||||
|
|
|
|||
|
|
@ -51,13 +51,11 @@ fun Checkbox(
|
|||
var indeterminateState by remember { mutableStateOf(indeterminate) }
|
||||
androidx.compose.material3.TriStateCheckbox(
|
||||
state = if (!checked && indeterminateState) ToggleableState.Indeterminate else ToggleableState(checked),
|
||||
onClick = if (onCheckedChange != null) {
|
||||
onClick = onCheckedChange?.let {
|
||||
{
|
||||
indeterminateState = false
|
||||
onCheckedChange(!checked)
|
||||
}
|
||||
} else {
|
||||
null
|
||||
},
|
||||
modifier = modifier,
|
||||
enabled = enabled,
|
||||
|
|
|
|||
|
|
@ -43,15 +43,16 @@ suspend fun <T : Any> ReceiveTurbine<T>.consumeItemsUntilPredicate(
|
|||
): List<T> {
|
||||
val items = ArrayList<T>()
|
||||
tryOrNull {
|
||||
while (true) {
|
||||
var foundItemOrFinished = false
|
||||
while (!foundItemOrFinished) {
|
||||
when (val event = withTurbineTimeout(timeout) { awaitEvent() }) {
|
||||
is Event.Item<T> -> {
|
||||
items.add(event.value)
|
||||
if (predicate(event.value)) {
|
||||
break
|
||||
foundItemOrFinished = true
|
||||
}
|
||||
}
|
||||
else -> break
|
||||
Event.Complete, is Event.Error -> foundItemOrFinished = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue