Simplification

This commit is contained in:
M66B 2022-04-18 21:25:47 +02:00
parent 03ad086d53
commit 86225c8b28
1 changed files with 0 additions and 11 deletions

View File

@ -442,8 +442,6 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("check_blocklist", checked).apply();
swUseBlocklist.setEnabled(checked);
if (badapter != null)
badapter.enabledChanged();
}
});
@ -759,7 +757,6 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
private Context context;
private LayoutInflater inflater;
private boolean enabled;
private List<DnsBlockList.BlockList> items;
public class ViewHolder extends RecyclerView.ViewHolder implements CompoundButton.OnCheckedChangeListener {
@ -781,7 +778,6 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
private void bindTo(DnsBlockList.BlockList blocklist) {
cbEnabled.setText(blocklist.name);
cbEnabled.setChecked(DnsBlockList.isEnabled(context, blocklist));
cbEnabled.setEnabled(enabled);
}
@Override
@ -801,13 +797,6 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
setHasStableIds(true);
this.items = items;
enabledChanged();
}
void enabledChanged() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
this.enabled = prefs.getBoolean("check_blocklist", false);
notifyDataSetChanged();
}
@Override