|
|
@ -73,6 +73,16 @@ public class SettingsConfiguration implements Serializable { |
|
|
|
return baseTheme.derive(fontSizeRule, getFontPrototype(), accentColorRule); |
|
|
|
return baseTheme.derive(fontSizeRule, getFontPrototype(), accentColorRule); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public final PreferredThemeStyle getEffectiveThemeStyle(final PreferredThemeStyle themeStyle) { |
|
|
|
|
|
|
|
Theme baseTheme = getEffectiveBaseTheme(themeStyle); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FontSizeRule fontSizeRule = getEffectiveFontSizeRule(themeStyle); |
|
|
|
|
|
|
|
AccentColorRule accentColorRule = getEffectiveAccentColorRule(baseTheme, themeStyle); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new PreferredThemeStyle(themeStyle.getContrastRule(), themeStyle.getColorToneRule(), |
|
|
|
|
|
|
|
accentColorRule, fontSizeRule); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private AccentColorRule getEffectiveAccentColorRule(final Theme baseTheme, |
|
|
|
private AccentColorRule getEffectiveAccentColorRule(final Theme baseTheme, |
|
|
|
final PreferredThemeStyle preferredThemeStyle) { |
|
|
|
final PreferredThemeStyle preferredThemeStyle) { |
|
|
|
AccentColorRule accentColorRule = getAccentColorRule(); |
|
|
|
AccentColorRule accentColorRule = getAccentColorRule(); |
|
|
@ -81,10 +91,10 @@ public class SettingsConfiguration implements Serializable { |
|
|
|
AccentColorRule systemAccentColorRule = preferredThemeStyle.getAccentColorRule(); |
|
|
|
AccentColorRule systemAccentColorRule = preferredThemeStyle.getAccentColorRule(); |
|
|
|
Color accentColor = accentColorRule.getAccentColor(); |
|
|
|
Color accentColor = accentColorRule.getAccentColor(); |
|
|
|
Color selectionColor = accentColorRule.getSelectionColor(); |
|
|
|
Color selectionColor = accentColorRule.getSelectionColor(); |
|
|
|
if (isAccentColorFollowsSystem() && baseTheme.supportsCustomAccentColor()) { |
|
|
|
if (isAccentColorFollowsSystem() && (baseTheme == null || baseTheme.supportsCustomAccentColor())) { |
|
|
|
accentColor = systemAccentColorRule.getAccentColor(); |
|
|
|
accentColor = systemAccentColorRule.getAccentColor(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (isSelectionColorFollowsSystem() && baseTheme.supportsCustomSelectionColor()) { |
|
|
|
if (isSelectionColorFollowsSystem() && (baseTheme == null || baseTheme.supportsCustomSelectionColor())) { |
|
|
|
selectionColor = systemAccentColorRule.getSelectionColor(); |
|
|
|
selectionColor = systemAccentColorRule.getSelectionColor(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|