Closed crroush closed 2 years ago
Which IDE? Have you tried the interactive preview?
The issue might be that there's no way to disable the chart animation, and even using snap()
does not make the preview render correctly. It always renders the initial frame instead, with no values whasoever. I had the same issue with BarChart.
@bytebeats Any chance of making animation
optional?
@crizzis @crroush @Preview failed to work for:
$ adb shell am start -n "me.bytebeats.views.charts.test/androidx.compose.ui.tooling.PreviewActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER --es composable me.bytebeats.views.charts.pie.PieChartKt.PieChartPreview
Error while executing: am start -n "me.bytebeats.views.charts.test/androidx.compose.ui.tooling.PreviewActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER --es composable me.bytebeats.views.charts.pie.PieChartKt.PieChartPreview
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=me.bytebeats.views.charts.test/androidx.compose.ui.tooling.PreviewActivity (has extras) }
Error type 3
Error: Activity class {me.bytebeats.views.charts.test/androidx.compose.ui.tooling.PreviewActivity} does not exist.
Error while Launching activity
Failed to launch an application on all devices
From me.bytebeats.views.charts.test/androidx.compose.ui.tooling.PreviewActivity
we can see that's because no androidx.compose.ui.tooling.PreviewActivity
when debugging.
Actually, if debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
is included into charts/build.gradle
, @Preview will work.
I am using a Android Studio 2021.1.1 Patch 3, with Jetpack Compose 1.1.1 I can display the chart no problem on my device