mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 11:28:41 +01:00
Theme refactoring
This commit is contained in:
@@ -85,13 +85,13 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||
String theme = prefs.getString("theme", "light");
|
||||
|
||||
if ("dark".equals(theme))
|
||||
setTheme(R.style.AppThemeDark);
|
||||
setTheme(R.style.AppThemeBlueOrangeDark);
|
||||
else if ("black".equals(theme))
|
||||
setTheme(R.style.AppThemeBlack);
|
||||
else if ("grey_light".equals(theme))
|
||||
setTheme(R.style.AppThemeGreyLight);
|
||||
setTheme(R.style.AppThemeGreySteelBlueLight);
|
||||
else if ("grey_dark".equals(theme))
|
||||
setTheme(R.style.AppThemeGreyDark);
|
||||
setTheme(R.style.AppThemeGreySteelBlueDark);
|
||||
else if ("system".equals(theme)) {
|
||||
int uiMode = getResources().getConfiguration().uiMode;
|
||||
Log.i("UI mode=" + uiMode);
|
||||
@@ -101,9 +101,9 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||
int uiMode = getResources().getConfiguration().uiMode;
|
||||
Log.i("UI mode=" + uiMode);
|
||||
if ((uiMode & Configuration.UI_MODE_NIGHT_YES) != 0)
|
||||
setTheme(R.style.AppThemeGreyDark);
|
||||
setTheme(R.style.AppThemeGreySteelBlueDark);
|
||||
else
|
||||
setTheme(R.style.AppThemeGreyLight);
|
||||
setTheme(R.style.AppThemeGreySteelBlueLight);
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
|
||||
getSupportFragmentManager().addOnBackStackChangedListener(this);
|
||||
|
||||
if (!Log.isSupportedDevice() && Helper.isPlayStoreInstall()) {
|
||||
setTheme(R.style.AppThemeLight);
|
||||
setTheme(R.style.AppThemeBlueOrangeLight);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_unsupported);
|
||||
return;
|
||||
@@ -163,7 +163,7 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
|
||||
if (!getResources().getConfiguration().isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE))
|
||||
prefs.edit().putBoolean("compact", true).apply();
|
||||
|
||||
setTheme(R.style.AppThemeLight);
|
||||
setTheme(R.style.AppThemeBlueOrangeLight);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user