Is glance supported? #789
-
QuestionHey there! Sorry for the potentially dumb question: I'm working on building out a glance widget (that will actually be offered via a Flutter app) and I was hoping to use this library to do that. I think what I'm discovering (I have not worked with native Android since just before compose was introduced) is that the glance and compose libraries are somewhat fragmented. For instance when trying to build a java.lang.IllegalStateException: CompositionLocal LocalContext not present
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.noLocalProvidedFor(AndroidCompositionLocals.android.kt:164)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.access$noLocalProvidedFor(AndroidCompositionLocals.android.kt:1)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$LocalContext$1.invoke(AndroidCompositionLocals.android.kt:51)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$LocalContext$1.invoke(AndroidCompositionLocals.android.kt:50)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at androidx.compose.runtime.LazyValueHolder.getCurrent(ValueHolders.kt:29)
at androidx.compose.runtime.LazyValueHolder.getValue(ValueHolders.kt:31)
at androidx.compose.runtime.CompositionLocalMapKt.read(CompositionLocalMap.kt:90)
at androidx.compose.runtime.ComposerImpl.consume(Composer.kt:2135)
at com.patrykandpatrick.vico.compose.cartesian.CartesianChartHostKt.CartesianChartHostImpl(CartesianChartHost.kt:333)
at com.patrykandpatrick.vico.compose.cartesian.CartesianChartHostKt$CartesianChartHost$4.invoke(CartesianChartHost.kt:177)
at com.patrykandpatrick.vico.compose.cartesian.CartesianChartHostKt$CartesianChartHost$4.invoke(CartesianChartHost.kt:176)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:118)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
at com.patrykandpatrick.vico.compose.cartesian.CartesianChartHostKt.CartesianChartHostBox(CartesianChartHost.kt:415)
at com.patrykandpatrick.vico.compose.cartesian.CartesianChartHostKt.CartesianChartHost(CartesianChartHost.kt:176)
My reading on this is that the use of compose's Vico version(s)2.0.0-alpha.22 UI framework(s)Jetpack Compose |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello! No worries about the question—we’re happy to help. As noted here, Glance uses only some foundational Jetpack Compose APIs, and the two frameworks generally aren’t interoperable. Thus, Vico can’t be used with Glance, I’m afraid. This applies to most high-level Jetpack Compose libraries. |
Beta Was this translation helpful? Give feedback.
Hello! No worries about the question—we’re happy to help.
As noted here, Glance uses only some foundational Jetpack Compose APIs, and the two frameworks generally aren’t interoperable. Thus, Vico can’t be used with Glance, I’m afraid. This applies to most high-level Jetpack Compose libraries.