removed coordiantes from mapdatamenu

This commit is contained in:
madwasp79 2019-07-10 12:38:26 +03:00
parent 9d2538e936
commit 4fdcd2c3cb
3 changed files with 26 additions and 3 deletions

View file

@ -309,7 +309,9 @@ public class MenuBuilder {
buildPlainMenuItems(view); buildPlainMenuItems(view);
} }
buildInternal(view); buildInternal(view);
buildCoordinatesRow(view); if (needBuildCoordinatesRow()) {
buildCoordinatesRow(view);
}
if (showOnlinePhotos) { if (showOnlinePhotos) {
buildNearestPhotosRow(view); buildNearestPhotosRow(view);
} }
@ -355,6 +357,10 @@ public class MenuBuilder {
protected boolean needBuildPlainMenuItems() { protected boolean needBuildPlainMenuItems() {
return true; return true;
} }
protected boolean needBuildCoordinatesRow() {
return true;
}
protected void buildPluginRows(View view) { protected void buildPluginRows(View view) {
for (OsmandPlugin plugin : menuPlugins) { for (OsmandPlugin plugin : menuPlugins) {

View file

@ -0,0 +1,17 @@
package net.osmand.plus.mapcontextmenu.builders;
import android.support.annotation.NonNull;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.MenuBuilder;
public class MapDataMenuBuilder extends MenuBuilder {
public MapDataMenuBuilder(@NonNull MapActivity mapActivity) {
super(mapActivity);
}
@Override
protected boolean needBuildCoordinatesRow() {
return false;
}
}

View file

@ -28,8 +28,8 @@ import net.osmand.plus.download.IndexItem;
import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.plus.helpers.FileNameTranslationHelper;
import net.osmand.plus.inapp.InAppPurchaseHelper; import net.osmand.plus.inapp.InAppPurchaseHelper;
import net.osmand.plus.liveupdates.LiveUpdatesHelper; import net.osmand.plus.liveupdates.LiveUpdatesHelper;
import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController; import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.mapcontextmenu.builders.MapDataMenuBuilder;
import net.osmand.plus.srtmplugin.SRTMPlugin; import net.osmand.plus.srtmplugin.SRTMPlugin;
import net.osmand.plus.views.ContextMenuLayer.IContextMenuProvider; import net.osmand.plus.views.ContextMenuLayer.IContextMenuProvider;
import net.osmand.plus.views.DownloadedRegionsLayer.DownloadMapObject; import net.osmand.plus.views.DownloadedRegionsLayer.DownloadMapObject;
@ -57,7 +57,7 @@ public class MapDataMenuController extends MenuController {
private DownloadIndexesThread downloadThread; private DownloadIndexesThread downloadThread;
public MapDataMenuController(@NonNull MapActivity mapActivity, @NonNull PointDescription pointDescription, final @NonNull DownloadMapObject mapObject) { public MapDataMenuController(@NonNull MapActivity mapActivity, @NonNull PointDescription pointDescription, final @NonNull DownloadMapObject mapObject) {
super(new MenuBuilder(mapActivity), pointDescription, mapActivity); super(new MapDataMenuBuilder(mapActivity), pointDescription, mapActivity);
this.mapObject = mapObject; this.mapObject = mapObject;
indexItem = mapObject.getIndexItem(); indexItem = mapObject.getIndexItem();
localIndexInfo = mapObject.getLocalIndexInfo(); localIndexInfo = mapObject.getLocalIndexInfo();