Adding yellow theme

This commit is contained in:
LucasGGamerM 2022-12-04 11:42:41 -03:00
parent 29abf70cec
commit b6178681b0
9 changed files with 119 additions and 1 deletions

View File

@ -56,7 +56,8 @@ public class GlobalUserPreferences{
PURPLE, PURPLE,
GREEN, GREEN,
BLUE, BLUE,
ORANGE ORANGE,
YELLOW
} }
public enum ThemePreference{ public enum ThemePreference{

View File

@ -689,6 +689,10 @@ public class SettingsFragment extends MastodonToolbarFragment{
pref = GlobalUserPreferences.ColorPreference.ORANGE; pref = GlobalUserPreferences.ColorPreference.ORANGE;
onColorPreferenceClick(pref); onColorPreferenceClick(pref);
} }
else if(id==R.id.yellow_color) {
pref = GlobalUserPreferences.ColorPreference.YELLOW;
onColorPreferenceClick(pref);
}
else else
return false; return false;
return true; return true;
@ -707,6 +711,7 @@ public class SettingsFragment extends MastodonToolbarFragment{
case GREEN -> R.string.green_color; case GREEN -> R.string.green_color;
case BLUE -> R.string.blue_color; case BLUE -> R.string.blue_color;
case ORANGE -> R.string.orange_color; case ORANGE -> R.string.orange_color;
case YELLOW -> R.string.yellow_color;
}); });
} }
} }

View File

@ -708,6 +708,16 @@ public class UiUtils{
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Orange : R.style.Theme_Mastodon_Dark_Orange; GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Orange : R.style.Theme_Mastodon_Dark_Orange;
}); });
break; break;
case YELLOW:
context.setTheme(switch(GlobalUserPreferences.theme){
case AUTO ->
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_AutoLightDark_TrueBlack_Yellow : R.style.Theme_Mastodon_AutoLightDark_Yellow;
case LIGHT ->
R.style.Theme_Mastodon_Light_Yellow;
case DARK ->
GlobalUserPreferences.trueBlackTheme ? R.style.Theme_Mastodon_Dark_TrueBlack_Yellow : R.style.Theme_Mastodon_Dark_Yellow;
});
break;
} }
} }

View File

@ -5,4 +5,5 @@
<item android:id="@+id/green_color" android:title="@string/green_color"/> <item android:id="@+id/green_color" android:title="@string/green_color"/>
<item android:id="@+id/blue_color" android:title="@string/blue_color"/> <item android:id="@+id/blue_color" android:title="@string/blue_color"/>
<item android:id="@+id/orange_color" android:title="@string/orange_color"/> <item android:id="@+id/orange_color" android:title="@string/orange_color"/>
<item android:id="@+id/yellow_color" android:title="@string/yellow_color"/>
</menu> </menu>

View File

@ -14,4 +14,7 @@
<style name="Theme.Mastodon.AutoLightDark.Orange" parent="Theme.Mastodon.Dark.Orange"/> <style name="Theme.Mastodon.AutoLightDark.Orange" parent="Theme.Mastodon.Dark.Orange"/>
<style name="Theme.Mastodon.AutoLightDark.TrueBlack.Orange" parent="Theme.Mastodon.Dark.TrueBlack.Orange"/> <style name="Theme.Mastodon.AutoLightDark.TrueBlack.Orange" parent="Theme.Mastodon.Dark.TrueBlack.Orange"/>
<style name="Theme.Mastodon.AutoLightDark.Yellow" parent="Theme.Mastodon.Dark.Yellow"/>
<style name="Theme.Mastodon.AutoLightDark.TrueBlack.Yellow" parent="Theme.Mastodon.Dark.TrueBlack.Yellow"/>
</resources> </resources>

View File

@ -4,4 +4,5 @@
<color name="green_navigation_bar_bg">@color/green_gray_50</color> <color name="green_navigation_bar_bg">@color/green_gray_50</color>
<color name="blue_navigation_bar_bg">@color/blue_gray_50</color> <color name="blue_navigation_bar_bg">@color/blue_gray_50</color>
<color name="orange_navigation_bar_bg">@color/orange_gray_50</color> <color name="orange_navigation_bar_bg">@color/orange_gray_50</color>
<color name="yellow_navigation_bar_bg">@color/yellow_gray_50</color>
</resources> </resources>

