From 8c089c41306745ba53ed156baf48bc57e20c43d2 Mon Sep 17 00:00:00 2001 From: MrLetsplay Date: Sat, 27 Apr 2024 16:50:30 +0200 Subject: [PATCH] Fix search everywhere setting --- .../code_guard/otplist/OTPListAdapter.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/cringe_studios/code_guard/otplist/OTPListAdapter.java b/app/src/main/java/com/cringe_studios/code_guard/otplist/OTPListAdapter.java index 93afbd5..ae25528 100644 --- a/app/src/main/java/com/cringe_studios/code_guard/otplist/OTPListAdapter.java +++ b/app/src/main/java/com/cringe_studios/code_guard/otplist/OTPListAdapter.java @@ -233,9 +233,14 @@ public class OTPListAdapter extends RecyclerView.Adapter { query = query.toLowerCase(); - List allOTPs = new ArrayList<>(); - for(String group : SettingsUtil.getGroups(context)) { - allOTPs.addAll(OTPDatabase.getLoadedDatabase().getOTPs(group)); + List allOTPs; + if(!SettingsUtil.isSearchEverywhere(context)) { + allOTPs = items; + }else { + allOTPs = new ArrayList<>(); + for(String group : SettingsUtil.getGroups(context)) { + allOTPs.addAll(OTPDatabase.getLoadedDatabase().getOTPs(group)); + } } List filtered = new ArrayList<>();