Small behavior improvement

This commit is contained in:
M66B 2020-08-15 10:29:59 +02:00
parent d13e012ef8
commit 7baf24b77c
1 changed files with 3 additions and 0 deletions

View File

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