Fixed a bug with the theme

This commit is contained in:
Rsl1122 2017-12-01 17:43:22 +02:00
parent 8dd7d9615f
commit 0a5eda1fc8
3 changed files with 10 additions and 7 deletions

View File

@ -73,12 +73,15 @@ public class Theme {
if (Verify.equalsOne(value, defaultValue)) {
continue;
}
if (!value.contains("url")) {
replaced = replaced.replace(defaultValue, value);
} else {
if (value.contains("url")) {
String[] colorAndUrl = value.split(" ");
replaced = replaced.replace("background: " + defaultValue, "background: " + colorAndUrl[1]);
replaced = replaced.replace(defaultValue, colorAndUrl[0]);
if (colorAndUrl.length >= 2) {
replaced = replaced.replace("background: " + defaultValue, "background: " + colorAndUrl[1]);
replaced = replaced.replace(defaultValue, colorAndUrl[0]);
return replaced;
}
} else {
replaced = replaced.replace(defaultValue, value);
}
}
return replaced;

View File

@ -28,7 +28,7 @@ public enum ThemeVal {
GREEN("Colors.green", "#4CAF50"),
LIGHT_GREEN("Colors.light-green", "#8BC34A"),
LIME("Colors.lime", "#CDDC39"),
YELLOW("Colors.yellow", "#FFEB3B"),
YELLOW("Colors.yellow", "#ffe821"),
AMBER("Colors.amber", "#FFC107"),
ORANGE("Colors.orange", "#FF9800"),
DEEP_ORANGE("Colors.deep-orange", "#FF5722"),

View File

@ -22,7 +22,7 @@ Colors:
green: "#4CAF50"
light-green: "#8BC34A"
lime: "#CDDC39"
yellow: "#FFEB3B"
yellow: "#ffe821"
amber: "#FFC107"
orange: "#FF9800"
deep-orange: "#FF5722"