From 121929aa7feeac8d6b67f054e0f3f908ae6c906e Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Tue, 15 Aug 2017 14:40:36 +0300 Subject: [PATCH] Add small improvements --- .../measurementtool/MeasurementToolFragment.java | 12 +++--------- .../plus/measurementtool/MeasurementToolLayer.java | 14 +++++++------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index dfd136ff51..175091b7af 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -1045,15 +1045,9 @@ public class MeasurementToolFragment extends Fragment { MeasurementToolLayer measurementToolLayer = getMeasurementLayer(); if (measurementToolLayer != null) { measurementToolLayer.clearSelection(); - if (measurementToolLayer.isInMovePointMode()) { - measurementToolLayer.exitMovePointMode(); - } - if (measurementToolLayer.isInAddPointAfterMode()) { - measurementToolLayer.exitAddPointAfterMode(); - } - if (measurementToolLayer.isInAddPointBeforeMode()) { - measurementToolLayer.exitAddPointBeforeMode(); - } + measurementToolLayer.exitMovePointMode(); + measurementToolLayer.exitAddPointAfterMode(); + measurementToolLayer.exitAddPointBeforeMode(); } if (newGpxLine != null) { GPXFile gpx = newGpxLine.getGpxFile(); diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java index b3249d438a..0abc4cf423 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java @@ -137,7 +137,7 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL return false; } - public void clearSelection() { + void clearSelection() { selectedPointPos = -1; selectedCachedPoint = null; } @@ -158,17 +158,17 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL return false; } - public void enterMovingPointMode() { + void enterMovingPointMode() { inMovePointMode = true; moveMapToPoint(selectedPointPos); } - public void enterAddingPointAfterMode() { + void enterAddingPointAfterMode() { inAddPointAfterMode = true; moveMapToPoint(selectedPointPos); } - public void enterAddingPointBeforeMode() { + void enterAddingPointBeforeMode() { inAddPointBeforeMode = true; moveMapToPoint(selectedPointPos); } @@ -192,7 +192,7 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL } } - public void selectPoint(int position) { + void selectPoint(int position) { clearSelection(); selectedCachedPoint = new WptPt(measurementPoints.get(position)); selectedPointPos = position; @@ -305,11 +305,11 @@ public class MeasurementToolLayer extends OsmandMapLayer implements ContextMenuL inMovePointMode = false; } - public void exitAddPointAfterMode() { + void exitAddPointAfterMode() { inAddPointAfterMode = false; } - public void exitAddPointBeforeMode() { + void exitAddPointBeforeMode() { inAddPointBeforeMode = false; }