From dc6db87d9f1e7fb1a1ce3fd8d1a38a0a4a3f38fd Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Fri, 18 Jan 2019 13:07:28 +0200 Subject: [PATCH 01/10] Bugfixes (Now imports Points data from MapsMe's kml/kmz), relative to #6376 --- .../src/net/osmand/plus/helpers/kml2gpx.xslt | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/helpers/kml2gpx.xslt b/OsmAnd/src/net/osmand/plus/helpers/kml2gpx.xslt index 2d5b32048a..9380d6918f 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/kml2gpx.xslt +++ b/OsmAnd/src/net/osmand/plus/helpers/kml2gpx.xslt @@ -66,6 +66,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 7461d825d66b1da89b5de529ce5ac3bb2fcbc9d3 Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Fri, 18 Jan 2019 17:20:06 +0200 Subject: [PATCH 02/10] Bugfixes ('Sort by name' does not work) #6286 - fixed --- .../osmand/plus/activities/FavoritesListFragment.java | 9 ++++----- OsmAnd/src/net/osmand/plus/dialogs/FavoriteDialogs.java | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesListFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesListFragment.java index 27fc4c3907..c65e7296a5 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavoritesListFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesListFragment.java @@ -270,15 +270,14 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA } - - public void sortByDefault() { + public void sortByDefault(boolean isSortedByDistance) { Location loc = app.getLocationProvider().getLastStaleKnownLocation(); LatLon map = app.getMapViewTrackingUtilities().getMapLocation(); - if (loc != null) { + if (loc != null && isSortedByDistance) { sortByDistance(new LatLon(loc.getLatitude(), loc.getLongitude())); - } else if(map != null){ + } else if (map != null && isSortedByDistance){ sortByDistance(map); - } else{ + } else { sortByName(); } } diff --git a/OsmAnd/src/net/osmand/plus/dialogs/FavoriteDialogs.java b/OsmAnd/src/net/osmand/plus/dialogs/FavoriteDialogs.java index df55ef2332..0f783844ac 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/FavoriteDialogs.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/FavoriteDialogs.java @@ -55,7 +55,7 @@ public class FavoriteDialogs { } }; - favouritesAdapter.sortByDefault(); + favouritesAdapter.sortByDefault(true); if(points.size() == 0){ Toast.makeText(activity, activity.getString(R.string.fav_points_not_exist), Toast.LENGTH_SHORT).show(); @@ -208,7 +208,7 @@ public class FavoriteDialogs { final OnDismissListener dismissListener, final Dialog[] dialogHolder, final boolean sortByDist) { ListView listView = new ListView(uiContext); AlertDialog.Builder bld = new AlertDialog.Builder(uiContext); - favouritesAdapter.sortByDefault(); + favouritesAdapter.sortByDefault(sortByDist); listView.setAdapter(favouritesAdapter); listView.setOnItemClickListener(click); bld.setPositiveButton(sortByDist ? R.string.sort_by_name : From 6f6cccf3b5e17904eda5d38f205e13c9a654ac10 Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Mon, 21 Jan 2019 09:59:10 +0200 Subject: [PATCH 03/10] Bugfixes (Importing favourites deletes ALL existing favs) #6384 - fixed --- OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java | 1 - 1 file changed, 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java b/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java index 0b76162d07..b162a9b1fe 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java @@ -261,7 +261,6 @@ public class ImportHelper { final List favourites = asFavourites(gpxFile.getPoints(), fileName, forceImportFavourites); final FavouritesDbHelper favoritesHelper = app.getFavorites(); for (final FavouritePoint favourite : favourites) { - favoritesHelper.deleteFavourite(favourite, false); favoritesHelper.addFavourite(favourite, false); } favoritesHelper.sortAll(); From be33d0cfc80b5c62611e183bc0236aad875a72da Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Mon, 21 Jan 2019 10:35:53 +0200 Subject: [PATCH 04/10] Bugfixes (Ruler is not shown in landscape mode during route preparation) #6454 - fixed --- .../osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java index 0edd5072d6..163c41fd1d 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java @@ -1180,8 +1180,6 @@ public class RouteInfoWidgetsFactory { // update cache if (view.isZooming()) { visible = false; - } else if (!orientationPortrait && ma.getRoutingHelper().isRoutePlanningMode()) { - visible = false; } else if (!tb.isZoomAnimated() && (tb.getZoom() != cacheRulerZoom || Math.abs(tb.getCenterTileX() - cacheRulerTileX) > 1 || Math .abs(tb.getCenterTileY() - cacheRulerTileY) > 1 || mapDensity.get() != cacheMapDensity) && tb.getPixWidth() > 0 && maxWidth > 0) { From dd58cac8315c6d1cb90c0b59b53bd7ef8f97b1db Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Mon, 21 Jan 2019 13:07:59 +0200 Subject: [PATCH 05/10] Bugfixes (Crash on startup) #6332- fixed --- OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java | 5 ++++- .../osmand/plus/mapcontextmenu/MapContextMenuFragment.java | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index 596501d99e..9aacc10a4a 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -1399,7 +1399,10 @@ public class ConfigureMapMenu { public static int parseTrackColor(RenderingRulesStorage renderer, String colorName) { int defaultColor = -1; - RenderingRule gpxRule = renderer.getRenderingAttributeRule("gpx"); + RenderingRule gpxRule = null; + if(renderer!=null) { + gpxRule = renderer.getRenderingAttributeRule("gpx"); + } if (gpxRule != null && gpxRule.getIfElseChildren().size() > 0) { List rules = renderer.getRenderingAttributeRule("gpx").getIfElseChildren().get(0).getIfElseChildren(); for (RenderingRule r : rules) { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 27ed59879e..262373d20d 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -889,7 +889,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo boolean needMapAdjust = currentMenuState != newMenuState && newMenuState != MenuState.FULL_SCREEN; if (newMenuState != currentMenuState) { - restoreCustomMapRatio(); + //restoreCustomMapRatio(); menu.updateControlsVisibility(true); doBeforeMenuStateChange(currentMenuState, newMenuState); toggleDetailsHideButton(); @@ -899,6 +899,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo } private void restoreCustomMapRatio() { + //do we need this? setCustomRatio never used, so what we restoring? if (map != null && map.hasCustomMapRatio()) { map.restoreMapRatio(); } @@ -1245,7 +1246,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo @Override public void onPause() { - restoreCustomMapRatio(); + //restoreCustomMapRatio(); if (view != null) { ViewParent parent = view.getParent(); From 2d9fbc9ad69d83846d2eaee5be466f92842a6082 Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Mon, 21 Jan 2019 17:59:09 +0200 Subject: [PATCH 06/10] Feature request: retain the original color coding when importing GPX #6386 - in progress --- .../main/java/net/osmand/util/Algorithms.java | 17 +++++++++++++++++ OsmAnd/src/net/osmand/plus/GPXUtilities.java | 18 +++++++++++++++--- .../net/osmand/plus/helpers/ImportHelper.java | 1 + 3 files changed, 33 insertions(+), 3 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 dcf6082a7f..f52a9cd855 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/Algorithms.java @@ -646,6 +646,23 @@ 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 166aa89fce..269ffcdadb 100644 --- a/OsmAnd/src/net/osmand/plus/GPXUtilities.java +++ b/OsmAnd/src/net/osmand/plus/GPXUtilities.java @@ -99,6 +99,10 @@ 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"); } @@ -1510,18 +1514,26 @@ public class GPXUtilities { if (tok == XmlPullParser.START_TAG) { Object parse = parserState.peek(); String tag = parser.getName(); - if (extensionReadMode && parse instanceof GPXExtensions) { + if (extensionReadMode && parse != null) { String value = readText(parser, tag); if (value != null) { ((GPXExtensions) parse).getExtensionsToWrite().put(tag.toLowerCase(), value); if (tag.equals("speed") && parse instanceof WptPt) { try { ((WptPt) parse).speed = Float.parseFloat(value); - } catch (NumberFormatException e) { + } 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; } else { diff --git a/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java b/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java index b162a9b1fe..0b76162d07 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java @@ -261,6 +261,7 @@ public class ImportHelper { final List favourites = asFavourites(gpxFile.getPoints(), fileName, forceImportFavourites); final FavouritesDbHelper favoritesHelper = app.getFavorites(); for (final FavouritePoint favourite : favourites) { + favoritesHelper.deleteFavourite(favourite, false); favoritesHelper.addFavourite(favourite, false); } favoritesHelper.sortAll(); From 5c94138b93b0efbc9b65e714e1f14b5b60c53e16 Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Wed, 23 Jan 2019 10:03:17 +0200 Subject: [PATCH 07/10] Bugfixes (Crash on startup) - clean up - #6332 --- .../net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java | 1 - 1 file changed, 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 262373d20d..614321525a 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -899,7 +899,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo } private void restoreCustomMapRatio() { - //do we need this? setCustomRatio never used, so what we restoring? if (map != null && map.hasCustomMapRatio()) { map.restoreMapRatio(); } From 713a3b9d4bf84abb94cfc09c22fc411e3bd779c5 Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Wed, 23 Jan 2019 17:46:21 +0200 Subject: [PATCH 08/10] Feature request (Quick action: Day/night mode #6330 ) --- OsmAnd/res/values/strings.xml | 4 + .../plus/quickaction/QuickActionFactory.java | 17 +++++ .../actions/DayNightModeAction.java | 76 +++++++++++++++++++ .../plus/views/MapQuickActionLayer.java | 2 +- 4 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 OsmAnd/src/net/osmand/plus/quickaction/actions/DayNightModeAction.java diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 47e5cf8f0c..9612030b0e 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -2886,6 +2886,10 @@ Tapping this action button adds a POI in the middle of the screen. Tapping this action button disables or enables voice guidance during navigation. Tapping this action button adds a parking location in the middle of the screen. + Tapping this action button switch between Day and Night modes for OsmAnd + Day Mode + Night Mode + Switch Day/Night mode Show an interim dialog " is saved to " Place diff --git a/OsmAnd/src/net/osmand/plus/quickaction/QuickActionFactory.java b/OsmAnd/src/net/osmand/plus/quickaction/QuickActionFactory.java index dfcf8551c0..8620092f04 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/QuickActionFactory.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/QuickActionFactory.java @@ -35,6 +35,7 @@ import net.osmand.plus.quickaction.actions.NewAction; import net.osmand.plus.quickaction.actions.ShowHideFavoritesAction; import net.osmand.plus.quickaction.actions.ShowHideOSMBugAction; import net.osmand.plus.quickaction.actions.ShowHidePoiAction; +import net.osmand.plus.quickaction.actions.DayNightModeAction; import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin; import java.lang.reflect.Type; @@ -116,6 +117,9 @@ public class QuickActionFactory { quickActions.add(new MapUnderlayAction()); } + quickActions.add(new DayNightModeAction()); + + QuickAction voice = new NavVoiceAction(); QuickAction addDestination = new NavAddDestinationAction(); QuickAction addFirstIntermediate = new NavAddFirstIntermediateAction(); @@ -232,6 +236,9 @@ public class QuickActionFactory { case NavResumePauseAction.TYPE: return new NavResumePauseAction(); + case DayNightModeAction.TYPE: + return new DayNightModeAction(); + default: return new QuickAction(); } @@ -313,6 +320,9 @@ public class QuickActionFactory { case NavResumePauseAction.TYPE: return new NavResumePauseAction(quickAction); + case DayNightModeAction.TYPE: + return new DayNightModeAction(quickAction); + default: return quickAction; } @@ -394,6 +404,9 @@ public class QuickActionFactory { case NavResumePauseAction.TYPE: return R.drawable.ic_play_dark; + case DayNightModeAction.TYPE: + return R.drawable.ic_action_map_day; + default: return R.drawable.ic_action_plus; } @@ -457,6 +470,9 @@ public class QuickActionFactory { case MapUnderlayAction.TYPE: return R.string.quick_action_map_underlay; + case DayNightModeAction.TYPE: + return R.string.quick_action_day_night_switch_mode; + case NavAddDestinationAction.TYPE: return R.string.quick_action_add_destination; @@ -500,6 +516,7 @@ public class QuickActionFactory { case ShowHideOSMBugAction.TYPE: case NavStartStopAction.TYPE: case NavResumePauseAction.TYPE: + case DayNightModeAction.TYPE: return false; default: diff --git a/OsmAnd/src/net/osmand/plus/quickaction/actions/DayNightModeAction.java b/OsmAnd/src/net/osmand/plus/quickaction/actions/DayNightModeAction.java new file mode 100644 index 0000000000..4441573263 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/quickaction/actions/DayNightModeAction.java @@ -0,0 +1,76 @@ +package net.osmand.plus.quickaction.actions; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.OsmandSettings; +import net.osmand.plus.R; +import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.quickaction.QuickAction; + +public class DayNightModeAction extends QuickAction { + public static final int TYPE = 27; + + public DayNightModeAction() {super(TYPE);} + + public DayNightModeAction(QuickAction quickAction) {super(quickAction);} + + @Override + public void execute(MapActivity activity) { + switch (activity.getMyApplication().getSettings().DAYNIGHT_MODE.get()){ + case DAY: { + activity.getMyApplication().getSettings().DAYNIGHT_MODE.set(OsmandSettings.DayNightMode.NIGHT); + break; + } + case NIGHT: { + activity.getMyApplication().getSettings().DAYNIGHT_MODE.set(OsmandSettings.DayNightMode.DAY); + break; + } + case AUTO: { + activity.getMyApplication().getSettings().DAYNIGHT_MODE.set(OsmandSettings.DayNightMode.DAY); + break; + } + case SENSOR: { + activity.getMyApplication().getSettings().DAYNIGHT_MODE.set(OsmandSettings.DayNightMode.DAY); + break; + } + } + } + + @Override + public void drawUI(ViewGroup parent, MapActivity activity) { + View view = LayoutInflater.from(parent.getContext()) + .inflate(R.layout.quick_action_with_text, parent, false); + + ((TextView) view.findViewById(R.id.text)) + .setText(R.string.quick_action_switch_day_night_descr); + + parent.addView(view); + } + + @Override + public int getIconRes(Context context) { + if(context instanceof MapActivity) { + switch (((MapActivity) context).getMyApplication().getSettings().DAYNIGHT_MODE.get()) { + case NIGHT: { + return R.drawable.ic_action_map_night; + } + case AUTO: { + return R.drawable.ic_action_map_sunst; + } + case SENSOR: { + return R.drawable.ic_action_map_light_sensor; + } + } + } + return R.drawable.ic_action_map_day; + } + + @Override + public String getActionText(OsmandApplication application) { + return application.getSettings().DAYNIGHT_MODE.get().toHumanString(application) + " Mode"; + } +} diff --git a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java index 69a64a7687..521a72a120 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java @@ -420,8 +420,8 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe @Override public void onActionSelected(QuickAction action) { - QuickActionFactory.produceAction(action).execute(mapActivity); setLayerState(false); + QuickActionFactory.produceAction(action).execute(mapActivity); } public PointF getMovableCenterPoint(RotatedTileBox tb) { From b286326aa8e2d8dd10f64c0a34d3dbe42e861007 Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Thu, 24 Jan 2019 09:22:59 +0200 Subject: [PATCH 09/10] 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; From 69aaa17caef77f2eac6b390319d4c832826fef6d Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Thu, 24 Jan 2019 11:35:07 +0200 Subject: [PATCH 10/10] pull request's clean up --- .../net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 614321525a..acf986a1c3 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -889,7 +889,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo boolean needMapAdjust = currentMenuState != newMenuState && newMenuState != MenuState.FULL_SCREEN; if (newMenuState != currentMenuState) { - //restoreCustomMapRatio(); menu.updateControlsVisibility(true); doBeforeMenuStateChange(currentMenuState, newMenuState); toggleDetailsHideButton(); @@ -1245,7 +1244,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo @Override public void onPause() { - //restoreCustomMapRatio(); if (view != null) { ViewParent parent = view.getParent();