diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 76e2f25588..3b3764f615 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -112,6 +112,9 @@ import net.osmand.plus.mapcontextmenu.AdditionalActionsBottomSheetDialogFragment import net.osmand.plus.mapcontextmenu.MapContextMenu; import net.osmand.plus.mapcontextmenu.MenuController.MenuState; import net.osmand.plus.mapcontextmenu.builders.cards.dialogs.ContextMenuCardDialogFragment; +import net.osmand.plus.mapcontextmenu.editors.FavoritePointEditor; +import net.osmand.plus.mapcontextmenu.editors.PointEditorFragmentNew; +import net.osmand.plus.mapcontextmenu.editors.WptPtEditor; import net.osmand.plus.mapcontextmenu.other.DestinationReachedMenu; import net.osmand.plus.mapcontextmenu.other.TrackDetailsMenu; import net.osmand.plus.mapmarkers.MapMarkersDialogFragment; @@ -700,6 +703,13 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven return; } } + + PointEditorFragmentNew pointEditorFragmentNew = getPointEditorFragmentNew(); + if (pointEditorFragmentNew != null) { + pointEditorFragmentNew.showExitDialog(); + return; + } + if (mapContextMenu.isVisible() && mapContextMenu.isClosable()) { if (mapContextMenu.getCurrentMenuState() != MenuState.HEADER_ONLY && !isLandscapeLayout()) { mapContextMenu.openMenuHeaderOnly(); @@ -2459,6 +2469,15 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven return getFragment(ImportCompleteFragment.TAG); } + public PointEditorFragmentNew getPointEditorFragmentNew() { + PointEditorFragmentNew pointEditorFragmentNew; + pointEditorFragmentNew = getFragment(FavoritePointEditor.TAG); + if (pointEditorFragmentNew == null) { + pointEditorFragmentNew = getFragment(WptPtEditor.TAG); + } + return pointEditorFragmentNew; + } + public void backToConfigureProfileFragment() { FragmentManager fragmentManager = getSupportFragmentManager(); int backStackEntryCount = fragmentManager.getBackStackEntryCount(); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java index 465053e058..4b7efa6696 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java @@ -738,7 +738,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { return getPaintedContentIcon(iconId, color); } - private void showExitDialog() { + public void showExitDialog() { hideKeyboard(); if (!wasSaved()) { AlertDialog.Builder dismissDialog = createWarningDialog(getActivity(),