Fix checked apps disappearing in the list (#2282)

This commit is contained in:
Howard Wu 2022-12-06 17:37:17 +08:00 committed by GitHub
parent 2294fc8c34
commit 66a20e2275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -164,11 +164,11 @@ public class ScopeAdapter extends EmptyStateRecyclerView.EmptyStateAdapter<Scope
return new ViewHolder(ItemModuleBinding.inflate(activity.getLayoutInflater(), parent, false)); return new ViewHolder(ItemModuleBinding.inflate(activity.getLayoutInflater(), parent, false));
} }
private boolean shouldHideApp(PackageInfo info, ApplicationWithEquals app) { private boolean shouldHideApp(PackageInfo info, ApplicationWithEquals app, HashSet<ScopeAdapter.ApplicationWithEquals> tmpChkList) {
if (info.packageName.equals("android")) { if (info.packageName.equals("android")) {
return false; return false;
} }
if (checkedList.contains(app)) { if (tmpChkList.contains(app)) {
return false; return false;
} }
if (preferences.getBoolean("filter_denylist", false)) { if (preferences.getBoolean("filter_denylist", false)) {
@ -547,7 +547,7 @@ public class ScopeAdapter extends EmptyStateRecyclerView.EmptyStateAdapter<Scope
tmpChkList.add(application); tmpChkList.add(application);
} }
} }
} else if (shouldHideApp(info, application)) { } else if (shouldHideApp(info, application, tmpChkList)) {
return; return;
} }