View File

@ -79,6 +79,18 @@
<color name="orange_primary_800">#482900</color> <color name="orange_primary_800">#482900</color>
<color name="orange_primary_900">#2b1700</color> <color name="orange_primary_900">#2b1700</color>
<color name="yellow_primary_25">#fafaff</color>
<color name="yellow_primary_50">#fff0ca</color>
<color name="yellow_primary_100">#ffe084</color>
<color name="yellow_primary_200">#e8c349</color>
<color name="yellow_primary_300">#cba82f</color>
<color name="yellow_primary_400">#ae8d10</color>
<color name="yellow_primary_500">#8f7300</color>
<color name="yellow_primary_600">#735c00</color>
<color name="yellow_primary_700">#574500</color>
<color name="yellow_primary_800">#3c2f00</color>
<color name="yellow_primary_900">#231b00</color>
<color name="custom_gray_900">#000000</color> <color name="custom_gray_900">#000000</color>
<color name="custom_gray_800t">#171717</color> <color name="custom_gray_800t">#171717</color>
<color name="custom_gray_800">#171717</color> <color name="custom_gray_800">#171717</color>
@ -127,6 +139,14 @@
<color name="orange_gray_50">#ffeedf</color> <color name="orange_gray_50">#ffeedf</color>
<color name="orange_gray_25">#f7f8fa</color> <color name="orange_gray_25">#f7f8fa</color>
<color name="yellow_gray_400">#b8aa87</color>
<color name="yellow_gray_300">#d4c5a1</color>
<color name="yellow_gray_200">#f1e1bb</color>
<color name="yellow_gray_100">#fff0ca</color>
<color name="yellow_gray_50t">#fff0ca</color>
<color name="yellow_gray_50">#fff0ca</color>
<color name="yellow_gray_25">#f7f8fa</color>
<color name="error_25">#FFFBFA</color> <color name="error_25">#FFFBFA</color>
<color name="error_50">#FEF3F2</color> <color name="error_50">#FEF3F2</color>
<color name="error_100">#FEE4E2</color> <color name="error_100">#FEE4E2</color>

View File

@ -434,4 +434,5 @@
<string name="green_color">Green</string> <string name="green_color">Green</string>
<string name="blue_color">Blue</string> <string name="blue_color">Blue</string>
<string name="orange_color">Orange</string> <string name="orange_color">Orange</string>
<string name="yellow_color">Yellow</string>
</resources> </resources>

View File

