Questions tagged [glance-appwidget]

Use this tag to ask questions for Jetpack Glance for AppWidget

API reference for Jetpack Glance for AppWidget: https://developer.android.com/reference/kotlin/androidx/glance/appwidget/package-summary

Code samples and guidance: https://github.com/android/user-interface-samples/tree/glance/AppWidget/glance-widget

59 questions
4
votes
1 answer

In Android, Glance widgets are "flickering" during every update (even if there is no content change)

I'm not sure if this is a problem with Glance still being in alpha, or if I'm doing something wrong. But every time the widget receiver's onUpdate() is triggered, it's being completely re-composed. It resets to the initialLayout for a second, and…
user496854
  • 6,461
  • 10
  • 47
  • 84
4
votes
1 answer

Specify different colors in night mode for App Widget written with Glance

How I can specify the colors in day vs night mode on a Glance AppWidget and have the system choose the right one when the user turns the night mode on or off?
PierreBdR
  • 42,120
  • 10
  • 46
  • 62
3
votes
2 answers

How to load images from the internet into a widget with Jetpack Glance?

I have a widget developed with Jetpack Compose and with the Jetpack Glance library, this widget is a LazyColumn list, in which I pass the information after making a query to the Room Database database. To try to load the image I used Image() with…
3
votes
1 answer

How to make live update of glance widget?

Is that possible to make live update the data of Widget using Glance jetpack compose ? Like update data while database is changes . For example while I am using flow so flow should be able to update the widget data right? We can update on Click…
2
votes
0 answers

Jetpack glance widget only the whitespace is clickable, text and image are not

I have a glance widget that contains a column. The column has tiles containing text and image. The row has clickable modifier, however, I can click only the whitespace. Any way to solve this? There is a similar question however the answer to it…
Subfly
  • 492
  • 2
  • 13
2
votes
1 answer

How does Jetpack Glance widget works without XML? How does it convert to RemoteViews?

Jetpack released a tool called "Glance" that we can replace RemoteViews XML widgets. I wonder how it converts compose layouts to RemoteViews.
2
votes
0 answers

How to show image in android remote view using content URI?

I am having trouble trying to show an image in a remote view with a contentUri. I have outlined the steps I took below. I believe I have followed the procedure correctly but still get a "Can't load widget" message. What am I doing wrong? Is the…
2
votes
1 answer

Is there a way to add linecharts to a GlanceAppWidget?

Pretty much the title, im trying to make a widget that contains some data and linecharts, i know this glance stuff is pretty new, so im not sure if its possible to do this.
2
votes
4 answers

How to get the AppWidgetId of a Compose Glance widget?

I have a table with all the widgets a user has created. I want to customize individual widgets using the according table entry and update the according table entry upon interaction with a widget. uid AppWidgetId Title 0 23 First…
1
vote
1 answer

GlanceAppWidget screen refreshing not working on versions before API 32

I have made a home screen widget with compose glance. It works perfectly on API 32. But for all API < 32, the widget is not updating when new preferences/state are updated. What I have tried : Understanding deeper the way state preferences interact…
1
vote
1 answer

how to regularly update a Jetpack Compose Widget implemented in Glance

i would like to implement an android widget using Glance that is basically updated regularly, at least each minute. the updatePeriodMillis property used in the manifest file allows for updates no faster that 30 minutes, while using the WorkManager…
memical
  • 2,353
  • 1
  • 24
  • 36
1
vote
3 answers

Android DataStore : how to create it with a dynamic filename?

Based on the following Kotlin code (from Glance AppWidget), how can I inject the fileKey in the dataStore() method (which seems possible due to the comment above) ? /** * Use the same file name regardless of the widget instance to share data…
Jscti
  • 14,096
  • 4
  • 62
  • 87
1
vote
1 answer

Android Glance Widget - Corner Radius Cliping on Android 12-

Using Glance beta-01 To handle cornerRadius on Android 12-, we cannot use the GlanceModifier.cornerRadius. So using a custom xml background does the trick, but the Cliping (hiding the content overflowing the radius) only works on the targeted…
Jscti
  • 14,096
  • 4
  • 62
  • 87
1
vote
1 answer

Glance widget actionStartActivity not working properly

I am trying to implement a glance widget and start an activity while clicking on a button. But it seems like it's not working properly for me. This is my code: DistributionDateView(context, deliveryDates, postalCode) { println("it…
Meyben
  • 451
  • 3
  • 15
1
vote
2 answers

Delete the Glance widget from home screen

I would like delete my widget (Glance Jetpack) from the home screen, but unsuccesfull. My code is: val scope = CoroutineScope(Dispatchers.Default) scope.launch { val glanceId…
1
2 3 4