Change click listener to checked state listener in magisk hide
This commit is contained in:
parent
61d43b118b
commit
cc262d6595
@ -55,15 +55,14 @@ public class ApplicationAdapter extends RecyclerView.Adapter<ApplicationAdapter.
|
|||||||
holder.appIcon.setImageDrawable(info.loadIcon(packageManager));
|
holder.appIcon.setImageDrawable(info.loadIcon(packageManager));
|
||||||
holder.appName.setText(info.loadLabel(packageManager));
|
holder.appName.setText(info.loadLabel(packageManager));
|
||||||
holder.appPackage.setText(info.packageName);
|
holder.appPackage.setText(info.packageName);
|
||||||
holder.checkBox.setChecked(mHideList.contains(info.packageName));
|
|
||||||
|
|
||||||
holder.checkBox.setOnClickListener(v -> {
|
holder.checkBox.setOnCheckedChangeListener(null);
|
||||||
CheckBox chkbox = (CheckBox) v;
|
holder.checkBox.setChecked(mHideList.contains(info.packageName));
|
||||||
if (chkbox.isChecked()) {
|
holder.checkBox.setOnCheckedChangeListener((v, isChecked) -> {
|
||||||
|
if (isChecked) {
|
||||||
new Async.MagiskHide().add(info.packageName);
|
new Async.MagiskHide().add(info.packageName);
|
||||||
mHideList.add(info.packageName);
|
mHideList.add(info.packageName);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
new Async.MagiskHide().rm(info.packageName);
|
new Async.MagiskHide().rm(info.packageName);
|
||||||
mHideList.remove(info.packageName);
|
mHideList.remove(info.packageName);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user