Adding a green theme
This commit is contained in:
@@ -53,7 +53,8 @@ public class GlobalUserPreferences{
|
||||
|
||||
public enum ColorPreference{
|
||||
PINK,
|
||||
PURPLE
|
||||
PURPLE,
|
||||
GREEN
|
||||
}
|
||||
|
||||
public enum ThemePreference{
|
||||
|
||||
@@ -675,6 +675,10 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
pref = GlobalUserPreferences.ColorPreference.PURPLE;
|
||||
onColorPreferenceClick(pref);
|
||||
}
|
||||
else if(id==R.id.green_color) {
|
||||
pref = GlobalUserPreferences.ColorPreference.GREEN;
|
||||
onColorPreferenceClick(pref);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
@@ -689,6 +693,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
|
||||
button.setText(switch(GlobalUserPreferences.color){
|
||||
case PINK -> R.string.pink_color;
|
||||
case PURPLE -> R.string.purple_color;
|
||||
case GREEN -> R.string.green_color;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -678,6 +678,17 @@ public class UiUtils{
|
||||
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Original : R.style.Theme_Mastodon_Dark_Original;
|
||||
});
|
||||
break;
|
||||
case GREEN:
|
||||
context.setTheme(switch(GlobalUserPreferences.theme){
|
||||
case AUTO ->
|
||||
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack_Green : R.style.Theme_Mastodon_AutoLightDark_Green;
|
||||
case LIGHT ->
|
||||
R.style.Theme_Mastodon_Light_Green;
|
||||
case DARK ->
|
||||
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Green : R.style.Theme_Mastodon_Dark_Green;
|
||||
});
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@+id/pink_color" android:title="@string/pink_color"/>
|
||||
<item android:id="@+id/purple_color" android:title="@string/purple_color"/>
|
||||
<item android:id="@+id/green_color" android:title="@string/green_color"/>
|
||||
</menu>
|
||||
@@ -5,4 +5,8 @@
|
||||
|
||||
<style name="Theme.Mastodon.AutoLightDark.Original" parent="Theme.Mastodon.Dark.Original"/>
|
||||
<style name="Theme.Mastodon.AutoLightDark.TrueBlack.Original" parent="Theme.Mastodon.Dark.TrueBlack.Original"/>
|
||||
|
||||
<style name="Theme.Mastodon.AutoLightDark.Green" parent="Theme.Mastodon.Dark.Green"/>
|
||||
<style name="Theme.Mastodon.AutoLightDark.TrueBlack.Green" parent="Theme.Mastodon.Dark.TrueBlack.Green"/>
|
||||
|
||||
</resources>
|
||||
@@ -43,6 +43,25 @@
|
||||
<color name="original_primary_800">#2f0c7a</color>
|
||||
<color name="original_primary_900">#17063b</color>
|
||||
|
||||
<color name="green_primary_25">#fafaff</color>
|
||||
<color name="green_primary_50">#d1feaf</color>
|
||||
<color name="green_primary_100">#bbf294</color>
|
||||
<color name="green_primary_200">#a0d57b</color>
|
||||
<color name="green_primary_300">#85b962</color>
|
||||
<color name="green_primary_400">#6c9e4b</color>
|
||||
<color name="green_primary_500">#528232</color>
|
||||
<color name="green_primary_600">#3b6a1c</color>
|
||||
<color name="green_primary_700">#245103</color>
|
||||
<color name="green_primary_800">#163800</color>
|
||||
<color name="green_primary_900">#0a2100</color>
|
||||
|
||||
<color name="green_gray_900">#1b1b1b</color>
|
||||
<color name="green_gray_800t">#303030</color>
|
||||
<color name="green_gray_800">#303030</color>
|
||||
<color name="green_gray_700">#474747</color>
|
||||
<color name="green_gray_600">#5e5e5e</color>
|
||||
<color name="green_gray_500">#767676</color>
|
||||
|
||||
<color name="error_25">#FFFBFA</color>
|
||||
<color name="error_50">#FEF3F2</color>
|
||||
<color name="error_100">#FEE4E2</color>
|
||||
@@ -99,6 +118,8 @@
|
||||
<color name="purple_800">#4A1FB8</color>
|
||||
<color name="purple_900">#3E1C96</color>
|
||||
|
||||
|
||||
|
||||
<color name="fab_icon">#282C37</color>
|
||||
<color name="navigation_bar_bg">#282C37</color>
|
||||
<color name="highlight_over_dark">#30FFFFFF</color>
|
||||
|
||||
@@ -431,4 +431,5 @@
|
||||
<string name="settings_color_picker">Color theme:</string>
|
||||
<string name="pink_color">Pink</string>
|
||||
<string name="purple_color">Purple</string>
|
||||
<string name="green_color">Green</string>
|
||||
</resources>
|
||||
|
||||
@@ -113,6 +113,73 @@
|
||||
<style name="Theme.Mastodon.AutoLightDark" parent="Theme.Mastodon.Light"/>
|
||||
<style name="Theme.Mastodon.AutoLightDark.TrueBlack" parent="Theme.Mastodon.Light"/>
|
||||
|
||||
<style name="Theme.Mastodon.Dark.Green" parent="Theme.AppKit">
|
||||
<!-- needed to disable scrim on API 29+ -->
|
||||
<item name="android:enforceNavigationBarContrast" tools:ignore="NewApi">false</item>
|
||||
<item name="android:enforceStatusBarContrast" tools:ignore="NewApi">false</item>
|
||||
<item name="appkitBackDrawable">@drawable/ic_fluent_arrow_left_24_regular</item>
|
||||
<item name="android:splitMotionEvents">false</item>
|
||||
<item name="android:windowBackground">?colorWindowBackground</item>
|
||||
<item name="android:editTextStyle">@style/Widget.Mastodon.EditText</item>
|
||||
|
||||
<item name="android:buttonStyle">@style/Widget.Mastodon.Button.Primary_LightOnDark</item>
|
||||
<item name="secondaryButtonStyle">@style/Widget.Mastodon.Button.Secondary_LightOnDark</item>
|
||||
<item name="primaryLargeButtonStyle">@style/Widget.Mastodon.Button.Large.Primary_LightOnDark</item>
|
||||
<item name="secondaryLargeButtonStyle">@style/Widget.Mastodon.Button.Large.Secondary_LightOnDark</item>
|
||||
<item name="android:colorAccent">@color/green_primary_400</item>
|
||||
<item name="android:colorPrimary">@color/gray_50</item>
|
||||
<item name="android:colorBackground">@color/green_gray_700</item>
|
||||
<item name="android:textColorPrimary">@color/gray_50</item>
|
||||
<item name="android:textColorSecondary">@color/gray_400</item>
|
||||
<item name="colorButtonText">@color/green_gray_800</item>
|
||||
<item name="colorSecondary">#E9EDF2</item>
|
||||
<item name="colorBackgroundLight">@color/green_gray_700</item>
|
||||
<item name="colorBackgroundLightest">@color/green_gray_900</item>
|
||||
<item name="colorBackgroundPopup">?colorBackgroundLightest</item>
|
||||
<item name="colorDarkIcon">@color/gray_25</item>
|
||||
<item name="colorWindowBackground">@color/green_gray_800</item>
|
||||
<item name="android:statusBarColor">@color/green_gray_800</item>
|
||||
<item name="android:navigationBarColor">@color/green_gray_800</item>
|
||||
<item name="android:actionBarTheme">@style/Theme.Mastodon.Toolbar.Dark.Green</item>
|
||||
<item name="android:alertDialogTheme">@style/Theme.Mastodon.Dialog.Alert.Dark</item>
|
||||
<item name="colorPollMostVoted">@color/green_primary_700</item>
|
||||
<item name="colorPollVoted">@color/green_gray_600</item>
|
||||
<item name="colorAccentLight">@color/green_primary_600</item>
|
||||
<item name="colorAccentLightest">@color/green_primary_800</item>
|
||||
<item name="colorTabInactive">@color/gray_400</item>
|
||||
<item name="profileHeaderBackground">?colorWindowBackground</item>
|
||||
|
||||
<!-- TODO dark colors -->
|
||||
<item name="colorSearchField">@color/gray_700</item>
|
||||
<item name="colorSearchHint">@color/gray_300</item>
|
||||
|
||||
<item name="buttonBackground">@drawable/bg_button_primary_light_on_dark</item>
|
||||
<item name="android:editTextBackground">@drawable/bg_edittext_dark</item>
|
||||
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
<item name="android:windowLightNavigationBar" tools:ignore="NewApi">false</item>
|
||||
<item name="android:popupMenuStyle">@style/Widget.Mastodon.PopupMenu</item>
|
||||
<item name="android:actionOverflowMenuStyle">@style/Widget.Mastodon.PopupMenu</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Mastodon.Dark.TrueBlack.Green" parent="Theme.Mastodon.Dark.TrueBlack">
|
||||
<item name="android:colorAccent">@color/green_primary_400</item>
|
||||
<item name="colorPollMostVoted">@color/green_primary_700</item>
|
||||
<item name="colorAccentLight">@color/green_primary_600</item>
|
||||
<item name="colorAccentLightest">@color/green_primary_800</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Mastodon.Light.Green" parent="Theme.Mastodon.Light">
|
||||
<item name="android:colorAccent">@color/green_primary_400</item>
|
||||
<item name="colorPollMostVoted">@color/green_primary_700</item>
|
||||
<item name="colorAccentLight">@color/green_primary_600</item>
|
||||
<item name="colorAccentLightest">@color/green_primary_800</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Mastodon.AutoLightDark.Green" parent="Theme.Mastodon.Light.Green"/>
|
||||
<style name="Theme.Mastodon.AutoLightDark.TrueBlack.Green" parent="Theme.Mastodon.Light.Green"/>
|
||||
|
||||
|
||||
<style name="Theme.Mastodon.Dark.Original" parent="Theme.Mastodon.Dark">
|
||||
<item name="android:colorAccent">@color/original_primary_400</item>
|
||||
<item name="colorPollMostVoted">@color/original_primary_700</item>
|
||||
@@ -150,6 +217,12 @@
|
||||
<item name="android:textColorSecondary">@color/gray_50</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Mastodon.Toolbar.Dark.Green" parent="android:ThemeOverlay.Material.Dark.ActionBar">
|
||||
<item name="android:colorPrimary">@color/green_gray_800</item>
|
||||
<item name="android:textColorPrimary">@color/gray_50</item>
|
||||
<item name="android:textColorSecondary">@color/gray_50</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Mastodon.Toolbar.Dark.TrueBlack" parent="android:ThemeOverlay.Material.Dark.ActionBar">
|
||||
<item name="android:colorPrimary">@color/black</item>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user