Small behavior improvement

pull/184/head
M66B 4 years ago
parent d13e012ef8
commit 7baf24b77c

@ -936,6 +936,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private SwitchCompat swDark; private SwitchCompat swDark;
private SwitchCompat swBlack; private SwitchCompat swBlack;
private SwitchCompat swSystem; private SwitchCompat swSystem;
private TextView tvSystem;
private void eval() { private void eval() {
int checkedId = rgTheme.getCheckedRadioButtonId(); int checkedId = rgTheme.getCheckedRadioButtonId();
@ -949,6 +950,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swDark.setEnabled(dark); swDark.setEnabled(dark);
swBlack.setEnabled(colored && swDark.isChecked()); swBlack.setEnabled(colored && swDark.isChecked());
swSystem.setEnabled(dark && !swDark.isChecked()); swSystem.setEnabled(dark && !swDark.isChecked());
tvSystem.setEnabled(swSystem.isEnabled() && swSystem.isChecked());
} }
@NonNull @NonNull
@ -961,6 +963,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swDark = dview.findViewById(R.id.swDark); swDark = dview.findViewById(R.id.swDark);
swBlack = dview.findViewById(R.id.swBlack); swBlack = dview.findViewById(R.id.swBlack);
swSystem = dview.findViewById(R.id.swSystem); swSystem = dview.findViewById(R.id.swSystem);
tvSystem = dview.findViewById(R.id.tvSystem);
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
String theme = prefs.getString("theme", "light"); String theme = prefs.getString("theme", "light");

Loading…
Cancel
Save