Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Proper implementation of the color picker #124

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ff21541
Adding mastodon original colors toggle. Partially fixing #90
LucasGGamerM Nov 28, 2022
bc2ac4e
Fixed a few bugs from the earlier commit.
LucasGGamerM Nov 28, 2022
f2c47a1
Fixing another bug I found.
LucasGGamerM Nov 29, 2022
d096bef
Fixing the fix of the bug I found.
LucasGGamerM Nov 29, 2022
9179d21
Fully fixed now, it should be ready to release.
LucasGGamerM Nov 29, 2022
dad3b8c
Proper implementation on the color picker.
LucasGGamerM Dec 1, 2022
6a674d7
Polishes
LucasGGamerM Dec 1, 2022
8fa5824
Disabling the icons for the color picker menu
LucasGGamerM Dec 2, 2022
1747ff9
Adding a green theme
LucasGGamerM Dec 2, 2022
19238c3
Making the green theme more readable
LucasGGamerM Dec 3, 2022
77669ce
More polishes over the green theme
LucasGGamerM Dec 3, 2022
bad44b1
Adding blue theme and refactoring styles.xml
LucasGGamerM Dec 3, 2022
b1fda17
Make badged settings icon follow accent colors
LucasGGamerM Dec 3, 2022
e63b9d0
Adding an icon to the color picker setting
LucasGGamerM Dec 4, 2022
8d63be5
Fix readability issue on the light blue theme
LucasGGamerM Dec 4, 2022
29abf70
Adding orange theme, tweaking the blue and green theme
LucasGGamerM Dec 4, 2022
b617868
Adding yellow theme
LucasGGamerM Dec 4, 2022
4e39bb3
Making it so that the fab follows the theme
LucasGGamerM Dec 4, 2022
3ebc972
Fixing the TrueBlack themes for everything
LucasGGamerM Dec 4, 2022
606cd74
Make it so that the publish button also follows the theme
LucasGGamerM Dec 4, 2022
de5a911
Fixing weird bug with the buttons
LucasGGamerM Dec 5, 2022
c8e38b1
Fixing weird bug with the buttons for the second time
LucasGGamerM Dec 5, 2022
004c414
Editing some drawable files to make them also follow the theme
LucasGGamerM Dec 5, 2022
27afba1
Making it so that the boost icon is also following the theme when cli…
LucasGGamerM Dec 5, 2022
1077971
Make follow requests icon badge follow the color scheme and also make…
LucasGGamerM Dec 5, 2022
48e7536
Merge branch 'main' into color-themes
sk22 Dec 7, 2022
4d5cbd1
use fluent icon
sk22 Dec 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding a green theme
  • Loading branch information
LucasGGamerM committed Dec 2, 2022
commit 1747ff98b5d3b814c4f0a9c034be578a3557c4bb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public static void save(){

public enum ColorPreference{
PINK,
PURPLE
PURPLE,
GREEN
}

public enum ThemePreference{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,10 @@ else if(id==R.id.purple_color) {
pref = GlobalUserPreferences.ColorPreference.PURPLE;
onColorPreferenceClick(pref);
}
else if(id==R.id.green_color) {
pref = GlobalUserPreferences.ColorPreference.GREEN;
onColorPreferenceClick(pref);
}
else
return false;
return true;
Expand All @@ -689,6 +693,7 @@ public void onBind(ColorPicker item){
button.setText(switch(GlobalUserPreferences.color){
case PINK -> R.string.pink_color;
case PURPLE -> R.string.purple_color;
case GREEN -> R.string.green_color;
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,17 @@ public static void setUserPreferredTheme(Context context){
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;

}

}
Expand Down
1 change: 1 addition & 0 deletions mastodon/src/main/res/menu/color_picker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
4 changes: 4 additions & 0 deletions mastodon/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
21 changes: 21 additions & 0 deletions mastodon/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions mastodon/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
73 changes: 73 additions & 0 deletions mastodon/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down