diff --git a/OsmAnd/res/layout-land/add_gpx_waypoint_bottom_sheet.xml b/OsmAnd/res/layout-land/add_gpx_waypoint_bottom_sheet.xml
new file mode 100644
index 0000000000..541d8c347f
--- /dev/null
+++ b/OsmAnd/res/layout-land/add_gpx_waypoint_bottom_sheet.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout-land/map_hud_bottom.xml b/OsmAnd/res/layout-land/map_hud_bottom.xml
index 72be926e0d..ffa987a0f6 100644
--- a/OsmAnd/res/layout-land/map_hud_bottom.xml
+++ b/OsmAnd/res/layout-land/map_hud_bottom.xml
@@ -261,4 +261,11 @@
android:layout_gravity="bottom|left"
tools:visibility="visible"/>
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/add_gpx_waypoint_bottom_sheet.xml b/OsmAnd/res/layout/add_gpx_waypoint_bottom_sheet.xml
new file mode 100644
index 0000000000..a57d63a9a5
--- /dev/null
+++ b/OsmAnd/res/layout/add_gpx_waypoint_bottom_sheet.xml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/map_hud_bottom.xml b/OsmAnd/res/layout/map_hud_bottom.xml
index 52dbd1cf8e..f82edd56e0 100644
--- a/OsmAnd/res/layout/map_hud_bottom.xml
+++ b/OsmAnd/res/layout/map_hud_bottom.xml
@@ -223,6 +223,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 59a43ea16a..03eeb868bc 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -2660,4 +2660,6 @@
Action name
You need internet to view photos from Mapillary
Retry
+ Add gpx waypoint
+ Create
diff --git a/OsmAnd/src/net/osmand/plus/GPXUtilities.java b/OsmAnd/src/net/osmand/plus/GPXUtilities.java
index c30620b199..deca20637b 100644
--- a/OsmAnd/src/net/osmand/plus/GPXUtilities.java
+++ b/OsmAnd/src/net/osmand/plus/GPXUtilities.java
@@ -102,6 +102,18 @@ public class GPXUtilities {
public float speed;
}
+ public static class NewGpxWaypoint {
+ private GPXFile gpx;
+
+ public NewGpxWaypoint(GPXFile gpx) {
+ this.gpx = gpx;
+ }
+
+ public GPXFile getGpx() {
+ return gpx;
+ }
+ }
+
public static class WptPt extends GPXExtensions implements LocationPoint {
public boolean firstPoint = false;
public boolean lastPoint = false;
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
index 5d4d1cf404..c67aaab288 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
@@ -57,6 +57,8 @@ import net.osmand.plus.AppInitializer;
import net.osmand.plus.AppInitializer.AppInitializeListener;
import net.osmand.plus.AppInitializer.InitEvents;
import net.osmand.plus.ApplicationMode;
+import net.osmand.plus.GPXUtilities;
+import net.osmand.plus.GPXUtilities.NewGpxWaypoint;
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem;
import net.osmand.plus.MapMarkersHelper.MapMarker;
import net.osmand.plus.MapMarkersHelper.MapMarkerChangedListener;
@@ -916,6 +918,9 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
} else if (toShow instanceof QuadRect) {
QuadRect qr = (QuadRect) toShow;
mapView.fitRectToMap(qr.left, qr.right, qr.top, qr.bottom, (int) qr.width(), (int) qr.height(), 0);
+ } else if (toShow instanceof NewGpxWaypoint) {
+ NewGpxWaypoint newGpxWaypoint = (NewGpxWaypoint) toShow;
+ getMapLayers().getContextMenuLayer().enterAddGpxWaypointMode(newGpxWaypoint);
} else {
mapContextMenu.show(latLonToShow, mapLabelToShow, toShow);
}
diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java
index b94efce8b5..9a2fcecd5b 100644
--- a/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java
+++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java
@@ -8,6 +8,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
+import android.support.design.widget.FloatingActionButton;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.view.ActionMode;
@@ -29,13 +30,16 @@ import android.widget.ListView;
import android.widget.TextView;
import net.osmand.AndroidUtils;
+import net.osmand.Location;
import net.osmand.data.FavouritePoint;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.GPXDatabase.GpxDataItem;
import net.osmand.plus.GPXUtilities;
+import net.osmand.plus.GPXUtilities.WptPt;
import net.osmand.plus.GPXUtilities.GPXFile;
+import net.osmand.plus.GPXUtilities.NewGpxWaypoint;
import net.osmand.plus.GpxSelectionHelper.GpxDisplayGroup;
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem;
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItemType;
@@ -89,6 +93,7 @@ public class TrackPointFragment extends OsmandExpandableListFragment {
private Set selectedGroups = new LinkedHashSet<>();
private ActionMode actionMode;
private SearchView searchView;
+ private FloatingActionButton fab;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
@@ -106,10 +111,30 @@ public class TrackPointFragment extends OsmandExpandableListFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.favorites_tree, container, false);
+ View view = inflater.inflate(R.layout.points_tree, container, false);
ExpandableListView listView = (ExpandableListView) view.findViewById(android.R.id.list);
setHasOptionsMenu(true);
+ fab = (FloatingActionButton) view.findViewById(R.id.fabButton);
+
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ final OsmandSettings settings = app.getSettings();
+ GPXFile gpx = getGpx();
+ Location location = app.getLocationProvider().getLastKnownLocation();
+ if (location != null) {
+ settings.setMapLocationToShow(location.getLatitude(), location.getLongitude(),
+ settings.getLastKnownMapZoom(),
+ new PointDescription(PointDescription.POINT_TYPE_WPT, getString(R.string.context_menu_item_add_waypoint)),
+ false,
+ new NewGpxWaypoint(gpx));
+
+ MapActivity.launchMapActivityMoveToTop(getActivity());
+ }
+ }
+ });
+
TextView tv = new TextView(getActivity());
tv.setText(R.string.none_selected_gpx);
tv.setTextSize(24);
diff --git a/OsmAnd/src/net/osmand/plus/views/AddWaypointBottomSheetHelper.java b/OsmAnd/src/net/osmand/plus/views/AddWaypointBottomSheetHelper.java
new file mode 100644
index 0000000000..27eddc58ac
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/views/AddWaypointBottomSheetHelper.java
@@ -0,0 +1,102 @@
+package net.osmand.plus.views;
+
+import android.content.Context;
+import android.graphics.PointF;
+import android.graphics.drawable.Drawable;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import net.osmand.data.LatLon;
+import net.osmand.data.PointDescription;
+import net.osmand.data.RotatedTileBox;
+import net.osmand.plus.GPXUtilities;
+import net.osmand.plus.GPXUtilities.GPXFile;
+import net.osmand.plus.GPXUtilities.NewGpxWaypoint;
+import net.osmand.plus.IconsCache;
+import net.osmand.plus.R;
+import net.osmand.plus.activities.MapActivity;
+import net.osmand.plus.mapcontextmenu.MapContextMenu;
+
+public class AddWaypointBottomSheetHelper {
+ private final View view;
+ private final TextView title;
+ private String titleText = "";
+ private final TextView description;
+ private final Context context;
+ private final MapContextMenu contextMenu;
+ private final ContextMenuLayer contextMenuLayer;
+ private boolean applyingPositionMode;
+ private NewGpxWaypoint newGpxWaypoint;
+
+ public AddWaypointBottomSheetHelper(final MapActivity activity, ContextMenuLayer ctxMenuLayer) {
+ this.contextMenuLayer = ctxMenuLayer;
+ view = activity.findViewById(R.id.add_gpx_waypoint_bottom_sheet);
+ title = (TextView) view.findViewById(R.id.add_gpx_waypoint_bottom_sheet_title);
+ description = (TextView) view.findViewById(R.id.description);
+ context = activity;
+ contextMenu = activity.getContextMenu();
+ ImageView icon = (ImageView) view.findViewById(R.id.icon);
+
+ IconsCache iconsCache = activity.getMyApplication().getIconsCache();
+ icon.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_photo_dark, R.color.marker_green));
+ view.findViewById(R.id.create_button).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ contextMenuLayer.createGpxWaypoint();
+ GPXFile gpx = newGpxWaypoint.getGpx();
+ LatLon latLon = contextMenu.getLatLon();
+ activity.getContextMenu().getWptPtPointEditor().add(gpx, latLon, titleText);
+ }
+ });
+ view.findViewById(R.id.cancel_button).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ hide();
+ contextMenuLayer.cancelAddGpxWaypoint();
+ }
+ });
+ }
+
+ public void onDraw(RotatedTileBox rt) {
+ PointF point = contextMenuLayer.getMovableCenterPoint(rt);
+ double lat = rt.getLatFromPixel(point.x, point.y);
+ double lon = rt.getLonFromPixel(point.x, point.y);
+ description.setText(PointDescription.getLocationName(context, lat, lon, true));
+ }
+
+ public void setTitle(String title) {
+ titleText = title;
+ this.title.setText(titleText);
+ }
+
+ public boolean isVisible() {
+ return view.getVisibility() == View.VISIBLE;
+ }
+
+ public void show(Drawable drawable, NewGpxWaypoint newGpxWaypoint) {
+ this.newGpxWaypoint = newGpxWaypoint;
+ exitApplyPositionMode();
+ view.setVisibility(View.VISIBLE);
+ ((ImageView) view.findViewById(R.id.icon)).setImageDrawable(drawable);
+ }
+
+ public void hide() {
+ exitApplyPositionMode();
+ view.setVisibility(View.GONE);
+ }
+
+ public void enterApplyPositionMode() {
+ if (!applyingPositionMode) {
+ applyingPositionMode = true;
+ view.findViewById(R.id.create_button).setEnabled(false);
+ }
+ }
+
+ public void exitApplyPositionMode() {
+ if (applyingPositionMode) {
+ applyingPositionMode = false;
+ view.findViewById(R.id.create_button).setEnabled(true);
+ }
+ }
+}
diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java
index 8b5a2f40fe..ccb324260f 100644
--- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java
@@ -35,6 +35,7 @@ import net.osmand.osm.PoiFilter;
import net.osmand.osm.PoiType;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuItem;
+import net.osmand.plus.GPXUtilities.NewGpxWaypoint;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MapContextMenu;
@@ -75,12 +76,14 @@ public class ContextMenuLayer extends OsmandMapLayer {
private GestureDetector movementListener;
private final MoveMarkerBottomSheetHelper mMoveMarkerBottomSheetHelper;
+ private final AddWaypointBottomSheetHelper mAddWaypointBottomSheetHelper;
private boolean mInChangeMarkerPositionMode;
private IContextMenuProvider selectedObjectContextMenuProvider;
private boolean cancelApplyingNewMarkerPosition;
private LatLon applyingMarkerLatLon;
private boolean wasCollapseButtonVisible;
private boolean mInGpxDetailsMode;
+ private boolean mInAddGpxWaypointMode;
private List publicTransportTypes;
private Object selectedObject;
@@ -91,6 +94,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
multiSelectionMenu = menu.getMultiSelectionMenu();
movementListener = new GestureDetector(activity, new MenuLayerOnGestureListener());
mMoveMarkerBottomSheetHelper = new MoveMarkerBottomSheetHelper(activity, this);
+ mAddWaypointBottomSheetHelper = new AddWaypointBottomSheetHelper(activity, this);
}
@Override
@@ -194,7 +198,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
canvas.drawBitmap(pressedBitmap, x - pressedBitmap.getWidth() / 2, y - pressedBitmap.getHeight() / 2, paint);
}
- if (mapQuickActionLayer!= null && mapQuickActionLayer.isInChangeMarkerPositionMode())
+ if (mapQuickActionLayer!= null && mapQuickActionLayer.isInMovingMarkerMode())
return;
if (mInChangeMarkerPositionMode) {
@@ -203,6 +207,10 @@ public class ContextMenuLayer extends OsmandMapLayer {
contextMarker.draw(canvas);
}
mMoveMarkerBottomSheetHelper.onDraw(box);
+ } else if (mInAddGpxWaypointMode) {
+ canvas.translate(box.getPixWidth() / 2 - contextMarker.getWidth() / 2, box.getPixHeight() / 2 - contextMarker.getHeight());
+ contextMarker.draw(canvas);
+ mAddWaypointBottomSheetHelper.onDraw(box);
} else if (menu.isActive()) {
LatLon latLon = menu.getLatLon();
int x = (int) box.getPixXFromLatLon(latLon.getLatitude(), latLon.getLongitude());
@@ -281,7 +289,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
}
public Object getMoveableObject() {
- return mInChangeMarkerPositionMode ? menu.getObject() : null;
+ return mInChangeMarkerPositionMode || mInAddGpxWaypointMode ? menu.getObject() : null;
}
public boolean isInChangeMarkerPositionMode() {
@@ -292,6 +300,10 @@ public class ContextMenuLayer extends OsmandMapLayer {
return mInGpxDetailsMode;
}
+ public boolean isInAddGpxWaypointMode() {
+ return mInAddGpxWaypointMode;
+ }
+
public boolean isObjectMoveable(Object o) {
if (o == null) {
return true;
@@ -313,7 +325,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
l.applyNewObjectPosition(o, position, callback);
}
}
- } else if (mInChangeMarkerPositionMode) {
+ } else if (mInChangeMarkerPositionMode || mInAddGpxWaypointMode) {
callback.onApplyMovedObject(true, null);
}
}
@@ -357,6 +369,45 @@ public class ContextMenuLayer extends OsmandMapLayer {
});
}
+ public void createGpxWaypoint() {
+ if (!mInAddGpxWaypointMode) {
+ throw new IllegalStateException("Not in add gpx waypoint mode");
+ }
+
+ RotatedTileBox tileBox = activity.getMapView().getCurrentRotatedTileBox();
+ PointF newMarkerPosition = getMovableCenterPoint(tileBox);
+ final LatLon ll = tileBox.getLatLonFromPixel(newMarkerPosition.x, newMarkerPosition.y);
+ applyingMarkerLatLon = ll;
+
+ Object obj = getMoveableObject();
+ cancelApplyingNewMarkerPosition = false;
+ mAddWaypointBottomSheetHelper.enterApplyPositionMode();
+ applyMovedObject(obj, ll, new ApplyMovedObjectCallback() {
+ @Override
+ public void onApplyMovedObject(boolean success, @Nullable Object newObject) {
+ mAddWaypointBottomSheetHelper.exitApplyPositionMode();
+ if (success && !cancelApplyingNewMarkerPosition) {
+ mAddWaypointBottomSheetHelper.hide();
+ quitAddGpxWaipoint();
+
+ PointDescription pointDescription = null;
+ if (selectedObjectContextMenuProvider != null) {
+ pointDescription = selectedObjectContextMenuProvider.getObjectName(newObject);
+ }
+ menu.show(ll, pointDescription, newObject);
+ view.refreshMap();
+ }
+ selectedObjectContextMenuProvider = null;
+ applyingMarkerLatLon = null;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancelApplyingNewMarkerPosition;
+ }
+ });
+ }
+
public void enterGpxDetailsMode() {
menu.updateMapCenter(null);
menu.hide();
@@ -398,6 +449,39 @@ public class ContextMenuLayer extends OsmandMapLayer {
}
}
+ private void quitAddGpxWaipoint() {
+ mInAddGpxWaypointMode = false;
+ mark(View.VISIBLE, R.id.map_ruler_layout,
+ R.id.map_left_widgets_panel, R.id.map_right_widgets_panel, R.id.map_center_info);
+
+ View collapseButton = activity.findViewById(R.id.map_collapse_button);
+ if (collapseButton != null && wasCollapseButtonVisible) {
+ collapseButton.setVisibility(View.VISIBLE);
+ }
+ }
+
+ public void enterAddGpxWaypointMode(NewGpxWaypoint newGpxWaypoint) {
+ menu.updateMapCenter(null);
+ menu.hide();
+
+ activity.disableDrawer();
+
+ mInAddGpxWaypointMode = true;
+ mAddWaypointBottomSheetHelper.show(menu.getLeftIcon(), newGpxWaypoint);
+ mark(View.INVISIBLE, R.id.map_ruler_layout,
+ R.id.map_left_widgets_panel, R.id.map_right_widgets_panel, R.id.map_center_info);
+
+ View collapseButton = activity.findViewById(R.id.map_collapse_button);
+ if (collapseButton != null && collapseButton.getVisibility() == View.VISIBLE) {
+ wasCollapseButtonVisible = true;
+ collapseButton.setVisibility(View.INVISIBLE);
+ } else {
+ wasCollapseButtonVisible = false;
+ }
+
+ view.refreshMap();
+ }
+
private void enterMovingMode(RotatedTileBox tileBox) {
Vibrator vibrator = (Vibrator) activity.getSystemService(Context.VIBRATOR_SERVICE);
vibrator.vibrate(VIBRATE_SHORT);
@@ -445,6 +529,13 @@ public class ContextMenuLayer extends OsmandMapLayer {
applyingMarkerLatLon = null;
}
+ public void cancelAddGpxWaypoint() {
+ cancelApplyingNewMarkerPosition = true;
+ quitAddGpxWaipoint();
+ activity.getContextMenu().show();
+ applyingMarkerLatLon = null;
+ }
+
public boolean showContextMenu(double latitude, double longitude, boolean showUnknownLocation) {
RotatedTileBox cp = activity.getMapView().getCurrentRotatedTileBox();
float x = cp.getPixXFromLatLon(latitude, longitude);
@@ -550,7 +641,14 @@ public class ContextMenuLayer extends OsmandMapLayer {
if (latLon == null) {
latLon = getLatLon(point, tileBox);
}
- showContextMenu(latLon, pointDescription, selectedObj, provider);
+ if (mInAddGpxWaypointMode) {
+ if (pointDescription != null) {
+ mAddWaypointBottomSheetHelper.setTitle(pointDescription.getName());
+ }
+ view.getAnimatedDraggingThread().startMoving(latLon.getLatitude(), latLon.getLongitude(), view.getZoom(), true);
+ } else {
+ showContextMenu(latLon, pointDescription, selectedObj, provider);
+ }
return true;
} else if (selectedObjects.size() > 1) {
@@ -592,7 +690,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
}
public boolean disableLongPressOnMap() {
- if (mInChangeMarkerPositionMode || mInGpxDetailsMode) {
+ if (mInChangeMarkerPositionMode || mInGpxDetailsMode || mInAddGpxWaypointMode) {
return true;
}
boolean res = false;
diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
index d22e7d65e8..8c7dc0d5de 100644
--- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
@@ -712,7 +712,7 @@ public class MapControlsLayer extends OsmandMapLayer {
((app.accessibilityEnabled() || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS)) && routeFollowingMode);
updateMyLocation(rh, routeDialogOpened || trackDialogOpened);
boolean showButtons = (showRouteCalculationControls || !routeFollowingMode)
- && !isInChangeMarkerPositionMode() && !isInGpxDetailsMode() && !isInMeasurementToolMode();
+ && !isInMovingMarkerMode() && !isInGpxDetailsMode() && !isInMeasurementToolMode();
//routePlanningBtn.setIconResId(routeFollowingMode ? R.drawable.ic_action_gabout_dark : R.drawable.map_directions);
if (rh.isFollowingMode()) {
routePlanningBtn.setIconResId(R.drawable.map_start_navigation);
@@ -1119,9 +1119,9 @@ public class MapControlsLayer extends OsmandMapLayer {
this.mapQuickActionLayer = mapQuickActionLayer;
}
- private boolean isInChangeMarkerPositionMode(){
- return mapQuickActionLayer == null ? contextMenuLayer.isInChangeMarkerPositionMode() :
- mapQuickActionLayer.isInChangeMarkerPositionMode() || contextMenuLayer.isInChangeMarkerPositionMode();
+ private boolean isInMovingMarkerMode(){
+ return mapQuickActionLayer == null ? contextMenuLayer.isInChangeMarkerPositionMode() || contextMenuLayer.isInAddGpxWaypointMode():
+ mapQuickActionLayer.isInMovingMarkerMode() || contextMenuLayer.isInChangeMarkerPositionMode() || contextMenuLayer.isInAddGpxWaypointMode();
}
private boolean isInGpxDetailsMode() {
diff --git a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java
index 2f3dbfc21b..c5365d41ff 100644
--- a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java
@@ -54,7 +54,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
private boolean wasCollapseButtonVisible;
private int previousMapPosition;
- private boolean inChangeMarkerPositionMode;
+ private boolean inMovingMarkerMode;
private boolean isLayerOn;
private boolean nightMode;
@@ -236,7 +236,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
double lon = rb.getLonFromPixel(tileBox.getCenterPixelX(), tileBox.getCenterPixelY());
view.setLatLon(lat, lon);
- inChangeMarkerPositionMode = true;
+ inMovingMarkerMode = true;
mark(View.INVISIBLE, R.id.map_ruler_layout,
R.id.map_left_widgets_panel, R.id.map_right_widgets_panel, R.id.map_center_info);
@@ -271,7 +271,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
}
view.setMapPosition(previousMapPosition);
- inChangeMarkerPositionMode = false;
+ inMovingMarkerMode = false;
mark(View.VISIBLE, R.id.map_ruler_layout,
R.id.map_left_widgets_panel, R.id.map_right_widgets_panel, R.id.map_center_info);
@@ -293,7 +293,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
@Override
public boolean onSingleTap(PointF point, RotatedTileBox tileBox) {
- if (isInChangeMarkerPositionMode() && !pressedQuickActionWidget(point.x, point.y)) {
+ if (isInMovingMarkerMode() && !pressedQuickActionWidget(point.x, point.y)) {
setLayerState(false);
return true;
} else
@@ -307,7 +307,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
@Override
public void onDraw(Canvas canvas, RotatedTileBox box, DrawSettings settings) {
boolean nightMode = settings != null && settings.isNightMode();
- if (isInChangeMarkerPositionMode()) {
+ if (isInMovingMarkerMode()) {
canvas.translate(box.getCenterPixelX() - contextMarker.getWidth() / 2, box.getCenterPixelY() - contextMarker.getHeight());
contextMarker.draw(canvas);
}
@@ -356,8 +356,8 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
return new PointF(tb.getPixWidth() / 2, tb.getPixHeight() / 2);
}
- public boolean isInChangeMarkerPositionMode() {
- return isLayerOn && inChangeMarkerPositionMode;
+ public boolean isInMovingMarkerMode() {
+ return isLayerOn && inMovingMarkerMode;
}
public boolean isLayerOn() {