Prioritize exact and closer matches – new app name filtering and sorting algorithm #592
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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