feat: add black and white (more like gray) theme

This commit is contained in:
LucasGGamerM
2023-07-08 21:01:03 -03:00
parent 3a87e83974
commit 8b08d5ddfd
7 changed files with 68 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ import com.google.gson.reflect.TypeToken;
import org.joinmastodon.android.model.ContentType;
import org.joinmastodon.android.model.TimelineDefinition;
import org.joinmastodon.android.ui.utils.ColorPalette;
import java.lang.reflect.Type;
import java.util.HashMap;
@@ -245,8 +246,9 @@ public class GlobalUserPreferences{
BROWN,
RED,
YELLOW,
NORD
}
NORD,
WHITE
}
public enum ThemePreference{
AUTO,

View File

@@ -41,6 +41,7 @@ public class AppearanceFragment extends SettingsBaseFragment {
case RED -> R.string.sk_color_palette_red;
case YELLOW -> R.string.sk_color_palette_yellow;
case NORD -> R.string.mo_color_palette_nord;
case WHITE -> R.string.mo_color_palette_black_and_white;
});
}));
items.add(new SwitchItem(R.string.theme_true_black, R.string.mo_setting_true_black_summary, R.drawable.ic_fluent_dark_theme_24_regular, GlobalUserPreferences.trueBlackTheme, this::onTrueBlackThemeChanged));
@@ -67,6 +68,7 @@ public class AppearanceFragment extends SettingsBaseFragment {
case RED -> R.id.red_color;
case YELLOW -> R.id.yellow_color;
case NORD -> R.id.nord_color;
case WHITE -> R.id.black_and_white_color;
};
}
@@ -83,6 +85,7 @@ public class AppearanceFragment extends SettingsBaseFragment {
else if (id == R.id.red_color) pref = GlobalUserPreferences.ColorPreference.RED;
else if (id == R.id.yellow_color) pref = GlobalUserPreferences.ColorPreference.YELLOW;
else if (id == R.id.nord_color) pref = GlobalUserPreferences.ColorPreference.NORD;
else if (id == R.id.black_and_white_color) pref = GlobalUserPreferences.ColorPreference.WHITE;
if (pref == null) return false;

View File

@@ -26,7 +26,8 @@ public class ColorPalette {
ColorPreference.BROWN, new ColorPalette(R.style.ColorPalette_Brown),
ColorPreference.RED, new ColorPalette(R.style.ColorPalette_Red),
ColorPreference.YELLOW, new ColorPalette(R.style.ColorPalette_Yellow),
ColorPreference.NORD, new ColorPalette(R.style.ColorPalette_Nord)
ColorPreference.NORD, new ColorPalette(R.style.ColorPalette_Nord),
ColorPreference.WHITE, new ColorPalette(R.style.ColorPalette_White)
);
private @StyleRes int base;