From cc262d6595f9096220d440d07967a24b0e5b6816 Mon Sep 17 00:00:00 2001 From: tonymanou Date: Sun, 8 Jan 2017 15:52:53 +0100 Subject: [PATCH] Change click listener to checked state listener in magisk hide --- .../topjohnwu/magisk/adapters/ApplicationAdapter.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 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 6145b6812..e1c1b5ed7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/adapters/ApplicationAdapter.java @@ -55,15 +55,14 @@ public class ApplicationAdapter extends RecyclerView.Adapter { - CheckBox chkbox = (CheckBox) v; - if (chkbox.isChecked()) { + holder.checkBox.setOnCheckedChangeListener(null); + holder.checkBox.setChecked(mHideList.contains(info.packageName)); + holder.checkBox.setOnCheckedChangeListener((v, isChecked) -> { + if (isChecked) { new Async.MagiskHide().add(info.packageName); mHideList.add(info.packageName); - } - else { + } else { new Async.MagiskHide().rm(info.packageName); mHideList.remove(info.packageName); }