98 questions
Advice
1
vote
1
replies
33
views
With Jetpack Glance, how do I place a HorizontalDivider between my items in a LazyColumn?
I am building my home widget UI with Glance. I can see there is a HorizontalDivider Jetpack Compose Component. However, it seems like there doesn't exist one for use with Jetpack Glance? I am trying ...
0
votes
0
answers
60
views
Android Glance AppWidget: How to make layout reliable across screen densities and user font scales?
I’m building a small 1×1 and 3x1 (1x1 * 3) Glance AppWidget. Its layout is a vertical stack of three items:
Top icon - optional
Text - always present
Bottom icon - always present
I want this widget to ...
1
vote
1
answer
204
views
Can I add StackView to the android widget if I use Glance?
I’m migrating my existing AppWidgetProvider-based widget to Jetpack Glance and I want to use a StackView (or ListView) inside the widget, backed by a RemoteViewsService (via setRemoteAdapter), just ...
0
votes
1
answer
121
views
Jetpack Compose/Glance: previewLayout value
An <appwidget-provider> expects a previewLayout attribute on modern Android versions. The documentation tells us what value we should use for initialLayout, but it never mentions the ...
1
vote
1
answer
380
views
Glance home widget colors don't when theme changes
I build a Glance Home Widget for Android, and I want to apply some transparency to my Box' background:
@Composable
private fun getTransparentColor(color: Color, transparency: Int): ...
0
votes
1
answer
168
views
Glance actionStartActivity not opening activity [closed]
This is the content of my widget:
@Composable
private fun MyContent(glanceModifier: GlanceModifier = GlanceModifier, widgetData: WidgetData) {
InfoPanel(
glanceModifier = ...
1
vote
0
answers
129
views
provideGlance not called after configuring widget
I have a Glance widget, and when configuring it initially I save some IDs to Shared Preferences.
These IDs should be read in the provideGlance method, but it is not called after configuring the widget,...
3
votes
2
answers
259
views
Update existing Android widget to Glance Compose
I'm trying to migrate an existing Android widget to use Glance Compose, but haven't been able to find any documentation or answers on if it's possible to make it so that users with my existing widget ...
0
votes
1
answer
374
views
Jetpack Compose Glance Widget Not Updating
I have a jetpack compose glance widget that shows a text message on startup.
If the user enables accessibility services for the app, the glance widget should change into a button. But that is not ...
2
votes
1
answer
229
views
Android Glance widget text not truncating properly inside row
I am using the Jetpack glance framework for creating widgets in Android, and I have encountered a problem when using text inside a row.
Expected behavior:- Text should truncate as soon as it touches ...
0
votes
1
answer
64
views
How to Draw 2 Circles and a Line in the Middle?
I am creating a Glance Widget.
I want to draw a circle and a line in the middle but I have a problem.
This is image my problem
This is my code
@Composable
fun TestCL() {
Row(
...
0
votes
2
answers
204
views
Using CoroutineWorker with Android Widget in Jetpack Glance results in just a loading indicator
I have created an Android Widget using Jetpack Glance, I need to update it using CoroutineWorker so I am using WorkManager for it, here is the sample code
class MyWidget : GlanceAppWidget() {
...
4
votes
1
answer
66
views
How to check if a widget cannot be installed, because system is not supporting them?
To check if a widget is placed on screen I use this function
override suspend fun checkWidgetsOnScreen(): Boolean =
withContext(defaultDispatcher) {
val glanceId = ...
1
vote
1
answer
2k
views
How to dynamically adjust Jetpack Glance App Widget layout on resize?
I'm building an Android widget with Jetpack Glance and want to adjust the layout based on widget width changes. I’ve tried several approaches but haven’t found a consistent way to handle dynamic ...
1
vote
1
answer
100
views
SqlDelight Coroutines Flow doesnt emit data to Jetpack Glance widget
I am building a small todo list widget for fun and learning. I wanted to use SqlDelight for persisting the data and Jetpack Glance for building the android widget. This is my code:
in GlanceWidget
...