style: replace cascade if with when
This commit is contained in:
@@ -149,12 +149,11 @@ fun ScheduleItem(modifier: Modifier = Modifier, unit: ScheduleUnit, expanded: Bo
|
|||||||
}
|
}
|
||||||
|
|
||||||
val backgroundColor by animateColorAsState(
|
val backgroundColor by animateColorAsState(
|
||||||
targetValue = if (ratio == 1f)
|
targetValue = when (ratio) {
|
||||||
MaterialTheme.colorScheme.surfaceContainer
|
1f -> MaterialTheme.colorScheme.surfaceContainer
|
||||||
else if (ratio == -1f)
|
-1f -> MaterialTheme.colorScheme.secondaryContainer
|
||||||
MaterialTheme.colorScheme.secondaryContainer
|
else -> MaterialTheme.colorScheme.primaryContainer
|
||||||
else
|
},
|
||||||
MaterialTheme.colorScheme.primaryContainer,
|
|
||||||
label = "backgroundTransition"
|
label = "backgroundTransition"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user