mirror of https://github.com/M66B/FairEmail.git
Simplification
This commit is contained in:
parent
04f827bbb7
commit
88e5bfbe0a
|
@ -84,7 +84,8 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|||
if (!this.getClass().equals(ActivityMain.class)) {
|
||||
String theme = prefs.getString("theme", "light");
|
||||
int uiMode = getResources().getConfiguration().uiMode;
|
||||
Log.i("UI mode=" + uiMode);
|
||||
boolean night = (uiMode & Configuration.UI_MODE_NIGHT_YES) != 0;
|
||||
Log.i("theme=" + theme + " UI mode=" + uiMode + " night=" + night);
|
||||
|
||||
switch (theme) {
|
||||
case "light":
|
||||
|
@ -143,28 +144,20 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|||
|
||||
case "system":
|
||||
case "blue_orange_system":
|
||||
if ((uiMode & Configuration.UI_MODE_NIGHT_YES) != 0)
|
||||
setTheme(R.style.AppThemeBlueOrangeDark);
|
||||
else
|
||||
setTheme(R.style.AppThemeBlueOrangeLight);
|
||||
setTheme(night
|
||||
? R.style.AppThemeBlueOrangeDark : R.style.AppThemeBlueOrangeLight);
|
||||
break;
|
||||
case "yellow_purple_system":
|
||||
if ((uiMode & Configuration.UI_MODE_NIGHT_YES) != 0)
|
||||
setTheme(R.style.AppThemeYellowPurpleDark);
|
||||
else
|
||||
setTheme(R.style.AppThemeYellowPurpleLight);
|
||||
setTheme(night
|
||||
? R.style.AppThemeYellowPurpleDark : R.style.AppThemeYellowPurpleLight);
|
||||
break;
|
||||
case "red_green_system":
|
||||
if ((uiMode & Configuration.UI_MODE_NIGHT_YES) != 0)
|
||||
setTheme(R.style.AppThemeRedGreenDark);
|
||||
else
|
||||
setTheme(R.style.AppThemeRedGreenLight);
|
||||
setTheme(night
|
||||
? R.style.AppThemeRedGreenDark : R.style.AppThemeRedGreenLight);
|
||||
break;
|
||||
case "grey_system":
|
||||
if ((uiMode & Configuration.UI_MODE_NIGHT_YES) != 0)
|
||||
setTheme(R.style.AppThemeGreySteelBlueDark);
|
||||
else
|
||||
setTheme(R.style.AppThemeGreySteelBlueLight);
|
||||
setTheme(night
|
||||
? R.style.AppThemeGreySteelBlueDark : R.style.AppThemeGreySteelBlueLight);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue