mirror of https://github.com/M66B/FairEmail.git
Added solarized theme
This commit is contained in:
parent
7efb30037f
commit
a2cae71ca5
|
@ -178,6 +178,11 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|||
setTheme(R.style.AppThemeGreySteelBlueDark);
|
||||
break;
|
||||
|
||||
// Solarized
|
||||
case "solarized":
|
||||
setTheme(R.style.AppThemeSolarized);
|
||||
break;
|
||||
|
||||
// Black
|
||||
case "black":
|
||||
setTheme(R.style.AppThemeBlack);
|
||||
|
|
|
@ -969,7 +969,9 @@ public class FragmentCompose extends FragmentBase {
|
|||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
|
||||
boolean cards = prefs.getBoolean("cards", true);
|
||||
if (cards && !Helper.isDarkTheme(getContext()))
|
||||
String theme = prefs.getString("theme", null);
|
||||
if (cards &&
|
||||
(!Helper.isDarkTheme(getContext())) || "solarized".equals(theme))
|
||||
view.setBackgroundColor(Helper.resolveColor(getContext(), R.attr.colorCardBackground));
|
||||
|
||||
//boolean beige = prefs.getBoolean("beige", true);
|
||||
|
|
|
@ -146,12 +146,17 @@ public class FragmentDialogTheme extends FragmentDialogBase {
|
|||
case "purple_yellow_black":
|
||||
rgTheme.check(R.id.rbThemeYellowPurple);
|
||||
break;
|
||||
|
||||
case "grey_system":
|
||||
case "grey_light":
|
||||
case "grey_dark":
|
||||
rgTheme.check(R.id.rbThemeGrey);
|
||||
break;
|
||||
|
||||
case "solarized":
|
||||
rgTheme.check(R.id.rbThemeSolarized);
|
||||
break;
|
||||
|
||||
case "black":
|
||||
rgTheme.check(R.id.rbThemeBlack);
|
||||
break;
|
||||
|
@ -221,6 +226,8 @@ public class FragmentDialogTheme extends FragmentDialogBase {
|
|||
else
|
||||
editor.putString("theme",
|
||||
"grey" + (dark ? "_dark" : "_light")).apply();
|
||||
} else if (checkedRadioButtonId == R.id.rbThemeSolarized) {
|
||||
editor.putString("theme", "solarized").apply();
|
||||
} else if (checkedRadioButtonId == R.id.rbThemeBlack) {
|
||||
editor.putString("theme", "black").apply();
|
||||
} else if (checkedRadioButtonId == R.id.rbThemeBlackAndWhite) {
|
||||
|
|
|
@ -62,6 +62,14 @@
|
|||
android:text="@string/title_setup_theme_grey"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbThemeSolarized"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="6dp"
|
||||
android:text="@string/title_setup_theme_solarized"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbThemeBlack"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -133,6 +133,11 @@
|
|||
<color name="greyAccentDark">#62757f</color>
|
||||
<color name="greyAccentLight">#c1d5e0</color>
|
||||
|
||||
<!-- https://github.com/altercation/solarized -->
|
||||
<color name="solarizedPrimary">#073642</color>
|
||||
<color name="solarizedPrimaryDark">#002b36</color>
|
||||
<color name="solarizedAccent">#268bd2</color>
|
||||
|
||||
<!-- default: #323232 -->
|
||||
<color name="design_snackbar_background_color" tools:override="true">#222</color>
|
||||
|
||||
|
|
|
@ -258,6 +258,7 @@
|
|||
<string name="title_setup_theme_grey">Grey</string>
|
||||
<string name="title_setup_theme_black">Black</string>
|
||||
<string name="title_setup_theme_black_and_white">Black and white</string>
|
||||
<string name="title_setup_theme_solarized" translatable="false">Solarized</string>
|
||||
|
||||
<string name="title_setup_theme_reverse">Swap colors</string>
|
||||
<string name="title_setup_theme_light">Light</string>
|
||||
|
|
|
@ -397,6 +397,26 @@
|
|||
<item name="colorDrawerBackground">@color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeSolarized" parent="AppThemeBaseDark">
|
||||
<item name="themeName">black</item>
|
||||
<item name="colorPrimary">@color/solarizedPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/solarizedPrimaryDark</item>
|
||||
<item name="colorAccent">@color/solarizedAccent</item>
|
||||
|
||||
<item name="colorUnreadHighlight">@color/solarizedAccent</item>
|
||||
|
||||
<item name="colorFabBackground">@color/solarizedAccent</item>
|
||||
|
||||
<item name="colorInfoForeground">@color/white</item>
|
||||
<item name="colorInfoBackground">@color/solarizedPrimary</item>
|
||||
|
||||
<item name="android:textColorLink">@color/solarizedAccent</item>
|
||||
|
||||
<item name="colorCardBackground">@color/solarizedPrimaryDark</item>
|
||||
<item name="android:windowBackground">@drawable/black_background</item>
|
||||
<item name="colorDrawerBackground">@color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.AppCompat.Translucent" parent="Theme.AppCompat.NoActionBar">
|
||||
<item name="android:background">@color/transparent</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
|
|
Loading…
Reference in New Issue