This commit is contained in:
Robin Koedood
2021-01-12 12:09:30 +01:00
parent 8740362553
commit 4c09192f9a
2 changed files with 4 additions and 3 deletions

View File

@@ -38,7 +38,6 @@ public class MainActivity extends AppCompatActivity implements Refreshable {
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
super.onCreate(savedInstanceState);
// initialize saved language from sharedPreferences

View File

@@ -108,7 +108,7 @@ public class SettingsFragment extends Fragment {
editor.commit();
});
this.colorBlindMode = view.findViewById(R.id.settingsEyesButton);
this.colorBlindMode = view.findViewById(R.id.colourblindSwitch);
this.colorBlindMode.setOnClickListener(view1 -> {
editor.putBoolean("colorBlindModeSwitch", imperialSwitch.isChecked());
editor.apply();
@@ -117,10 +117,12 @@ public class SettingsFragment extends Fragment {
if (colorBlindMode.isChecked()){
requireActivity().setTheme(R.style.Theme_NextLocation);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
getActivity().recreate();
System.out.println("AAN");
}else if (!colorBlindMode.isChecked()){
requireActivity().setTheme(R.style.Theme_NextLocationNight);
requireActivity().setTheme(R.style.Theme_NextLocation);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
getActivity().recreate();
System.out.println("UIT");
}