diff --git a/OsmAnd/res/layout-land/map_hud_bottom.xml b/OsmAnd/res/layout-land/map_hud_bottom.xml index 28441e0016..7165a2c0c5 100644 --- a/OsmAnd/res/layout-land/map_hud_bottom.xml +++ b/OsmAnd/res/layout-land/map_hud_bottom.xml @@ -265,14 +265,14 @@ diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index ed948cdbac..630b53d7b4 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -340,6 +340,9 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven if (removeFragment(PlanRouteFragment.TAG)) { app.getMapMarkersHelper().getPlanRouteContext().setFragmentVisible(true); } + if (TrackDetailsMenu.isVisible()) { + mapLayers.getMapControlsLayer().getTrackDetailsMenu().hide(); + } removeFragment(ImportGpxBottomSheetDialogFragment.TAG); super.onSaveInstanceState(outState); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenuFragment.java index 5583ad386a..c2c3850d8b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenuFragment.java @@ -180,7 +180,7 @@ public class TrackDetailsMenuFragment extends BaseOsmAndFragment { public static boolean showInstance(final MapActivity mapActivity) { try { - boolean portrait = mapActivity.findViewById(R.id.bottomFragmentContainer) != null; + boolean portrait = AndroidUiHelper.isOrientationPortrait(mapActivity); TrackDetailsMenuFragment fragment = new TrackDetailsMenuFragment(); mapActivity.getSupportFragmentManager().beginTransaction() .add(portrait ? R.id.bottomFragmentContainer : R.id.routeMenuContainer, fragment, TAG)