|
|
|
@ -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
|
|
|
|
|