if a widget has no preview image, use the app icon
This commit is contained in:
parent
716b7fbfec
commit
9455479cd4
1 changed files with 1 additions and 1 deletions
|
@ -49,7 +49,7 @@ class WidgetsFragment(context: Context, attributeSet: AttributeSet) : MyFragment
|
|||
val appTitle = appMetadata.appTitle
|
||||
val appIcon = appMetadata.appIcon
|
||||
val widgetTitle = info.loadLabel(context.packageManager)
|
||||
val widgetPreviewImage = info.loadPreviewImage(context, DisplayMetrics.DENSITY_MEDIUM)
|
||||
val widgetPreviewImage = info.loadPreviewImage(context, DisplayMetrics.DENSITY_MEDIUM) ?: appIcon
|
||||
val width = info.minWidth
|
||||
val height = info.minHeight
|
||||
val widget = AppWidget(appPackageName, appTitle, appIcon, widgetTitle, widgetPreviewImage, width, height)
|
||||
|
|
Loading…
Reference in a new issue