Add Space

This commit is contained in:
MrSluffy
2024-07-27 10:10:31 +08:00
parent 4a61cb261e
commit cb99d8f4e5
2 changed files with 2 additions and 0 deletions

View File

@@ -92,6 +92,7 @@ class LawnchairAppSearchAlgorithm(context: Context) : LawnchairSearchAlgorithm(c
val shortcuts = singleAppResult?.let { searchUtils.getShortcuts(it, context) }
if (shortcuts != null) {
if (shortcuts.isNotEmpty()) {
searchTargets.add(searchTargetFactory.createHeaderTarget(SPACE))
singleAppResult.let { searchTargets.add(searchTargetFactory.createAppSearchTarget(it, true)) }
searchTargets.addAll(shortcuts.map(searchTargetFactory::createShortcutTarget))
}

View File

@@ -229,6 +229,7 @@ class LawnchairLocalSearchAlgorithm(context: Context) : LawnchairSearchAlgorithm
val shortcuts = singleAppResult?.let { searchUtils.getShortcuts(it, context) }
if (shortcuts != null) {
if (shortcuts.isNotEmpty()) {
searchTargets.add(searchTargetFactory.createHeaderTarget(SPACE))
singleAppResult.let { searchTargets.add(searchTargetFactory.createAppSearchTarget(it, true)) }
searchTargets.addAll(shortcuts.map(searchTargetFactory::createShortcutTarget))
}