fixup! impr: add animation
This commit is contained in:
parent
7f613a2106
commit
bc7e2b4100
@ -175,9 +175,9 @@ fun ScheduleItem(modifier: Modifier = Modifier, unit: ScheduleUnit, expanded: Bo
|
|||||||
}
|
}
|
||||||
|
|
||||||
val backgroundColor by animateColorAsState(
|
val backgroundColor by animateColorAsState(
|
||||||
targetValue = if (rel == 1f)
|
targetValue = if (ratio == 1f)
|
||||||
MaterialTheme.colorScheme.surfaceContainer
|
MaterialTheme.colorScheme.surfaceContainer
|
||||||
else if (rel == -1f)
|
else if (ratio == -1f)
|
||||||
MaterialTheme.colorScheme.secondaryContainer
|
MaterialTheme.colorScheme.secondaryContainer
|
||||||
else
|
else
|
||||||
MaterialTheme.colorScheme.primaryContainer,
|
MaterialTheme.colorScheme.primaryContainer,
|
||||||
@ -283,13 +283,13 @@ fun ScheduleItem(modifier: Modifier = Modifier, unit: ScheduleUnit, expanded: Bo
|
|||||||
verticalAlignment = Alignment.CenterVertically) {
|
verticalAlignment = Alignment.CenterVertically) {
|
||||||
Text(begin.toString(), fontWeight = FontWeight.Bold)
|
Text(begin.toString(), fontWeight = FontWeight.Bold)
|
||||||
AnimatedVisibility (
|
AnimatedVisibility (
|
||||||
(0f <= rel) and (rel < 1f),
|
(0f <= ratio) and (ratio < 1f),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.padding(horizontal = 2.dp)
|
.padding(horizontal = 2.dp)
|
||||||
) {
|
) {
|
||||||
DividerWithMarker(
|
DividerWithMarker(
|
||||||
positionPercentage = rel,
|
positionPercentage = ratio,
|
||||||
color = MaterialTheme.colorScheme.outline,
|
color = MaterialTheme.colorScheme.outline,
|
||||||
thickness = 3.dp,
|
thickness = 3.dp,
|
||||||
markerSize = 8.dp,
|
markerSize = 8.dp,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user