mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-03-24 15:10:04 +01:00
if a widget has no preview image, use the app icon
This commit is contained in:
parent
716b7fbfec
commit
9455479cd4
@ -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…
x
Reference in New Issue
Block a user