Merge pull request #5077 from osmandapp/FixedBugParkingContextMenu
fixed bug in parking context menu
This commit is contained in:
commit
d1c16c607c
1 changed files with 4 additions and 3 deletions
|
@ -268,7 +268,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
||||||
}
|
}
|
||||||
addOrRemoveParkingEvent(false);
|
addOrRemoveParkingEvent(false);
|
||||||
setParkingPosition(mapActivity, latitude, longitude, false);
|
setParkingPosition(mapActivity, latitude, longitude, false);
|
||||||
showContextMenuIfNeeded(mapActivity);
|
showContextMenuIfNeeded(mapActivity,true);
|
||||||
mapActivity.getMapView().refreshMap();
|
mapActivity.getMapView().refreshMap();
|
||||||
} else if (index == 2) {
|
} else if (index == 2) {
|
||||||
if (wasEventPreviouslyAdded) {
|
if (wasEventPreviouslyAdded) {
|
||||||
|
@ -284,10 +284,11 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
||||||
builder.create().show();
|
builder.create().show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showContextMenuIfNeeded(final MapActivity mapActivity) {
|
private void showContextMenuIfNeeded(final MapActivity mapActivity, boolean animated) {
|
||||||
if (parkingLayer != null) {
|
if (parkingLayer != null) {
|
||||||
MapContextMenu menu = mapActivity.getContextMenu();
|
MapContextMenu menu = mapActivity.getContextMenu();
|
||||||
if (menu.isVisible()) {
|
if (menu.isVisible()) {
|
||||||
|
menu.hide(animated);
|
||||||
menu.show(new LatLon(parkingPosition.getLatitude(), parkingPosition.getLongitude()),
|
menu.show(new LatLon(parkingPosition.getLatitude(), parkingPosition.getLongitude()),
|
||||||
parkingLayer.getObjectName(parkingPosition), parkingPosition);
|
parkingLayer.getObjectName(parkingPosition), parkingPosition);
|
||||||
}
|
}
|
||||||
|
@ -388,7 +389,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
||||||
} else {
|
} else {
|
||||||
addOrRemoveParkingEvent(false);
|
addOrRemoveParkingEvent(false);
|
||||||
}
|
}
|
||||||
showContextMenuIfNeeded(mapActivity);
|
showContextMenuIfNeeded(mapActivity,false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setTime.create();
|
setTime.create();
|
||||||
|
|
Loading…
Reference in a new issue