https://kotlinlang.org logo
#glance
Title
# glance
b

Birgit L

03/15/2024, 3:16 PM
Have you guys had success with using the
glance-experimental-tools
for getting a preview for your app widget? I've tried
appwidget-host
as well as
appwidget-viewer
but didn't have success with either method. Is this still the way to do glance previews or is there a newer method out there? My widget is done, so technically I don't need previews any more but I would have liked to use the preview image export.
f

Feri Nagy

03/18/2024, 8:36 AM
GlanceAppWidgetHost.kt.cpp
👀 1
Hello. I could not use the library directly as a dependency because of some conflict with recent compose version, but I managed to extract the
GlanceAppWidgetHost
and use that locally.
Also keep in mind as mentioned in docs - you need to run the preview on device, it will not render in the studio.
b

Birgit L

03/18/2024, 4:07 PM
@Feri Nagy thanks for the code! 🙇 I'll try to get it to work with my widget
4 Views