mirror of https://github.com/M66B/FairEmail.git
Simplification
This commit is contained in:
parent
03ad086d53
commit
86225c8b28
|
@ -442,8 +442,6 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||||
prefs.edit().putBoolean("check_blocklist", checked).apply();
|
prefs.edit().putBoolean("check_blocklist", checked).apply();
|
||||||
swUseBlocklist.setEnabled(checked);
|
swUseBlocklist.setEnabled(checked);
|
||||||
if (badapter != null)
|
|
||||||
badapter.enabledChanged();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -759,7 +757,6 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||||
private Context context;
|
private Context context;
|
||||||
private LayoutInflater inflater;
|
private LayoutInflater inflater;
|
||||||
|
|
||||||
private boolean enabled;
|
|
||||||
private List<DnsBlockList.BlockList> items;
|
private List<DnsBlockList.BlockList> items;
|
||||||
|
|
||||||
public class ViewHolder extends RecyclerView.ViewHolder implements CompoundButton.OnCheckedChangeListener {
|
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) {
|
private void bindTo(DnsBlockList.BlockList blocklist) {
|
||||||
cbEnabled.setText(blocklist.name);
|
cbEnabled.setText(blocklist.name);
|
||||||
cbEnabled.setChecked(DnsBlockList.isEnabled(context, blocklist));
|
cbEnabled.setChecked(DnsBlockList.isEnabled(context, blocklist));
|
||||||
cbEnabled.setEnabled(enabled);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -801,13 +797,6 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
||||||
|
|
||||||
setHasStableIds(true);
|
setHasStableIds(true);
|
||||||
this.items = items;
|
this.items = items;
|
||||||
enabledChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
void enabledChanged() {
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
||||||
this.enabled = prefs.getBoolean("check_blocklist", false);
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue