Olauncher icon indicating copy to clipboard operation
Olauncher copied to clipboard

Prioritize exact and closer matches – new app name filtering and sorting algorithm

Open igrvlhlb opened this issue 7 months ago • 1 comments

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: Added simmetrics-core for string similarity algorithms and a workaround for listenablefuture to avoid conflicts with Guava.
  • gradle/libs.versions.toml: Added simmetrics-core dependency.

New Helper Class:

  • app/src/main/java/app/olauncher/helper/AppLabelFilter.kt: Created AppLabelFilter class to filter apps based on label similarity using StringMetric.

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: Updated AppDrawerAdapter to use AppLabelFilter for 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: Modified AppDrawerFragment to 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

igrvlhlb avatar Mar 16 '25 21:03 igrvlhlb