Fix: First start with filter when filterStrength is set to 0

This commit is contained in:
HeCodes2Much
2024-12-04 12:56:02 +00:00
parent 99c2d0c510
commit ff7ecb1491

View File

@@ -306,10 +306,18 @@ class DrawFragment : Fragment(),
.toMutableList() .toMutableList()
} }
} else { } else {
// If filter strength is less than 1, normalize app names for both cases if (preferenceHelper.searchFromStart) {
searchResults.filter { app -> // Filter apps that start with the search query and score higher than the filter strength
FuzzyFinder.normalizeString(app.appName, trimmedQuery) searchResults.filter { app ->
}.toMutableList() FuzzyFinder.normalizeString(app.appName, trimmedQuery) ||
app.appName.startsWith(trimmedQuery, ignoreCase = true)
}.toMutableList()
} else {
// If filter strength is less than 1, normalize app names for both cases
searchResults.filter { app ->
FuzzyFinder.normalizeString(app.appName, trimmedQuery)
}.toMutableList()
}
} }