From 9455479cd4b103e3e47116297b1d2fdcf507ee23 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 14 Sep 2022 20:55:32 +0200 Subject: [PATCH] if a widget has no preview image, use the app icon --- .../com/simplemobiletools/launcher/fragments/WidgetsFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/fragments/WidgetsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/fragments/WidgetsFragment.kt index b147add..ecd681c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/fragments/WidgetsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/fragments/WidgetsFragment.kt @@ -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)