This commit is contained in:
sergdevosm 2020-08-24 00:44:46 +03:00
parent 7907e72781
commit e2b8e77c1c
6 changed files with 8 additions and 8 deletions

View file

@ -525,7 +525,7 @@ public abstract class OsmandPlugin {
protected void registerLayerContextMenuActions(OsmandMapTileView mapView, ContextMenuAdapter adapter, MapActivity mapActivity) { protected void registerLayerContextMenuActions(OsmandMapTileView mapView, ContextMenuAdapter adapter, MapActivity mapActivity) {
} }
protected void registerMapContextMenuActions(MapActivity mapActivity, double latitude, double longitude, ContextMenuAdapter adapter, Object selectedObj) { protected void registerMapContextMenuActions(MapActivity mapActivity, double latitude, double longitude, ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) {
} }
protected void registerOptionsMenuItems(MapActivity mapActivity, ContextMenuAdapter helper) { protected void registerOptionsMenuItems(MapActivity mapActivity, ContextMenuAdapter helper) {
@ -791,9 +791,9 @@ public abstract class OsmandPlugin {
} }
} }
public static void registerMapContextMenu(MapActivity map, double latitude, double longitude, ContextMenuAdapter adapter, Object selectedObj) { public static void registerMapContextMenu(MapActivity map, double latitude, double longitude, ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) {
for (OsmandPlugin plugin : getEnabledPlugins()) { for (OsmandPlugin plugin : getEnabledPlugins()) {
plugin.registerMapContextMenuActions(map, latitude, longitude, adapter, selectedObj); plugin.registerMapContextMenuActions(map, latitude, longitude, adapter, selectedObj, configureMenu);
} }
} }

View file

@ -384,7 +384,7 @@ public class MapActivityActions implements DialogProvider {
.setOrder(SEARCH_NEAR_ITEM_ORDER) .setOrder(SEARCH_NEAR_ITEM_ORDER)
.createItem()); .createItem());
OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj); OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj, configureMenu);
ItemClickListener listener = new ItemClickListener() { ItemClickListener listener = new ItemClickListener() {
@Override @Override

View file

@ -659,7 +659,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
@Override @Override
public void registerMapContextMenuActions(final MapActivity mapActivity, final double latitude, final double longitude, public void registerMapContextMenuActions(final MapActivity mapActivity, final double latitude, final double longitude,
ContextMenuAdapter adapter, Object selectedObj) { ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) {
if (isRecording()) { if (isRecording()) {
return; return;
} }

View file

@ -219,7 +219,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
final double latitude, final double latitude,
final double longitude, final double longitude,
ContextMenuAdapter adapter, ContextMenuAdapter adapter,
final Object selectedObj) { final Object selectedObj, boolean configureMenu) {
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() { ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {
@Override @Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int resId, int pos, boolean isChecked, int[] viewCoordinates) { public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int resId, int pos, boolean isChecked, int[] viewCoordinates) {

View file

@ -230,7 +230,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
@Override @Override
public void registerMapContextMenuActions(final MapActivity mapActivity, public void registerMapContextMenuActions(final MapActivity mapActivity,
final double latitude, final double longitude, final double latitude, final double longitude,
ContextMenuAdapter adapter, Object selectedObj) { ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) {
ItemClickListener addListener = new ItemClickListener() { ItemClickListener addListener = new ItemClickListener() {
@Override @Override

View file

@ -400,7 +400,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
@Override @Override
public void registerMapContextMenuActions(MapActivity mapActivity, public void registerMapContextMenuActions(MapActivity mapActivity,
final double latitude, final double longitude, final double latitude, final double longitude,
ContextMenuAdapter adapter, Object selectedObj) { ContextMenuAdapter adapter, Object selectedObj, boolean configureMenu) {
final WeakReference<MapActivity> mapActivityRef = new WeakReference<>(mapActivity); final WeakReference<MapActivity> mapActivityRef = new WeakReference<>(mapActivity);
if (mapActivity.getMapView().getMainLayer() instanceof MapTileLayer) { if (mapActivity.getMapView().getMainLayer() instanceof MapTileLayer) {
ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() { ItemClickListener listener = new ContextMenuAdapter.ItemClickListener() {