Open context menu on show favorite on map action

This commit is contained in:
Alexey Kulish 2015-10-10 11:55:35 +03:00
parent 6740291a41
commit fc36e24172

View file

@ -38,6 +38,7 @@ import net.osmand.access.AccessibleActivity;
import net.osmand.access.AccessibleToast; import net.osmand.access.AccessibleToast;
import net.osmand.access.MapAccessibilityActions; import net.osmand.access.MapAccessibilityActions;
import net.osmand.core.android.AtlasMapRendererView; import net.osmand.core.android.AtlasMapRendererView;
import net.osmand.data.FavouritePoint;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
import net.osmand.data.QuadPoint; import net.osmand.data.QuadPoint;
@ -545,9 +546,13 @@ public class MapActivity extends AccessibleActivity {
} }
if (mapLabelToShow != null) { if (mapLabelToShow != null) {
mapLayers.getContextMenuLayer().setSelectedObject(toShow); mapLayers.getContextMenuLayer().setSelectedObject(toShow);
if (toShow instanceof FavouritePoint) {
mapLayers.getContextMenuLayer().showContextMenuForSelectedObjects(latLonToShow);
} else {
mapLayers.getContextMenuLayer().setLocation(latLonToShow, mapLayers.getContextMenuLayer().setLocation(latLonToShow,
mapLabelToShow.getFullPlainName(this)); mapLabelToShow.getFullPlainName(this));
} }
}
if (!latLonToShow.equals(cur)) { if (!latLonToShow.equals(cur)) {
mapView.getAnimatedDraggingThread().startMoving(latLonToShow.getLatitude(), mapView.getAnimatedDraggingThread().startMoving(latLonToShow.getLatitude(),
latLonToShow.getLongitude(), settings.getMapZoomToShow(), true); latLonToShow.getLongitude(), settings.getMapZoomToShow(), true);