From b286326aa8e2d8dd10f64c0a34d3dbe42e861007 Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Thu, 24 Jan 2019 09:22:59 +0200 Subject: [PATCH] Reverted some unneeded changes mistakenly made during bugfixing. --- .../main/java/net/osmand/util/Algorithms.java | 17 ----------------- OsmAnd/src/net/osmand/plus/GPXUtilities.java | 14 -------------- 2 files changed, 31 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java b/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java index f52a9cd855..dcf6082a7f 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java @@ -646,23 +646,6 @@ public class Algorithms { } } - public static String colorNameToString(String colorName) { - Map colorTable = new HashMap<>(); - colorTable.put("black", "#000000"); - colorTable.put("white", "#FFFFFF"); - colorTable.put("red", "#ff0000"); - colorTable.put("orange", "#ff8800"); - colorTable.put("green", "#23b03b"); - colorTable.put("blue", "#2f7af5"); - for (String key : colorTable.keySet()) { - if(colorName.toLowerCase().contains(key)) { - return colorTable.get(key); - } - } - - return "#FF0000"; - } - private static String format(int i, String hexString) { while (hexString.length() < i) { hexString = "0" + hexString; diff --git a/OsmAnd/src/net/osmand/plus/GPXUtilities.java b/OsmAnd/src/net/osmand/plus/GPXUtilities.java index 269ffcdadb..5e755f8bb0 100644 --- a/OsmAnd/src/net/osmand/plus/GPXUtilities.java +++ b/OsmAnd/src/net/osmand/plus/GPXUtilities.java @@ -99,10 +99,6 @@ public class GPXUtilities { getExtensionsToWrite().put("color", Algorithms.colorToString(color)); } - public void setColor(String colorName) { - getExtensionsToWrite().put("color", Algorithms.colorNameToString(colorName)); - } - public void removeColor() { getExtensionsToWrite().remove("color"); } @@ -1523,16 +1519,6 @@ public class GPXUtilities { ((WptPt) parse).speed = Float.parseFloat(value); } catch (NumberFormatException e) {} } - if (tag.equals("trackextension") || tag.equals("color") || tag.equals("colour") || tag.equals("displaycolor")) { - int color; - try { - color = Integer.parseInt(value); - ((GPXExtensions) parse).setColor(color); - } catch (NumberFormatException nfe) { - ((GPXExtensions) parse).setColor(value); - } - } - } } else if (parse instanceof GPXExtensions && tag.equals("extensions")) { extensionReadMode = true;