mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 06:08:31 +02:00
Simplification
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user