Questions tagged [glance]

Use this tag to ask questions for Jetpack Glance

You can also find the API reference for Jetpack Glance here: https://developer.android.com/reference/kotlin/androidx/glance/package-summary

39 questions
6
votes
1 answer

E/GlanceAppWidget: Error in Glance App Widget IllegalStateException: CompositionLocal LocalConfiguration not present

I am developing an app widget with compose. I have a problem with getting string from resources. If I give text as a string like text = "Label", it is working properly. But if I give with stringResource, text is not shown, and I see this problem. Is…
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
1 answer

Jetpack compose (Glance) widget doesn't recompose after bitmap image is loaded

I'm trying to create an Appwidget, using Glance Jetpack with .SVG image support. I'm able to download the bitmap using ImageRequest.Builder(this) .data(url) .decoderFactory(SvgDecoder.Factory()) ...and as seen in the last line of…
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

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

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
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
0 answers

How to update the Widget in Jetpack Glance...?

I'm using Jetpack Glance for making widgets, they are in my case composable. However, I'm completely lost on how to update them. Let's start with my specific dependency, just to be clear: implementation…
1
vote
1 answer

Jetpack Glance Widget: Scroll to specific item in LazyColumn

I have the widget that fetch and display the list of data via LazyColumn. After the data loaded, I want the LazyColumn to scroll to specific item. In Jetpack Compose we have LazyListState but do we have something similar in Glance? (or any…
1
vote
2 answers

Display data from database (room) in widget (glance) using jetpack compose?

While developing my note-taking app and as a new feature I wanna create a widget for my app by jetpack lib glance. At first, I thought it would be like a normal database implementation, but it didn't work, And I have no idea how it does, even when I…
Youn Tivoli
  • 230
  • 2
  • 13
1
vote
2 answers

Rounded corners of image in Jetpack Glance Widget

Is there any way how to make image corners in Jetpack Glance Widget rounded? I know there is a GlanceModifier method cornerRadius, but this is available only in higher versions (S+).
1
2 3