File tree 1 file changed +12
-4
lines changed
app/src/main/java/com/github/droidworksstudio/launcher/ui/drawer
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -306,10 +306,18 @@ class DrawFragment : Fragment(),
306
306
.toMutableList()
307
307
}
308
308
} else {
309
- // If filter strength is less than 1, normalize app names for both cases
310
- searchResults.filter { app ->
311
- FuzzyFinder .normalizeString(app.appName, trimmedQuery)
312
- }.toMutableList()
309
+ if (preferenceHelper.searchFromStart) {
310
+ // Filter apps that start with the search query and score higher than the filter strength
311
+ searchResults.filter { app ->
312
+ FuzzyFinder .normalizeString(app.appName, trimmedQuery) ||
313
+ app.appName.startsWith(trimmedQuery, ignoreCase = true )
314
+ }.toMutableList()
315
+ } else {
316
+ // If filter strength is less than 1, normalize app names for both cases
317
+ searchResults.filter { app ->
318
+ FuzzyFinder .normalizeString(app.appName, trimmedQuery)
319
+ }.toMutableList()
320
+ }
313
321
}
314
322
315
323
You can’t perform that action at this time.
0 commit comments