Added grey light theme

pull/162/head
M66B 6 years ago
parent a262b2cbb0
commit 27258bae5e

@ -78,8 +78,10 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
setTheme(R.style.AppThemeDark); setTheme(R.style.AppThemeDark);
else if ("black".equals(theme)) else if ("black".equals(theme))
setTheme(R.style.AppThemeBlack); setTheme(R.style.AppThemeBlack);
else if ("grey".equals(theme)) else if ("grey_light".equals(theme))
setTheme(R.style.AppThemeGrey); setTheme(R.style.AppThemeGreyLight);
else if ("grey_dark".equals(theme))
setTheme(R.style.AppThemeGreyDark);
else if ("system".equals(theme)) { else if ("system".equals(theme)) {
int uiMode = getResources().getConfiguration().uiMode; int uiMode = getResources().getConfiguration().uiMode;
Log.i("UI mode=" + uiMode); Log.i("UI mode=" + uiMode);

@ -130,9 +130,15 @@ public class ApplicationEx extends Application {
if (prefs.getBoolean("autonext", false)) if (prefs.getBoolean("autonext", false))
editor.putString("onclose", "next"); editor.putString("onclose", "next");
editor.remove("autonext"); editor.remove("autonext");
} else if (version < 693) { } else if (version < 693) {
editor.remove("message_swipe"); editor.remove("message_swipe");
editor.remove("message_select"); editor.remove("message_select");
} else if (version < 696) {
String theme = prefs.getString("theme", "light");
if ("grey".equals(theme))
editor.putString("theme", "grey_dark");
} }
if (BuildConfig.DEBUG && false) { if (BuildConfig.DEBUG && false) {

@ -392,8 +392,11 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
case "black": case "black":
rgTheme.check(R.id.rbThemeBlack); rgTheme.check(R.id.rbThemeBlack);
break; break;
case "grey": case "grey_light":
rgTheme.check(R.id.rbThemeGrey); rgTheme.check(R.id.rbThemeGreyLight);
break;
case "grey_dark":
rgTheme.check(R.id.rbThemeGreyDark);
break; break;
case "system": case "system":
rgTheme.check(R.id.rbThemeSystem); rgTheme.check(R.id.rbThemeSystem);
@ -417,8 +420,11 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
case R.id.rbThemeBlack: case R.id.rbThemeBlack:
prefs.edit().putString("theme", "black").apply(); prefs.edit().putString("theme", "black").apply();
break; break;
case R.id.rbThemeGrey: case R.id.rbThemeGreyLight:
prefs.edit().putString("theme", "grey").apply(); prefs.edit().putString("theme", "grey_light").apply();
break;
case R.id.rbThemeGreyDark:
prefs.edit().putString("theme", "grey_dark").apply();
break; break;
case R.id.rbThemeSystem: case R.id.rbThemeSystem:
prefs.edit().putString("theme", "system").apply(); prefs.edit().putString("theme", "system").apply();

@ -40,12 +40,21 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium" /> android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton <RadioButton
android:id="@+id/rbThemeGrey" android:id="@+id/rbThemeGreyLight"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:padding="6dp" android:padding="6dp"
android:text="@string/title_setup_grey_theme" android:text="@string/title_setup_grey_light_theme"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton
android:id="@+id/rbThemeGreyDark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:padding="6dp"
android:text="@string/title_setup_grey_dark_theme"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" /> android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
<RadioButton <RadioButton

@ -182,7 +182,8 @@
<string name="title_setup_light_theme">Light theme</string> <string name="title_setup_light_theme">Light theme</string>
<string name="title_setup_dark_theme">Dark theme</string> <string name="title_setup_dark_theme">Dark theme</string>
<string name="title_setup_black_theme">Black theme</string> <string name="title_setup_black_theme">Black theme</string>
<string name="title_setup_grey_theme">Grey theme</string> <string name="title_setup_grey_light_theme">Grey light theme</string>
<string name="title_setup_grey_dark_theme">Grey dark theme</string>
<string name="title_setup_system_theme">System theme</string> <string name="title_setup_system_theme">System theme</string>
<string name="title_setup_advanced">Advanced</string> <string name="title_setup_advanced">Advanced</string>

@ -81,7 +81,16 @@
<item name="colorDrawerBackground">@android:color/black</item> <item name="colorDrawerBackground">@android:color/black</item>
</style> </style>
<style name="AppThemeGrey" parent="AppThemeDark"> <style name="AppThemeGreyLight" parent="AppThemeLight">
<item name="themeName">light</item>
<item name="colorPrimary">@color/greyPrimary</item>
<item name="colorPrimaryDark">@color/greyPrimaryDark</item>
<item name="colorAccent">@color/greyAccent</item>
<item name="colorUnread">@color/greyAccent</item>
</style>
<style name="AppThemeGreyDark" parent="AppThemeDark">
<item name="themeName">black</item> <item name="themeName">black</item>
<item name="colorPrimary">@color/greyPrimary</item> <item name="colorPrimary">@color/greyPrimary</item>
<item name="colorPrimaryDark">@color/greyPrimaryDark</item> <item name="colorPrimaryDark">@color/greyPrimaryDark</item>

Loading…
Cancel
Save