Allow disabling dynamic colors on Android 12+ (AND-143)
This commit is contained in:
parent
3582d7bdad
commit
603c058ec9
|
@ -11,6 +11,7 @@ public class GlobalUserPreferences{
|
||||||
public static boolean useCustomTabs;
|
public static boolean useCustomTabs;
|
||||||
public static boolean altTextReminders, confirmUnfollow, confirmBoost, confirmDeletePost;
|
public static boolean altTextReminders, confirmUnfollow, confirmBoost, confirmDeletePost;
|
||||||
public static ThemePreference theme=ThemePreference.AUTO;
|
public static ThemePreference theme=ThemePreference.AUTO;
|
||||||
|
public static boolean useDynamicColors;
|
||||||
|
|
||||||
private static SharedPreferences getPrefs(){
|
private static SharedPreferences getPrefs(){
|
||||||
return MastodonApp.context.getSharedPreferences("global", Context.MODE_PRIVATE);
|
return MastodonApp.context.getSharedPreferences("global", Context.MODE_PRIVATE);
|
||||||
|
@ -29,6 +30,7 @@ public class GlobalUserPreferences{
|
||||||
confirmBoost=prefs.getBoolean("confirmBoost", false);
|
confirmBoost=prefs.getBoolean("confirmBoost", false);
|
||||||
confirmDeletePost=prefs.getBoolean("confirmDeletePost", true);
|
confirmDeletePost=prefs.getBoolean("confirmDeletePost", true);
|
||||||
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
|
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
|
||||||
|
useDynamicColors=prefs.getBoolean("useDynamicColors", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void save(){
|
public static void save(){
|
||||||
|
@ -40,6 +42,7 @@ public class GlobalUserPreferences{
|
||||||
.putBoolean("confirmUnfollow", confirmUnfollow)
|
.putBoolean("confirmUnfollow", confirmUnfollow)
|
||||||
.putBoolean("confirmBoost", confirmBoost)
|
.putBoolean("confirmBoost", confirmBoost)
|
||||||
.putBoolean("confirmDeletePost", confirmDeletePost)
|
.putBoolean("confirmDeletePost", confirmDeletePost)
|
||||||
|
.putBoolean("useDynamicColors", useDynamicColors)
|
||||||
.apply();
|
.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.joinmastodon.android.model.viewmodel.CheckableListItem;
|
||||||
import org.joinmastodon.android.model.viewmodel.ListItem;
|
import org.joinmastodon.android.model.viewmodel.ListItem;
|
||||||
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ import me.grishka.appkit.FragmentStackActivity;
|
||||||
public class SettingsDisplayFragment extends BaseSettingsFragment<Void>{
|
public class SettingsDisplayFragment extends BaseSettingsFragment<Void>{
|
||||||
private ImageView themeTransitionWindowView;
|
private ImageView themeTransitionWindowView;
|
||||||
private ListItem<Void> themeItem;
|
private ListItem<Void> themeItem;
|
||||||
private CheckableListItem<Void> showCWsItem, hideSensitiveMediaItem, interactionCountsItem, emojiInNamesItem;
|
private CheckableListItem<Void> showCWsItem, hideSensitiveMediaItem, interactionCountsItem, emojiInNamesItem, dynamicColorsItem;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState){
|
public void onCreate(Bundle savedInstanceState){
|
||||||
|
@ -37,13 +38,15 @@ public class SettingsDisplayFragment extends BaseSettingsFragment<Void>{
|
||||||
setTitle(R.string.settings_display);
|
setTitle(R.string.settings_display);
|
||||||
AccountSession s=AccountSessionManager.get(accountID);
|
AccountSession s=AccountSessionManager.get(accountID);
|
||||||
AccountLocalPreferences lp=s.getLocalPreferences();
|
AccountLocalPreferences lp=s.getLocalPreferences();
|
||||||
onDataLoaded(List.of(
|
List<ListItem<Void>> items=new ArrayList<>();
|
||||||
themeItem=new ListItem<>(R.string.settings_theme, getAppearanceValue(), R.drawable.ic_dark_mode_24px, this::onAppearanceClick),
|
items.add(themeItem=new ListItem<>(R.string.settings_theme, getAppearanceValue(), R.drawable.ic_dark_mode_24px, this::onAppearanceClick));
|
||||||
showCWsItem=new CheckableListItem<>(R.string.settings_show_cws, 0, CheckableListItem.Style.SWITCH, lp.showCWs, R.drawable.ic_warning_24px, this::toggleCheckableItem),
|
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.S)
|
||||||
hideSensitiveMediaItem=new CheckableListItem<>(R.string.settings_hide_sensitive_media, 0, CheckableListItem.Style.SWITCH, lp.hideSensitiveMedia, R.drawable.ic_no_adult_content_24px, this::toggleCheckableItem),
|
items.add(dynamicColorsItem=new CheckableListItem<>(R.string.settings_use_dynamic_colors, 0, CheckableListItem.Style.SWITCH, GlobalUserPreferences.useDynamicColors, R.drawable.ic_palette_24px, this::onDynamicColorsClick));
|
||||||
interactionCountsItem=new CheckableListItem<>(R.string.settings_show_interaction_counts, 0, CheckableListItem.Style.SWITCH, lp.showInteractionCounts, R.drawable.ic_social_leaderboard_24px, this::toggleCheckableItem),
|
items.add(showCWsItem=new CheckableListItem<>(R.string.settings_show_cws, 0, CheckableListItem.Style.SWITCH, lp.showCWs, R.drawable.ic_warning_24px, this::toggleCheckableItem));
|
||||||
emojiInNamesItem=new CheckableListItem<>(R.string.settings_show_emoji_in_names, 0, CheckableListItem.Style.SWITCH, lp.customEmojiInNames, R.drawable.ic_emoticon_24px, this::toggleCheckableItem)
|
items.add(hideSensitiveMediaItem=new CheckableListItem<>(R.string.settings_hide_sensitive_media, 0, CheckableListItem.Style.SWITCH, lp.hideSensitiveMedia, R.drawable.ic_no_adult_content_24px, this::toggleCheckableItem));
|
||||||
));
|
items.add(interactionCountsItem=new CheckableListItem<>(R.string.settings_show_interaction_counts, 0, CheckableListItem.Style.SWITCH, lp.showInteractionCounts, R.drawable.ic_social_leaderboard_24px, this::toggleCheckableItem));
|
||||||
|
items.add(emojiInNamesItem=new CheckableListItem<>(R.string.settings_show_emoji_in_names, 0, CheckableListItem.Style.SWITCH, lp.customEmojiInNames, R.drawable.ic_emoticon_24px, this::toggleCheckableItem));
|
||||||
|
onDataLoaded(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -109,6 +112,14 @@ public class SettingsDisplayFragment extends BaseSettingsFragment<Void>{
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onDynamicColorsClick(CheckableListItem<?> item){
|
||||||
|
item.toggle();
|
||||||
|
rebindItem(item);
|
||||||
|
GlobalUserPreferences.useDynamicColors=item.checked;
|
||||||
|
GlobalUserPreferences.save();
|
||||||
|
restartActivityToApplyNewTheme();
|
||||||
|
}
|
||||||
|
|
||||||
private void maybeApplyNewThemeRightNow(GlobalUserPreferences.ThemePreference prev){
|
private void maybeApplyNewThemeRightNow(GlobalUserPreferences.ThemePreference prev){
|
||||||
boolean isCurrentDark=prev==GlobalUserPreferences.ThemePreference.DARK ||
|
boolean isCurrentDark=prev==GlobalUserPreferences.ThemePreference.DARK ||
|
||||||
(prev==GlobalUserPreferences.ThemePreference.AUTO && Build.VERSION.SDK_INT>=30 && getResources().getConfiguration().isNightModeActive());
|
(prev==GlobalUserPreferences.ThemePreference.AUTO && Build.VERSION.SDK_INT>=30 && getResources().getConfiguration().isNightModeActive());
|
||||||
|
|
|
@ -729,23 +729,43 @@ public class UiUtils{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getThemeForUserPreference(Context context, GlobalUserPreferences.ThemePreference pref){
|
public static int getThemeForUserPreference(Context context, GlobalUserPreferences.ThemePreference pref){
|
||||||
return switch(pref){
|
if(GlobalUserPreferences.useDynamicColors){
|
||||||
case AUTO -> switch(getColorContrastMode(context)){
|
return switch(pref){
|
||||||
case DEFAULT -> R.style.Theme_Mastodon_AutoLightDark;
|
case AUTO -> switch(getColorContrastMode(context)){
|
||||||
case MEDIUM -> R.style.Theme_Mastodon_AutoLightDark_MediumContrast;
|
case DEFAULT -> R.style.Theme_Mastodon_AutoLightDark;
|
||||||
case HIGH -> R.style.Theme_Mastodon_AutoLightDark_HighContrast;
|
case MEDIUM -> R.style.Theme_Mastodon_AutoLightDark_MediumContrast;
|
||||||
|
case HIGH -> R.style.Theme_Mastodon_AutoLightDark_HighContrast;
|
||||||
|
};
|
||||||
|
case LIGHT -> switch(getColorContrastMode(context)){
|
||||||
|
case DEFAULT -> R.style.Theme_Mastodon_Light;
|
||||||
|
case MEDIUM -> R.style.Theme_Mastodon_Light_MediumContrast;
|
||||||
|
case HIGH -> R.style.Theme_Mastodon_Light_HighContrast;
|
||||||
|
};
|
||||||
|
case DARK -> switch(getColorContrastMode(context)){
|
||||||
|
case DEFAULT -> R.style.Theme_Mastodon_Dark;
|
||||||
|
case MEDIUM -> R.style.Theme_Mastodon_Dark_MediumContrast;
|
||||||
|
case HIGH -> R.style.Theme_Mastodon_Dark_HighContrast;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
case LIGHT -> switch(getColorContrastMode(context)){
|
}else{
|
||||||
case DEFAULT -> R.style.Theme_Mastodon_Light;
|
return switch(pref){
|
||||||
case MEDIUM -> R.style.Theme_Mastodon_Light_MediumContrast;
|
case AUTO -> switch(getColorContrastMode(context)){
|
||||||
case HIGH -> R.style.Theme_Mastodon_Light_HighContrast;
|
case DEFAULT -> R.style.Theme_Mastodon_AutoLightDark_Masterial;
|
||||||
|
case MEDIUM -> R.style.Theme_Mastodon_AutoLightDark_MediumContrast_Masterial;
|
||||||
|
case HIGH -> R.style.Theme_Mastodon_AutoLightDark_HighContrast_Masterial;
|
||||||
|
};
|
||||||
|
case LIGHT -> switch(getColorContrastMode(context)){
|
||||||
|
case DEFAULT -> R.style.Theme_Mastodon_Light_Masterial;
|
||||||
|
case MEDIUM -> R.style.Theme_Mastodon_Light_MediumContrast_Masterial;
|
||||||
|
case HIGH -> R.style.Theme_Mastodon_Light_HighContrast_Masterial;
|
||||||
|
};
|
||||||
|
case DARK -> switch(getColorContrastMode(context)){
|
||||||
|
case DEFAULT -> R.style.Theme_Mastodon_Dark_Masterial;
|
||||||
|
case MEDIUM -> R.style.Theme_Mastodon_Dark_MediumContrast_Masterial;
|
||||||
|
case HIGH -> R.style.Theme_Mastodon_Dark_HighContrast_Masterial;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
case DARK -> switch(getColorContrastMode(context)){
|
}
|
||||||
case DEFAULT -> R.style.Theme_Mastodon_Dark;
|
|
||||||
case MEDIUM -> R.style.Theme_Mastodon_Dark_MediumContrast;
|
|
||||||
case HIGH -> R.style.Theme_Mastodon_Dark_HighContrast;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isDarkTheme(){
|
public static boolean isDarkTheme(){
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M480,880Q398,880 325,848.5Q252,817 197.5,762.5Q143,708 111.5,635Q80,562 80,480Q80,397 112.5,324Q145,251 200.5,197Q256,143 330,111.5Q404,80 488,80Q568,80 639,107.5Q710,135 763.5,183.5Q817,232 848.5,298.5Q880,365 880,442Q880,557 810,618.5Q740,680 640,680L566,680Q557,680 553.5,685Q550,690 550,696Q550,708 565,730.5Q580,753 580,782Q580,832 552.5,856Q525,880 480,880ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480L480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480ZM260,520Q286,520 303,503Q320,486 320,460Q320,434 303,417Q286,400 260,400Q234,400 217,417Q200,434 200,460Q200,486 217,503Q234,520 260,520ZM380,360Q406,360 423,343Q440,326 440,300Q440,274 423,257Q406,240 380,240Q354,240 337,257Q320,274 320,300Q320,326 337,343Q354,360 380,360ZM580,360Q606,360 623,343Q640,326 640,300Q640,274 623,257Q606,240 580,240Q554,240 537,257Q520,274 520,300Q520,326 537,343Q554,360 580,360ZM700,520Q726,520 743,503Q760,486 760,460Q760,434 743,417Q726,400 700,400Q674,400 657,417Q640,434 640,460Q640,486 657,503Q674,520 700,520ZM480,800Q489,800 494.5,795Q500,790 500,782Q500,768 485,749Q470,730 470,692Q470,650 499,625Q528,600 570,600L640,600Q706,600 753,561.5Q800,523 800,442Q800,321 707.5,240.5Q615,160 488,160Q352,160 256,253Q160,346 160,480Q160,613 253.5,706.5Q347,800 480,800Z"/>
|
||||||
|
</vector>
|
|
@ -3,4 +3,7 @@
|
||||||
<style name="Theme.Mastodon.AutoLightDark" parent="Theme.Mastodon.Dark"/>
|
<style name="Theme.Mastodon.AutoLightDark" parent="Theme.Mastodon.Dark"/>
|
||||||
<style name="Theme.Mastodon.AutoLightDark.MediumContrast" parent="Theme.Mastodon.Dark.MediumContrast"/>
|
<style name="Theme.Mastodon.AutoLightDark.MediumContrast" parent="Theme.Mastodon.Dark.MediumContrast"/>
|
||||||
<style name="Theme.Mastodon.AutoLightDark.HighContrast" parent="Theme.Mastodon.Dark.HighContrast"/>
|
<style name="Theme.Mastodon.AutoLightDark.HighContrast" parent="Theme.Mastodon.Dark.HighContrast"/>
|
||||||
|
<style name="Theme.Mastodon.AutoLightDark.Masterial" parent="Theme.Mastodon.Dark.Masterial"/>
|
||||||
|
<style name="Theme.Mastodon.AutoLightDark.MediumContrast.Masterial" parent="Theme.Mastodon.Dark.MediumContrast.Masterial"/>
|
||||||
|
<style name="Theme.Mastodon.AutoLightDark.HighContrast.Masterial" parent="Theme.Mastodon.Dark.HighContrast.Masterial"/>
|
||||||
</resources>
|
</resources>
|
|
@ -11,56 +11,56 @@
|
||||||
<!-- M3 dynamic colors -->
|
<!-- M3 dynamic colors -->
|
||||||
|
|
||||||
<!-- light theme -->
|
<!-- light theme -->
|
||||||
<color name="m3_sys_light_primary">#6750A4</color>
|
<color name="m3_sys_light_primary">@color/masterialLight_primary</color>
|
||||||
<color name="m3_sys_light_on_primary">#FFFFFF</color>
|
<color name="m3_sys_light_on_primary">@color/masterialLight_onPrimary</color>
|
||||||
<color name="m3_sys_light_primary_container">#EADDFF</color>
|
<color name="m3_sys_light_primary_container">@color/masterialLight_primaryContainer</color>
|
||||||
<color name="m3_sys_light_on_primary_container">#21005D</color>
|
<color name="m3_sys_light_on_primary_container">@color/masterialLight_onPrimaryContainer</color>
|
||||||
<color name="m3_sys_light_secondary">#625B71</color>
|
<color name="m3_sys_light_secondary">@color/masterialLight_secondary</color>
|
||||||
<color name="m3_sys_light_on_secondary">#FFFFFF</color>
|
<color name="m3_sys_light_on_secondary">@color/masterialLight_onSecondary</color>
|
||||||
<color name="m3_sys_light_secondary_container">#E8DEF8</color>
|
<color name="m3_sys_light_secondary_container">@color/masterialLight_secondaryContainer</color>
|
||||||
<color name="m3_sys_light_on_secondary_container">#1D192B</color>
|
<color name="m3_sys_light_on_secondary_container">@color/masterialLight_onSecondaryContainer</color>
|
||||||
<color name="m3_sys_light_tertiary">#7D5260</color>
|
<color name="m3_sys_light_tertiary">@color/masterialLight_tertiary</color>
|
||||||
<color name="m3_sys_light_on_tertiary">#FFF</color>
|
<color name="m3_sys_light_on_tertiary">@color/masterialLight_onTertiary</color>
|
||||||
<color name="m3_sys_light_tertiary_container">#FFD8E4</color>
|
<color name="m3_sys_light_tertiary_container">@color/masterialLight_tertiaryContainer</color>
|
||||||
<color name="m3_sys_light_on_tertiary_container">#31111D</color>
|
<color name="m3_sys_light_on_tertiary_container">@color/masterialLight_onTertiaryContainer</color>
|
||||||
<color name="m3_sys_light_background">#FFFBFE</color>
|
<color name="m3_sys_light_background">@color/masterialLight_background</color>
|
||||||
<color name="m3_sys_light_on_background">#1C1B1F</color>
|
<color name="m3_sys_light_on_background">@color/masterialLight_onBackground</color>
|
||||||
<color name="m3_sys_light_surface">#FFFBFE</color>
|
<color name="m3_sys_light_surface">@color/masterialLight_surface</color>
|
||||||
<color name="m3_sys_light_on_surface">#1C1B1F</color>
|
<color name="m3_sys_light_on_surface">@color/masterialLight_onSurface</color>
|
||||||
<color name="m3_sys_light_surface_variant">#E7E0EC</color>
|
<color name="m3_sys_light_surface_variant">@color/masterialLight_surfaceVariant</color>
|
||||||
<color name="m3_sys_light_on_surface_variant">#49454F</color>
|
<color name="m3_sys_light_on_surface_variant">@color/masterialLight_onSurfaceVariant</color>
|
||||||
<color name="m3_sys_light_outline">#79747E</color>
|
<color name="m3_sys_light_outline">@color/masterialLight_outline</color>
|
||||||
<color name="m3_sys_light_outline_variant">#CAC4D0</color>
|
<color name="m3_sys_light_outline_variant">@color/masterialLight_outlineVariant</color>
|
||||||
<color name="m3_sys_light_error">#B3261E</color>
|
<color name="m3_sys_light_error">@color/masterialLight_error</color>
|
||||||
<color name="m3_sys_light_on_error">#FFF</color>
|
<color name="m3_sys_light_on_error">@color/masterialLight_onError</color>
|
||||||
<color name="m3_sys_light_error_container">#F9DEDC</color>
|
<color name="m3_sys_light_error_container">@color/masterialLight_errorContainer</color>
|
||||||
<color name="m3_sys_light_on_error_container">#410E0B</color>
|
<color name="m3_sys_light_on_error_container">@color/masterialLight_onErrorContainer</color>
|
||||||
|
|
||||||
<!-- dark theme -->
|
<!-- dark theme -->
|
||||||
<color name="m3_sys_dark_primary">#D0BCFF</color>
|
<color name="m3_sys_dark_primary">@color/masterialDark_primary</color>
|
||||||
<color name="m3_sys_dark_on_primary">#381E72</color>
|
<color name="m3_sys_dark_on_primary">@color/masterialDark_onPrimary</color>
|
||||||
<color name="m3_sys_dark_primary_container">#4F378B</color>
|
<color name="m3_sys_dark_primary_container">@color/masterialDark_primaryContainer</color>
|
||||||
<color name="m3_sys_dark_on_primary_container">#EADDFF</color>
|
<color name="m3_sys_dark_on_primary_container">@color/masterialDark_onPrimaryContainer</color>
|
||||||
<color name="m3_sys_dark_secondary">#CCC2DC</color>
|
<color name="m3_sys_dark_secondary">@color/masterialDark_secondary</color>
|
||||||
<color name="m3_sys_dark_on_secondary">#332D41</color>
|
<color name="m3_sys_dark_on_secondary">@color/masterialDark_onSecondary</color>
|
||||||
<color name="m3_sys_dark_secondary_container">#4A4458</color>
|
<color name="m3_sys_dark_secondary_container">@color/masterialDark_secondaryContainer</color>
|
||||||
<color name="m3_sys_dark_on_secondary_container">#E8DEF8</color>
|
<color name="m3_sys_dark_on_secondary_container">@color/masterialDark_onSecondaryContainer</color>
|
||||||
<color name="m3_sys_dark_tertiary">#EFB8C8</color>
|
<color name="m3_sys_dark_tertiary">@color/masterialDark_tertiary</color>
|
||||||
<color name="m3_sys_dark_on_tertiary">#492532</color>
|
<color name="m3_sys_dark_on_tertiary">@color/masterialDark_onTertiary</color>
|
||||||
<color name="m3_sys_dark_tertiary_container">#633B48</color>
|
<color name="m3_sys_dark_tertiary_container">@color/masterialDark_tertiaryContainer</color>
|
||||||
<color name="m3_sys_dark_on_tertiary_container">#FFD8E4</color>
|
<color name="m3_sys_dark_on_tertiary_container">@color/masterialDark_onTertiaryContainer</color>
|
||||||
<color name="m3_sys_dark_background">#1C1B1F</color>
|
<color name="m3_sys_dark_background">@color/masterialDark_background</color>
|
||||||
<color name="m3_sys_dark_on_background">#E6E1E5</color>
|
<color name="m3_sys_dark_on_background">@color/masterialDark_onBackground</color>
|
||||||
<color name="m3_sys_dark_surface">#1C1B1F</color>
|
<color name="m3_sys_dark_surface">@color/masterialDark_surface</color>
|
||||||
<color name="m3_sys_dark_on_surface">#E6E1E5</color>
|
<color name="m3_sys_dark_on_surface">@color/masterialDark_onSurface</color>
|
||||||
<color name="m3_sys_dark_surface_variant">#49454F</color>
|
<color name="m3_sys_dark_surface_variant">@color/masterialDark_surfaceVariant</color>
|
||||||
<color name="m3_sys_dark_on_surface_variant">#CAC4D0</color>
|
<color name="m3_sys_dark_on_surface_variant">@color/masterialDark_onSurfaceVariant</color>
|
||||||
<color name="m3_sys_dark_outline">#938F99</color>
|
<color name="m3_sys_dark_outline">@color/masterialDark_outline</color>
|
||||||
<color name="m3_sys_dark_outline_variant">#49454F</color>
|
<color name="m3_sys_dark_outline_variant">@color/masterialDark_outlineVariant</color>
|
||||||
<color name="m3_sys_dark_error">#F2B8B5</color>
|
<color name="m3_sys_dark_error">@color/masterialDark_error</color>
|
||||||
<color name="m3_sys_dark_on_error">#601410</color>
|
<color name="m3_sys_dark_on_error">@color/masterialDark_onError</color>
|
||||||
<color name="m3_sys_dark_error_container">#8C1D18</color>
|
<color name="m3_sys_dark_error_container">@color/masterialDark_errorContainer</color>
|
||||||
<color name="m3_sys_dark_on_error_container">#F9DEDC</color>
|
<color name="m3_sys_dark_on_error_container">@color/masterialDark_onErrorContainer</color>
|
||||||
|
|
||||||
<!-- extended colors -->
|
<!-- extended colors -->
|
||||||
<color name="ext_favorite_light">#E89A00</color>
|
<color name="ext_favorite_light">#E89A00</color>
|
||||||
|
|
|
@ -813,4 +813,5 @@
|
||||||
<string name="text_show_more">More</string>
|
<string name="text_show_more">More</string>
|
||||||
<string name="avatar_move_and_scale">Move and scale</string>
|
<string name="avatar_move_and_scale">Move and scale</string>
|
||||||
<string name="confirm_avatar_crop">Choose</string>
|
<string name="confirm_avatar_crop">Choose</string>
|
||||||
|
<string name="settings_use_dynamic_colors">Use system dynamic color</string>
|
||||||
</resources>
|
</resources>
|
|
@ -218,6 +218,192 @@
|
||||||
<item name="composePollStyleInactiveAlpha">0.6</item>
|
<item name="composePollStyleInactiveAlpha">0.6</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.Mastodon.Light.Masterial">
|
||||||
|
<item name="colorM3Primary">@color/masterialLight_primary</item>
|
||||||
|
<item name="colorM3OnPrimary">@color/masterialLight_onPrimary</item>
|
||||||
|
<item name="colorM3PrimaryContainer">@color/masterialLight_primaryContainer</item>
|
||||||
|
<item name="colorM3OnPrimaryContainer">@color/masterialLight_onPrimaryContainer</item>
|
||||||
|
<item name="colorM3Secondary">@color/masterialLight_secondary</item>
|
||||||
|
<item name="colorM3OnSecondary">@color/masterialLight_onSecondary</item>
|
||||||
|
<item name="colorM3SecondaryContainer">@color/masterialLight_secondaryContainer</item>
|
||||||
|
<item name="colorM3OnSecondaryContainer">@color/masterialLight_onSecondaryContainer</item>
|
||||||
|
<item name="colorM3Tertiary">@color/masterialLight_tertiary</item>
|
||||||
|
<item name="colorM3OnTertiary">@color/masterialLight_onTertiary</item>
|
||||||
|
<item name="colorM3TertiaryContainer">@color/masterialLight_tertiaryContainer</item>
|
||||||
|
<item name="colorM3OnTertiaryContainer">@color/masterialLight_onTertiaryContainer</item>
|
||||||
|
<item name="colorM3Background">@color/masterialLight_background</item>
|
||||||
|
<item name="colorM3OnBackground">@color/masterialLight_onBackground</item>
|
||||||
|
<item name="colorM3Surface">@color/masterialLight_surface</item>
|
||||||
|
<item name="colorM3OnSurface">@color/masterialLight_onSurface</item>
|
||||||
|
<item name="colorM3SurfaceVariant">@color/masterialLight_surfaceVariant</item>
|
||||||
|
<item name="colorM3OnSurfaceVariant">@color/masterialLight_onSurfaceVariant</item>
|
||||||
|
<item name="colorM3Outline">@color/masterialLight_outline</item>
|
||||||
|
<item name="colorM3OutlineVariant">@color/masterialLight_outlineVariant</item>
|
||||||
|
<item name="colorM3PressedOverlay">@color/masterialLight_onPrimary</item>
|
||||||
|
<item name="colorM3Error">@color/masterialLight_error</item>
|
||||||
|
<item name="colorM3OnError">@color/masterialLight_onError</item>
|
||||||
|
<item name="colorM3ErrorContainer">@color/masterialLight_errorContainer</item>
|
||||||
|
<item name="colorM3OnErrorContainer">@color/masterialLight_onErrorContainer</item>
|
||||||
|
<item name="colorM3PrimaryInverse">@color/masterialDark_primary</item>
|
||||||
|
<item name="colorM3SurfaceInverse">@color/masterialDark_surface</item>
|
||||||
|
<item name="colorM3OnSurfaceInverse">@color/masterialDark_onSurface</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.Mastodon.Dark.Masterial">
|
||||||
|
<item name="colorM3Primary">@color/masterialDark_primary</item>
|
||||||
|
<item name="colorM3OnPrimary">@color/masterialDark_onPrimary</item>
|
||||||
|
<item name="colorM3PrimaryContainer">@color/masterialDark_primaryContainer</item>
|
||||||
|
<item name="colorM3OnPrimaryContainer">@color/masterialDark_onPrimaryContainer</item>
|
||||||
|
<item name="colorM3Secondary">@color/masterialDark_secondary</item>
|
||||||
|
<item name="colorM3OnSecondary">@color/masterialDark_onSecondary</item>
|
||||||
|
<item name="colorM3SecondaryContainer">@color/masterialDark_secondaryContainer</item>
|
||||||
|
<item name="colorM3OnSecondaryContainer">@color/masterialDark_onSecondaryContainer</item>
|
||||||
|
<item name="colorM3Tertiary">@color/masterialDark_tertiary</item>
|
||||||
|
<item name="colorM3OnTertiary">@color/masterialDark_onTertiary</item>
|
||||||
|
<item name="colorM3TertiaryContainer">@color/masterialDark_tertiaryContainer</item>
|
||||||
|
<item name="colorM3OnTertiaryContainer">@color/masterialDark_onTertiaryContainer</item>
|
||||||
|
<item name="colorM3Background">@color/masterialDark_background</item>
|
||||||
|
<item name="colorM3OnBackground">@color/masterialDark_onBackground</item>
|
||||||
|
<item name="colorM3Surface">@color/masterialDark_surface</item>
|
||||||
|
<item name="colorM3OnSurface">@color/masterialDark_onSurface</item>
|
||||||
|
<item name="colorM3SurfaceVariant">@color/masterialDark_surfaceVariant</item>
|
||||||
|
<item name="colorM3OnSurfaceVariant">@color/masterialDark_onSurfaceVariant</item>
|
||||||
|
<item name="colorM3Outline">@color/masterialDark_outline</item>
|
||||||
|
<item name="colorM3OutlineVariant">@color/masterialDark_outlineVariant</item>
|
||||||
|
<item name="colorM3PressedOverlay">@color/masterialDark_onPrimary</item>
|
||||||
|
<item name="colorM3Error">@color/masterialDark_error</item>
|
||||||
|
<item name="colorM3OnError">@color/masterialDark_onError</item>
|
||||||
|
<item name="colorM3ErrorContainer">@color/masterialDark_errorContainer</item>
|
||||||
|
<item name="colorM3OnErrorContainer">@color/masterialDark_onErrorContainer</item>
|
||||||
|
<item name="colorM3PrimaryInverse">@color/masterialLight_primary</item>
|
||||||
|
<item name="colorM3SurfaceInverse">@color/masterialLight_surface</item>
|
||||||
|
<item name="colorM3OnSurfaceInverse">@color/masterialLight_onSurface</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.Mastodon.Light.MediumContrast.Masterial">
|
||||||
|
<item name="colorM3Primary">@color/masterialLight_primary_mediumContrast</item>
|
||||||
|
<item name="colorM3OnPrimary">@color/masterialLight_onPrimary_mediumContrast</item>
|
||||||
|
<item name="colorM3PrimaryContainer">@color/masterialLight_primaryContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3OnPrimaryContainer">@color/masterialLight_onPrimaryContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3Secondary">@color/masterialLight_secondary_mediumContrast</item>
|
||||||
|
<item name="colorM3OnSecondary">@color/masterialLight_onSecondary_mediumContrast</item>
|
||||||
|
<item name="colorM3SecondaryContainer">@color/masterialLight_secondaryContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3OnSecondaryContainer">@color/masterialLight_onSecondaryContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3Tertiary">@color/masterialLight_tertiary_mediumContrast</item>
|
||||||
|
<item name="colorM3OnTertiary">@color/masterialLight_onTertiary_mediumContrast</item>
|
||||||
|
<item name="colorM3TertiaryContainer">@color/masterialLight_tertiaryContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3OnTertiaryContainer">@color/masterialLight_onTertiaryContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3Background">@color/masterialLight_background_mediumContrast</item>
|
||||||
|
<item name="colorM3OnBackground">@color/masterialLight_onBackground_mediumContrast</item>
|
||||||
|
<item name="colorM3Surface">@color/masterialLight_surface_mediumContrast</item>
|
||||||
|
<item name="colorM3OnSurface">@color/masterialLight_onSurface_mediumContrast</item>
|
||||||
|
<item name="colorM3SurfaceVariant">@color/masterialLight_surfaceVariant_mediumContrast</item>
|
||||||
|
<item name="colorM3OnSurfaceVariant">@color/masterialLight_onSurfaceVariant_mediumContrast</item>
|
||||||
|
<item name="colorM3Outline">@color/masterialLight_outline_mediumContrast</item>
|
||||||
|
<item name="colorM3OutlineVariant">@color/masterialLight_outlineVariant_mediumContrast</item>
|
||||||
|
<item name="colorM3PressedOverlay">@color/masterialLight_onPrimary_mediumContrast</item>
|
||||||
|
<item name="colorM3Error">@color/masterialLight_error_mediumContrast</item>
|
||||||
|
<item name="colorM3OnError">@color/masterialLight_onError_mediumContrast</item>
|
||||||
|
<item name="colorM3ErrorContainer">@color/masterialLight_errorContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3OnErrorContainer">@color/masterialLight_onErrorContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3PrimaryInverse">@color/masterialDark_primary_mediumContrast</item>
|
||||||
|
<item name="colorM3SurfaceInverse">@color/masterialDark_surface_mediumContrast</item>
|
||||||
|
<item name="colorM3OnSurfaceInverse">@color/masterialDark_onSurface_mediumContrast</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.Mastodon.Dark.MediumContrast.Masterial">
|
||||||
|
<item name="colorM3Primary">@color/masterialDark_primary_mediumContrast</item>
|
||||||
|
<item name="colorM3OnPrimary">@color/masterialDark_onPrimary_mediumContrast</item>
|
||||||
|
<item name="colorM3PrimaryContainer">@color/masterialDark_primaryContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3OnPrimaryContainer">@color/masterialDark_onPrimaryContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3Secondary">@color/masterialDark_secondary_mediumContrast</item>
|
||||||
|
<item name="colorM3OnSecondary">@color/masterialDark_onSecondary_mediumContrast</item>
|
||||||
|
<item name="colorM3SecondaryContainer">@color/masterialDark_secondaryContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3OnSecondaryContainer">@color/masterialDark_onSecondaryContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3Tertiary">@color/masterialDark_tertiary_mediumContrast</item>
|
||||||
|
<item name="colorM3OnTertiary">@color/masterialDark_onTertiary_mediumContrast</item>
|
||||||
|
<item name="colorM3TertiaryContainer">@color/masterialDark_tertiaryContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3OnTertiaryContainer">@color/masterialDark_onTertiaryContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3Background">@color/masterialDark_background_mediumContrast</item>
|
||||||
|
<item name="colorM3OnBackground">@color/masterialDark_onBackground_mediumContrast</item>
|
||||||
|
<item name="colorM3Surface">@color/masterialDark_surface_mediumContrast</item>
|
||||||
|
<item name="colorM3OnSurface">@color/masterialDark_onSurface_mediumContrast</item>
|
||||||
|
<item name="colorM3SurfaceVariant">@color/masterialDark_surfaceVariant_mediumContrast</item>
|
||||||
|
<item name="colorM3OnSurfaceVariant">@color/masterialDark_onSurfaceVariant_mediumContrast</item>
|
||||||
|
<item name="colorM3Outline">@color/masterialDark_outline_mediumContrast</item>
|
||||||
|
<item name="colorM3OutlineVariant">@color/masterialDark_outlineVariant_mediumContrast</item>
|
||||||
|
<item name="colorM3PressedOverlay">@color/masterialDark_onPrimary_mediumContrast</item>
|
||||||
|
<item name="colorM3Error">@color/masterialDark_error_mediumContrast</item>
|
||||||
|
<item name="colorM3OnError">@color/masterialDark_onError_mediumContrast</item>
|
||||||
|
<item name="colorM3ErrorContainer">@color/masterialDark_errorContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3OnErrorContainer">@color/masterialDark_onErrorContainer_mediumContrast</item>
|
||||||
|
<item name="colorM3PrimaryInverse">@color/masterialLight_primary_mediumContrast</item>
|
||||||
|
<item name="colorM3SurfaceInverse">@color/masterialLight_surface_mediumContrast</item>
|
||||||
|
<item name="colorM3OnSurfaceInverse">@color/masterialLight_onSurface_mediumContrast</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.Mastodon.Light.HighContrast.Masterial">
|
||||||
|
<item name="colorM3Primary">@color/masterialLight_primary_highContrast</item>
|
||||||
|
<item name="colorM3OnPrimary">@color/masterialLight_onPrimary_highContrast</item>
|
||||||
|
<item name="colorM3PrimaryContainer">@color/masterialLight_primaryContainer_highContrast</item>
|
||||||
|
<item name="colorM3OnPrimaryContainer">@color/masterialLight_onPrimaryContainer_highContrast</item>
|
||||||
|
<item name="colorM3Secondary">@color/masterialLight_secondary_highContrast</item>
|
||||||
|
<item name="colorM3OnSecondary">@color/masterialLight_onSecondary_highContrast</item>
|
||||||
|
<item name="colorM3SecondaryContainer">@color/masterialLight_secondaryContainer_highContrast</item>
|
||||||
|
<item name="colorM3OnSecondaryContainer">@color/masterialLight_onSecondaryContainer_highContrast</item>
|
||||||
|
<item name="colorM3Tertiary">@color/masterialLight_tertiary_highContrast</item>
|
||||||
|
<item name="colorM3OnTertiary">@color/masterialLight_onTertiary_highContrast</item>
|
||||||
|
<item name="colorM3TertiaryContainer">@color/masterialLight_tertiaryContainer_highContrast</item>
|
||||||
|
<item name="colorM3OnTertiaryContainer">@color/masterialLight_onTertiaryContainer_highContrast</item>
|
||||||
|
<item name="colorM3Background">@color/masterialLight_background_highContrast</item>
|
||||||
|
<item name="colorM3OnBackground">@color/masterialLight_onBackground_highContrast</item>
|
||||||
|
<item name="colorM3Surface">@color/masterialLight_surface_highContrast</item>
|
||||||
|
<item name="colorM3OnSurface">@color/masterialLight_onSurface_highContrast</item>
|
||||||
|
<item name="colorM3SurfaceVariant">@color/masterialLight_surfaceVariant_highContrast</item>
|
||||||
|
<item name="colorM3OnSurfaceVariant">@color/masterialLight_onSurfaceVariant_highContrast</item>
|
||||||
|
<item name="colorM3Outline">@color/masterialLight_outline_highContrast</item>
|
||||||
|
<item name="colorM3OutlineVariant">@color/masterialLight_outlineVariant_highContrast</item>
|
||||||
|
<item name="colorM3PressedOverlay">@color/masterialLight_onPrimary_highContrast</item>
|
||||||
|
<item name="colorM3Error">@color/masterialLight_error_highContrast</item>
|
||||||
|
<item name="colorM3OnError">@color/masterialLight_onError_highContrast</item>
|
||||||
|
<item name="colorM3ErrorContainer">@color/masterialLight_errorContainer_highContrast</item>
|
||||||
|
<item name="colorM3OnErrorContainer">@color/masterialLight_onErrorContainer_highContrast</item>
|
||||||
|
<item name="colorM3PrimaryInverse">@color/masterialDark_primary_highContrast</item>
|
||||||
|
<item name="colorM3SurfaceInverse">@color/masterialDark_surface_highContrast</item>
|
||||||
|
<item name="colorM3OnSurfaceInverse">@color/masterialDark_onSurface_highContrast</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.Mastodon.Dark.HighContrast.Masterial">
|
||||||
|
<item name="colorM3Primary">@color/masterialDark_primary_highContrast</item>
|
||||||
|
<item name="colorM3OnPrimary">@color/masterialDark_onPrimary_highContrast</item>
|
||||||
|
<item name="colorM3PrimaryContainer">@color/masterialDark_primaryContainer_highContrast</item>
|
||||||
|
<item name="colorM3OnPrimaryContainer">@color/masterialDark_onPrimaryContainer_highContrast</item>
|
||||||
|
<item name="colorM3Secondary">@color/masterialDark_secondary_highContrast</item>
|
||||||
|
<item name="colorM3OnSecondary">@color/masterialDark_onSecondary_highContrast</item>
|
||||||
|
<item name="colorM3SecondaryContainer">@color/masterialDark_secondaryContainer_highContrast</item>
|
||||||
|
<item name="colorM3OnSecondaryContainer">@color/masterialDark_onSecondaryContainer_highContrast</item>
|
||||||
|
<item name="colorM3Tertiary">@color/masterialDark_tertiary_highContrast</item>
|
||||||
|
<item name="colorM3OnTertiary">@color/masterialDark_onTertiary_highContrast</item>
|
||||||
|
<item name="colorM3TertiaryContainer">@color/masterialDark_tertiaryContainer_highContrast</item>
|
||||||
|
<item name="colorM3OnTertiaryContainer">@color/masterialDark_onTertiaryContainer_highContrast</item>
|
||||||
|
<item name="colorM3Background">@color/masterialDark_background_highContrast</item>
|
||||||
|
<item name="colorM3OnBackground">@color/masterialDark_onBackground_highContrast</item>
|
||||||
|
<item name="colorM3Surface">@color/masterialDark_surface_highContrast</item>
|
||||||
|
<item name="colorM3OnSurface">@color/masterialDark_onSurface_highContrast</item>
|
||||||
|
<item name="colorM3SurfaceVariant">@color/masterialDark_surfaceVariant_highContrast</item>
|
||||||
|
<item name="colorM3OnSurfaceVariant">@color/masterialDark_onSurfaceVariant_highContrast</item>
|
||||||
|
<item name="colorM3Outline">@color/masterialDark_outline_highContrast</item>
|
||||||
|
<item name="colorM3OutlineVariant">@color/masterialDark_outlineVariant_highContrast</item>
|
||||||
|
<item name="colorM3PressedOverlay">@color/masterialDark_onPrimary_highContrast</item>
|
||||||
|
<item name="colorM3Error">@color/masterialDark_error_highContrast</item>
|
||||||
|
<item name="colorM3OnError">@color/masterialDark_onError_highContrast</item>
|
||||||
|
<item name="colorM3ErrorContainer">@color/masterialDark_errorContainer_highContrast</item>
|
||||||
|
<item name="colorM3OnErrorContainer">@color/masterialDark_onErrorContainer_highContrast</item>
|
||||||
|
<item name="colorM3PrimaryInverse">@color/masterialLight_primary_highContrast</item>
|
||||||
|
<item name="colorM3SurfaceInverse">@color/masterialLight_surface_highContrast</item>
|
||||||
|
<item name="colorM3OnSurfaceInverse">@color/masterialLight_onSurface_highContrast</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Mastodon.Dark.SplashFragment">
|
<style name="Theme.Mastodon.Dark.SplashFragment">
|
||||||
<item name="colorM3Primary">#563ACC</item>
|
<item name="colorM3Primary">#563ACC</item>
|
||||||
<item name="colorM3OnPrimary">#FFF</item>
|
<item name="colorM3OnPrimary">#FFF</item>
|
||||||
|
@ -228,6 +414,9 @@
|
||||||
<style name="Theme.Mastodon.AutoLightDark" parent="Theme.Mastodon.Light"/>
|
<style name="Theme.Mastodon.AutoLightDark" parent="Theme.Mastodon.Light"/>
|
||||||
<style name="Theme.Mastodon.AutoLightDark.MediumContrast" parent="Theme.Mastodon.Light.MediumContrast"/>
|
<style name="Theme.Mastodon.AutoLightDark.MediumContrast" parent="Theme.Mastodon.Light.MediumContrast"/>
|
||||||
<style name="Theme.Mastodon.AutoLightDark.HighContrast" parent="Theme.Mastodon.Light.HighContrast"/>
|
<style name="Theme.Mastodon.AutoLightDark.HighContrast" parent="Theme.Mastodon.Light.HighContrast"/>
|
||||||
|
<style name="Theme.Mastodon.AutoLightDark.Masterial" parent="Theme.Mastodon.Light.Masterial"/>
|
||||||
|
<style name="Theme.Mastodon.AutoLightDark.MediumContrast.Masterial" parent="Theme.Mastodon.Light.MediumContrast.Masterial"/>
|
||||||
|
<style name="Theme.Mastodon.AutoLightDark.HighContrast.Masterial" parent="Theme.Mastodon.Light.HighContrast.Masterial"/>
|
||||||
|
|
||||||
<style name="Theme.Mastodon.Toolbar" parent="android:ThemeOverlay.Material.ActionBar">
|
<style name="Theme.Mastodon.Toolbar" parent="android:ThemeOverlay.Material.ActionBar">
|
||||||
<item name="android:colorPrimary">?colorM3Background</item>
|
<item name="android:colorPrimary">?colorM3Background</item>
|
||||||
|
|
Loading…
Reference in New Issue