parent
5fab16beec
commit
a4be78d6b1
@ -367,27 +367,15 @@ class IconService(
|
|||||||
suspend fun searchCustomIcons(query: String, iconPack: IconPack?): List<CustomIconWithPreview> {
|
suspend fun searchCustomIcons(query: String, iconPack: IconPack?): List<CustomIconWithPreview> {
|
||||||
val transformations = this.transformations.first()
|
val transformations = this.transformations.first()
|
||||||
val iconPackIcons = iconPackManager.searchIconPackIcon(query, iconPack).flatMap {
|
val iconPackIcons = iconPackManager.searchIconPackIcon(query, iconPack).flatMap {
|
||||||
val unthemedIcon = if (it.themed) {
|
val themedIcon = if (it.themed) {
|
||||||
iconPackManager.getIcon(it.iconPack, it, false)
|
iconPackManager.getIcon(it.iconPack, it, true)
|
||||||
?.transform(transformations)
|
?.transform(transformations)
|
||||||
} else null
|
} else null
|
||||||
val icon = iconPackManager.getIcon(it.iconPack, it, true)
|
val unthemedIcon = iconPackManager.getIcon(it.iconPack, it, false)
|
||||||
?.transform(transformations)
|
?.transform(transformations)
|
||||||
|
|
||||||
buildList {
|
buildList {
|
||||||
val ent = it.toDatabaseEntity()
|
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) {
|
if (unthemedIcon != null) {
|
||||||
add(CustomIconWithPreview(
|
add(CustomIconWithPreview(
|
||||||
customIcon = CustomIconPackIcon(
|
customIcon = CustomIconPackIcon(
|
||||||
@ -400,6 +388,18 @@ class IconService(
|
|||||||
preview = unthemedIcon
|
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
|
||||||
|
))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user