I have an Android GlanceAppWidget and would like to test the onAction in its ActionCallback.
What is the best way to trigger the code in onAction for instrumentation testing?
The below code illustrates what I am trying to do.
@Test
fun…
I am trying to create a base class GenericAction to handle Glance widget updates. It needs to take two parameters: an Object GlanceStateDefinition and Class GlanceAppWidget() as each widget will have a different state definition and broadcast…
I know that it is not the best title in the world but let me explain the problem first,
I have implemented a Glance widget with some items in it and when you press them, the app should be opened and navigated to the specific screen given via…
I see very little information on how to test RemoteViews. For example, I have used UiAutomator to place an app widget on the homescreen and now i want to test if it updates correctly when I click on it.
Does anybody know good resources and examples…
I want to do the following:
Column(modifier = modifier.verticalScroll().clickable(
onClick = actionStartActivity(MainActivity::class.java)
)) {
Text(text = "some really long text")
}
The problem is that there is no verticalScroll modifier,…
I want to update my Glance App Widget state inside CoroutineWorker:
class MyWorker(appContext: Context, workerParams: WorkerParameters) :
CoroutineWorker(appContext, workerParams) {
override suspend fun doWork(): Result {
val…
I have an app which has a home screen widget via GlanceAppWidget().
I would like to run a worker inside the Content() function of GlanceAppWidget(). I have used enqueue(work) from WorkManager api to successfully execute my worker.
The problem is…
In the the below medium article written by a Google Android Engineer, it states that the best way to fetch data in a glance widget is to use WorkManager.
The best way to fetch data asynchronously from the background is by using WorkManager and…
I have an android homescreen widget created with the new Glance api which contains a lazy column. Each row in the column displays an image with ImageProvider(contentUri).
The image has been retrieved from a URL with Glide and saved to internal…
I want to pass custom model list to glance widget but when i send to list and update widget then widget is re-creating.How can i pass custom model list to glance widget.My github project url in below.The purpose of my project is list of last 10 post…
When I try to display a bitmap image (of my app icon) in the app, it works ok, but crashes when I try to display it in Widget Glance.
This is my code for bitmap:
val icon = packageManager.getApplicationIcon("com.myapp.packagename")
val…
In a glance Text(), there's a style attribute, and this takes a glance TextStyle.
This TextStyle is different to the TextStyle you use in your MaterialTheme. So you can't reuse your app's TextStyles.
Is it possible to reuse your app's TextStyles in…
Component used: GlanceAppWidget
Library & Version used: androidx.glance:glance-appwidget:1.0.0-alpha03
In the Row and Column if we have more than 1 button onClick and if we use actionStartActivity and pass the intent and parameters, it will take the…
I am running a worker in a glance composable on android.
why is onReceive being continuously called in an infinite loop?
What am I missing here?
class MyWidget : GlanceAppWidget() {
@Composable
override fun Content() {
val work =…