widget: async update
This commit is contained in:
parent
b743d0de47
commit
22eee299c5
1 changed files with 9 additions and 5 deletions
|
@ -41,12 +41,16 @@ class HomeWidgetProvider : AppWidgetProvider() {
|
||||||
for (widgetId in appWidgetIds) {
|
for (widgetId in appWidgetIds) {
|
||||||
val widgetInfo = appWidgetManager.getAppWidgetOptions(widgetId)
|
val widgetInfo = appWidgetManager.getAppWidgetOptions(widgetId)
|
||||||
|
|
||||||
defaultScope.launch {
|
goAsync().run {
|
||||||
val backgroundProps = getProps(context, widgetId, widgetInfo, drawEntryImage = false)
|
defaultScope.launch {
|
||||||
updateWidgetImage(context, appWidgetManager, widgetId, backgroundProps)
|
val backgroundProps = getProps(context, widgetId, widgetInfo, drawEntryImage = false)
|
||||||
|
updateWidgetImage(context, appWidgetManager, widgetId, backgroundProps)
|
||||||
|
|
||||||
val imageProps = getProps(context, widgetId, widgetInfo, drawEntryImage = true, reuseEntry = false)
|
val imageProps = getProps(context, widgetId, widgetInfo, drawEntryImage = true, reuseEntry = false)
|
||||||
updateWidgetImage(context, appWidgetManager, widgetId, imageProps)
|
updateWidgetImage(context, appWidgetManager, widgetId, imageProps)
|
||||||
|
|
||||||
|
finish()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue