diff --git a/services/icons/src/main/java/de/mm20/launcher2/icons/IconService.kt b/services/icons/src/main/java/de/mm20/launcher2/icons/IconService.kt index 665d6910..e470cc1f 100644 --- a/services/icons/src/main/java/de/mm20/launcher2/icons/IconService.kt +++ b/services/icons/src/main/java/de/mm20/launcher2/icons/IconService.kt @@ -367,27 +367,15 @@ class IconService( suspend fun searchCustomIcons(query: String, iconPack: IconPack?): List { val transformations = this.transformations.first() val iconPackIcons = iconPackManager.searchIconPackIcon(query, iconPack).flatMap { - val unthemedIcon = if (it.themed) { - iconPackManager.getIcon(it.iconPack, it, false) + val themedIcon = if (it.themed) { + iconPackManager.getIcon(it.iconPack, it, true) ?.transform(transformations) } else null - val icon = iconPackManager.getIcon(it.iconPack, it, true) + val unthemedIcon = iconPackManager.getIcon(it.iconPack, it, false) ?.transform(transformations) buildList { val ent = it.toDatabaseEntity() - if (icon != null) { - add(CustomIconWithPreview( - customIcon = CustomIconPackIcon( - iconPackPackage = it.iconPack, - type = ent.type, - drawable = ent.drawable, - extras = ent.extras, - allowThemed = true, - ), - preview = icon - )) - } if (unthemedIcon != null) { add(CustomIconWithPreview( customIcon = CustomIconPackIcon( @@ -400,6 +388,18 @@ class IconService( preview = unthemedIcon )) } + if (themedIcon != null) { + add(CustomIconWithPreview( + customIcon = CustomIconPackIcon( + iconPackPackage = it.iconPack, + type = ent.type, + drawable = ent.drawable, + extras = ent.extras, + allowThemed = true, + ), + preview = themedIcon + )) + } } }