Replace changelog css colors

This commit is contained in:
Michael Schättgen 2019-12-26 23:25:05 +01:00
parent 08b80d2e72
commit fc96e7919a
2 changed files with 91 additions and 86 deletions

View file

@ -5,8 +5,8 @@
word-wrap: break-word;
}
body {
background-color: #%1$s;
color: #%2$s;
background-color: %1$s;
color: %2$s;
}
ul {
list-style-position: inside;
@ -83,3 +83,4 @@
<li>Crash when entering a large value for OTP period</li>
</ul>
</body>
</html>

View file

@ -75,12 +75,16 @@ public class ChangelogDialog extends DialogFragment {
private String replaceStylesheet(String changelog) {
int backgroundColorResource = _themeStyle == Theme.AMOLED ? R.attr.cardBackgroundFocused : R.attr.cardBackground;
String backgroundColor = String.format("%06X", (0xFFFFFF & ThemeHelper.getThemeColor(backgroundColorResource, getContext().getTheme())));
String textColor = String.format("%06X", (0xFFFFFF & ThemeHelper.getThemeColor(R.attr.primaryText, getContext().getTheme())));
String backgroundColor = colorToCSS(ThemeHelper.getThemeColor(backgroundColorResource, getContext().getTheme()));
String textColor = colorToCSS(0xFFFFFF & ThemeHelper.getThemeColor(R.attr.primaryText, getContext().getTheme()));
return String.format(changelog, backgroundColor, textColor);
}
private static String colorToCSS(int color) {
return String.format("rgb(%d, %d, %d)", Color.red(color), Color.green(color), Color.blue(color));
}
public ChangelogDialog setTheme(Theme theme) {
_themeStyle = theme;