Olauncher
Olauncher copied to clipboard
Prioritize exact and closer matches – new app name filtering and sorting algorithm
This is an attempt to address issue #526 and give some more possible results for approximate matches.
This pull request introduces a new filtering mechanism for app labels using string similarity algorithms. The most important changes include adding dependencies, creating a new helper class for app label filtering, updating the adapter to use the new filtering logic, and modifying the fragment to support the new filter.
New Dependencies:
app/build.gradle: Addedsimmetrics-corefor string similarity algorithms and a workaround forlistenablefutureto avoid conflicts with Guava.gradle/libs.versions.toml: Addedsimmetrics-coredependency.
New Helper Class:
app/src/main/java/app/olauncher/helper/AppLabelFilter.kt: CreatedAppLabelFilterclass to filter apps based on label similarity usingStringMetric.
String Utilities:
app/src/main/java/app/olauncher/helper/StringUtils.kt: Added utility functions for string normalization and longest common subsequence calculation.
Adapter Updates:
app/src/main/java/app/olauncher/ui/AppDrawerAdapter.kt: UpdatedAppDrawerAdapterto useAppLabelFilterfor filtering and added a listener for filter list submission. [1] [2] [3] [4] [5]
Fragment Updates:
app/src/main/java/app/olauncher/ui/AppDrawerFragment.kt: ModifiedAppDrawerFragmentto handle the new filter list submission listener and scroll to the top of the list when filtering is applied. [1] [2]
resolves #526 fixes #434