summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-05-29 03:06:37 +0200
committerbunnei <bunneidev@gmail.com>2023-06-03 09:06:04 +0200
commitbfb4e3bcaa0b11d824bc2b273a158e28b9cd608c (patch)
tree06314ec372ac6b8c154e35bcc9736b5ea0966b85 /src/android
parentandroid: Stop building x86 packages in APKs (diff)
downloadyuzu-bfb4e3bcaa0b11d824bc2b273a158e28b9cd608c.tar
yuzu-bfb4e3bcaa0b11d824bc2b273a158e28b9cd608c.tar.gz
yuzu-bfb4e3bcaa0b11d824bc2b273a158e28b9cd608c.tar.bz2
yuzu-bfb4e3bcaa0b11d824bc2b273a158e28b9cd608c.tar.lz
yuzu-bfb4e3bcaa0b11d824bc2b273a158e28b9cd608c.tar.xz
yuzu-bfb4e3bcaa0b11d824bc2b273a158e28b9cd608c.tar.zst
yuzu-bfb4e3bcaa0b11d824bc2b273a158e28b9cd608c.zip
Diffstat (limited to 'src/android')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SearchFragment.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SearchFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SearchFragment.kt
index eb4f513d1..ebc0f164a 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SearchFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/SearchFragment.kt
@@ -19,6 +19,7 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.preference.PreferenceManager
import info.debatty.java.stringsimilarity.Jaccard
+import info.debatty.java.stringsimilarity.JaroWinkler
import org.yuzu.yuzu_emu.R
import org.yuzu.yuzu_emu.YuzuApplication
import org.yuzu.yuzu_emu.adapters.GameAdapter
@@ -150,7 +151,7 @@ class SearchFragment : Fragment() {
}
val searchTerm = binding.searchText.text.toString().lowercase(Locale.getDefault())
- val searchAlgorithm = Jaccard(2)
+ val searchAlgorithm = if (searchTerm.length > 1) Jaccard(2) else JaroWinkler()
val sortedList: List<Game> = filteredList.mapNotNull { game ->
val title = game.title.lowercase(Locale.getDefault())
val score = searchAlgorithm.similarity(searchTerm, title)