feat(graphs): add chart animation for when a value changes
This commit is contained in:
@@ -22,6 +22,7 @@ import androidx.compose.animation.core.AnimationSpec
|
|||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||||
import androidx.compose.material3.MaterialTheme.colorScheme
|
import androidx.compose.material3.MaterialTheme.colorScheme
|
||||||
|
import androidx.compose.material3.MaterialTheme.motionScheme
|
||||||
import androidx.compose.material3.MaterialTheme.typography
|
import androidx.compose.material3.MaterialTheme.typography
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@@ -96,7 +97,7 @@ fun TimeColumnChart(
|
|||||||
millisecondsToMinutes(value, minutesFormat)
|
millisecondsToMinutes(value, minutesFormat)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
animationSpec: AnimationSpec<Float>? = null
|
animationSpec: AnimationSpec<Float>? = motionScheme.defaultEffectsSpec()
|
||||||
) {
|
) {
|
||||||
ProvideVicoTheme(rememberM3VicoTheme()) {
|
ProvideVicoTheme(rememberM3VicoTheme()) {
|
||||||
CartesianChartHost(
|
CartesianChartHost(
|
||||||
@@ -160,6 +161,7 @@ fun TimeColumnChart(
|
|||||||
minZoom = Zoom.min(Zoom.Content, Zoom.fixed())
|
minZoom = Zoom.min(Zoom.Content, Zoom.fixed())
|
||||||
),
|
),
|
||||||
animationSpec = animationSpec,
|
animationSpec = animationSpec,
|
||||||
|
animateIn = false,
|
||||||
modifier = modifier.height(226.dp),
|
modifier = modifier.height(226.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import androidx.compose.animation.core.AnimationSpec
|
|||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||||
import androidx.compose.material3.MaterialTheme.colorScheme
|
import androidx.compose.material3.MaterialTheme.colorScheme
|
||||||
|
import androidx.compose.material3.MaterialTheme.motionScheme
|
||||||
import androidx.compose.material3.MaterialTheme.typography
|
import androidx.compose.material3.MaterialTheme.typography
|
||||||
import androidx.compose.material3.Surface
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
@@ -102,7 +103,7 @@ fun TimeLineChart(
|
|||||||
millisecondsToMinutes(value, minutesFormat)
|
millisecondsToMinutes(value, minutesFormat)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
animationSpec: AnimationSpec<Float>? = null
|
animationSpec: AnimationSpec<Float>? = motionScheme.defaultEffectsSpec()
|
||||||
) {
|
) {
|
||||||
ProvideVicoTheme(rememberM3VicoTheme()) {
|
ProvideVicoTheme(rememberM3VicoTheme()) {
|
||||||
CartesianChartHost(
|
CartesianChartHost(
|
||||||
@@ -183,6 +184,7 @@ fun TimeLineChart(
|
|||||||
minZoom = Zoom.min(Zoom.Content, Zoom.fixed())
|
minZoom = Zoom.min(Zoom.Content, Zoom.fixed())
|
||||||
),
|
),
|
||||||
animationSpec = animationSpec,
|
animationSpec = animationSpec,
|
||||||
|
animateIn = false,
|
||||||
modifier = modifier.height(224.dp),
|
modifier = modifier.height(224.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user