@ -376,6 +376,82 @@
</style> </style>
<style name="Theme.Mastodon.Light.Yellow" parent="Theme.Mastodon.Light.CustomBase">
<item name="android:colorAccent">@color/yellow_primary_700</item>
<item name="android:colorBackground">@color/yellow_gray_100</item>
<item name="colorButtonText">@color/yellow_gray_50</item>
<item name="colorBackgroundLight">@color/yellow_gray_50</item>
<item name="colorBackgroundLightest">@color/yellow_gray_25</item>
<item name="android:statusBarColor">@color/yellow_gray_50</item>
<item name="android:navigationBarColor">@color/yellow_navigation_bar_bg</item>
<item name="android:actionBarTheme">@style/Theme.Mastodon.Toolbar.Yellow</item>
<item name="android:alertDialogTheme">@style/Theme.Mastodon.Dialog.Alert.Yellow</item>
<item name="colorPollMostVoted">@color/yellow_primary_500</item>
<item name="colorPollVoted">@color/yellow_gray_300</item>
<item name="colorAccentLight">@color/yellow_primary_600</item>
<item name="colorSearchField">@color/yellow_gray_200</item>
<item name="colorTabInactive">@color/yellow_gray_400</item>
<item name="colorAccentLightest">@color/yellow_primary_100</item>
</style>
<style name="Theme.Mastodon.Dark.Yellow" parent="Theme.Mastodon.Dark.CustomBase">
<item name="android:colorAccent">@color/yellow_primary_400</item>
<item name="android:colorPrimary">@color/yellow_gray_50</item>
<item name="android:textColorPrimary">@color/yellow_gray_50</item>
<item name="android:textColorSecondary">@color/yellow_gray_400</item>
<item name="android:alertDialogTheme">@style/Theme.Mastodon.Dialog.Alert.Dark.Yellow</item>
<item name="colorPollMostVoted">@color/yellow_primary_700</item>
<item name="colorAccentLight">@color/yellow_primary_600</item>
<item name="colorAccentLightest">@color/yellow_primary_800</item>
<item name="colorTabInactive">@color/yellow_gray_400</item>
<item name="colorSearchHint">@color/yellow_gray_300</item>
</style>
<style name="Theme.Mastodon.Dark.TrueBlack.Yellow" parent="Theme.Mastodon.Dark.TrueBlack.CustomBase">
<item name="android:colorAccent">@color/yellow_primary_400</item>
<item name="colorPollMostVoted">@color/yellow_primary_700</item>
<item name="colorAccentLight">@color/yellow_primary_600</item>
<item name="colorAccentLightest">@color/yellow_primary_800</item>
</style>
<style name="Theme.Mastodon.AutoLightDark.Yellow" parent="Theme.Mastodon.Light.Yellow"/>
<style name="Theme.Mastodon.AutoLightDark.TrueBlack.Yellow" parent="Theme.Mastodon.Light.Yellow"/>
<style name="Theme.Mastodon.Dialog.Alert.Dark.Yellow" parent="android:Theme.Material.Dialog.Alert">
<item name="android:windowTitleStyle">@style/alert_title</item>
<item name="android:dialogPreferredPadding">24dp</item>
<item name="android:windowBackground">@drawable/bg_alert</item>
<item name="android:buttonBarButtonStyle">@style/Widget.Mastodon.ButtonBarButton</item>
<!-- colors -->
<item name="android:colorAccent">@color/yellow_primary_600</item>
<item name="android:colorPrimary">@color/yellow_gray_50</item>
<item name="android:colorBackground">@color/custom_gray_700</item>
<item name="android:textColorPrimary">@color/yellow_gray_50</item>
<item name="android:textColorSecondary">@color/yellow_gray_400</item>
</style>
<style name="Theme.Mastodon.Dialog.Alert.Yellow" parent="android:Theme.Material.Light.Dialog.Alert">
<item name="android:windowTitleStyle">@style/alert_title</item>
<item name="android:dialogPreferredPadding">24dp</item>
<item name="android:windowBackground">@drawable/bg_alert</item>
<item name="android:buttonBarButtonStyle">@style/Widget.Mastodon.ButtonBarButton</item>
<!-- colors -->
<item name="android:colorAccent">@color/yellow_primary_700</item>
<item name="android:colorPrimary">@color/custom_gray_800</item>
<item name="android:colorBackground">@color/yellow_gray_100</item>
<item name="android:textColorPrimary">@color/custom_gray_800</item>
<item name="android:textColorSecondary">@color/custom_gray_500</item>
</style>
<style name="Theme.Mastodon.Toolbar.Yellow" parent="android:ThemeOverlay.Material.ActionBar">
<item name="android:colorPrimary">@color/yellow_gray_50</item>
<item name="android:textColorPrimary">@color/custom_gray_800</item>
<item name="android:textColorSecondary">@color/custom_gray_800</item>
</style>
<style name="Theme.Mastodon.Dark.Original" parent="Theme.Mastodon.Dark"> <style name="Theme.Mastodon.Dark.Original" parent="Theme.Mastodon.Dark">
<item name="android:colorAccent">@color/original_primary_400</item> <item name="android:colorAccent">@color/original_primary_400</item>
<item name="colorPollMostVoted">@color/original_primary_700</item> <item name="colorPollMostVoted">@color/original_primary_700</item>