From 76e7c5623d1dadc806cf53f8c9b6aae6c02288ab Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 23 Jul 2017 18:33:16 +0800 Subject: [PATCH] Simplify ApplicationAdapter filter --- .../magisk/adapters/ApplicationAdapter.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java b/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java index 3aaadecf5..7e0354928 100644 --- a/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java @@ -129,30 +129,23 @@ public class ApplicationAdapter extends RecyclerView.Adapter filteredApps; if (constraint == null || constraint.length() == 0) { - filteredApps = mOriginalList; + mList = mOriginalList; } else { - filteredApps = new ArrayList<>(); + mList = new ArrayList<>(); String filter = constraint.toString().toLowerCase(); for (ApplicationInfo info : mOriginalList) { if (Utils.lowercaseContains(info.loadLabel(pm), filter) || Utils.lowercaseContains(info.packageName, filter)) { - filteredApps.add(info); + mList.add(info); } } } - - FilterResults results = new FilterResults(); - results.values = filteredApps; - results.count = filteredApps.size(); - return results; + return null; } - @SuppressWarnings("unchecked") @Override protected void publishResults(CharSequence constraint, FilterResults results) { - mList = (List) results.values; notifyDataSetChanged(); } }