Fix: First start with filter when filterStrength is set to 0
This commit is contained in:
@@ -305,12 +305,20 @@ class DrawFragment : Fragment(),
|
|||||||
.keys
|
.keys
|
||||||
.toMutableList()
|
.toMutableList()
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (preferenceHelper.searchFromStart) {
|
||||||
|
// Filter apps that start with the search query and score higher than the filter strength
|
||||||
|
searchResults.filter { app ->
|
||||||
|
FuzzyFinder.normalizeString(app.appName, trimmedQuery) ||
|
||||||
|
app.appName.startsWith(trimmedQuery, ignoreCase = true)
|
||||||
|
}.toMutableList()
|
||||||
} else {
|
} else {
|
||||||
// If filter strength is less than 1, normalize app names for both cases
|
// If filter strength is less than 1, normalize app names for both cases
|
||||||
searchResults.filter { app ->
|
searchResults.filter { app ->
|
||||||
FuzzyFinder.normalizeString(app.appName, trimmedQuery)
|
FuzzyFinder.normalizeString(app.appName, trimmedQuery)
|
||||||
}.toMutableList()
|
}.toMutableList()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
val numberOfItemsLeft = finalResults.size
|
val numberOfItemsLeft = finalResults.size
|
||||||
|
|||||||
Reference in New Issue
Block a user