mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-28 00:20:50 +01:00
Moved dark theme setting to setup
This commit is contained in:
@@ -111,9 +111,6 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
|
||||
case R.string.menu_folders:
|
||||
onMenuFolders();
|
||||
break;
|
||||
case R.string.menu_theme:
|
||||
onMenuTheme();
|
||||
break;
|
||||
case R.string.menu_setup:
|
||||
onMenuSetup();
|
||||
break;
|
||||
@@ -184,6 +181,7 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
|
||||
super.onSharedPreferenceChanged(prefs, key);
|
||||
if ("eula".equals(key))
|
||||
init();
|
||||
}
|
||||
@@ -244,7 +242,6 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
|
||||
ArrayAdapterDrawer drawerArray = new ArrayAdapterDrawer(this, R.layout.item_drawer);
|
||||
drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_unified));
|
||||
drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_folders));
|
||||
drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_theme, "dark".equals(prefs.getString("theme", "light"))));
|
||||
drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_setup));
|
||||
drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_debug));
|
||||
drawerList.setAdapter(drawerArray);
|
||||
@@ -268,14 +265,6 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
|
||||
private void onMenuTheme() {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
String theme = prefs.getString("theme", "light");
|
||||
theme = ("dark".equals(theme) ? "light" : "dark");
|
||||
prefs.edit().putString("theme", theme).apply();
|
||||
recreate();
|
||||
}
|
||||
|
||||
private void onMenuSetup() {
|
||||
startActivity(new Intent(ActivityView.this, ActivitySetup.class));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user