diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml
index a5afeda640..ad32bfe78b 100644
--- a/OsmAnd/res/values/sizes.xml
+++ b/OsmAnd/res/values/sizes.xml
@@ -36,6 +36,7 @@
360dp
56dp
78dp
+ 15dp
2dp
15dp
diff --git a/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java
index ad5a230adb..935ccb021e 100644
--- a/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java
+++ b/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java
@@ -141,6 +141,10 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
return getResources().getDimensionPixelSize(R.dimen.dashboard_land_width);
}
+ public int getLandscapeNoShadowWidth() {
+ return getLandscapeWidth() - getResources().getDimensionPixelSize(R.dimen.dashboard_land_shadow_width);
+ }
+
public abstract int getToolbarHeight();
public boolean isSingleFragment() {
@@ -266,8 +270,10 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
final TypedValue typedValueAttr = new TypedValue();
mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true);
mainView.setBackgroundResource(typedValueAttr.resourceId);
+ mainView.setLayoutParams(new FrameLayout.LayoutParams(getLandscapeWidth(), ViewGroup.LayoutParams.MATCH_PARENT));
+ } else {
+ mainView.setLayoutParams(new FrameLayout.LayoutParams(getLandscapeNoShadowWidth(), ViewGroup.LayoutParams.MATCH_PARENT));
}
- mainView.setLayoutParams(new FrameLayout.LayoutParams(getLandscapeWidth(), ViewGroup.LayoutParams.MATCH_PARENT));
}
processScreenHeight(container);
diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java
index adf81a02f2..48f31a5de0 100644
--- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java
+++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java
@@ -124,7 +124,8 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
this.viewPager = viewPager;
if (!portrait) {
initialMenuState = MenuState.FULL_SCREEN;
- solidToolbarView.setLayoutParams(new FrameLayout.LayoutParams(AndroidUtils.dpToPx(mapActivity, 345f), ViewGroup.LayoutParams.WRAP_CONTENT));
+ int width = getResources().getDimensionPixelSize(R.dimen.dashboard_land_width) - getResources().getDimensionPixelSize(R.dimen.dashboard_land_shadow_width);
+ solidToolbarView.setLayoutParams(new FrameLayout.LayoutParams(width, ViewGroup.LayoutParams.WRAP_CONTENT));
solidToolbarView.setVisibility(View.VISIBLE);
final TypedValue typedValueAttr = new TypedValue();
mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true);
diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java
index 3a59fa0b88..6aa3d83fef 100644
--- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java
+++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java
@@ -68,11 +68,6 @@ public class MapRouteInfoMenuFragment extends ContextMenuFragment {
return true;
}
- @Override
- public int getLandscapeWidth() {
- return getResources().getDimensionPixelSize(R.dimen.dashboard_land_width);
- }
-
@Override
public int getToolbarHeight() {
return 0;
@@ -136,7 +131,7 @@ public class MapRouteInfoMenuFragment extends ContextMenuFragment {
if (!isPortrait()) {
view.findViewById(R.id.app_modes_fold_container).setVisibility(View.GONE);
- int widthNoShadow = AndroidUtils.dpToPx(mapActivity, 345f);
+ int widthNoShadow = getLandscapeNoShadowWidth();
modesLayoutToolbar.setLayoutParams(new FrameLayout.LayoutParams(widthNoShadow, ViewGroup.LayoutParams.WRAP_CONTENT));
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(widthNoShadow, ViewGroup.LayoutParams.WRAP_CONTENT);
params.gravity = Gravity.BOTTOM;
diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java
index 5e1f52af77..6fedabd32c 100644
--- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java
@@ -100,7 +100,6 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
private String destinationStreetStr = "";
private int pageMarginPx;
private int toolbarHeightPx;
- private int landscapeWidthPx;
private GPXFile gpx;
@Nullable
@@ -137,11 +136,6 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
return false;
}
- @Override
- public int getLandscapeWidth() {
- return landscapeWidthPx;
- }
-
public int getRouteId() {
return routeId;
}
@@ -155,7 +149,6 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
}
pageMarginPx = dpToPx(PAGE_MARGIN);
toolbarHeightPx = getResources().getDimensionPixelSize(R.dimen.dashboard_map_toolbar);
- landscapeWidthPx = dpToPx(345f);
View view = super.onCreateView(inflater, container, savedInstanceState);
if (view != null) {
diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/WaypointsFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/WaypointsFragment.java
index 13bb98238d..3d1fb1ac8d 100644
--- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/WaypointsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/WaypointsFragment.java
@@ -159,8 +159,8 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
mapActivity.getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true);
mainView.setBackgroundResource(typedValueAttr.resourceId);
mainView.setLayoutParams(new FrameLayout.LayoutParams(getResources().getDimensionPixelSize(R.dimen.dashboard_land_width), ViewGroup.LayoutParams.MATCH_PARENT));
-
- FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(AndroidUtils.dpToPx(app, 345f), ViewGroup.LayoutParams.WRAP_CONTENT);
+ int width = getResources().getDimensionPixelSize(R.dimen.dashboard_land_width) - getResources().getDimensionPixelSize(R.dimen.dashboard_land_shadow_width);
+ FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(width, ViewGroup.LayoutParams.WRAP_CONTENT);
params.gravity = Gravity.BOTTOM;
view.findViewById(R.id.control_buttons).setLayoutParams(params);