diff --git a/OsmAnd/res/layout-land/menu_obj_selection_fragment.xml b/OsmAnd/res/layout-land/menu_obj_selection_fragment.xml index bb2fe17cab..854dac8947 100644 --- a/OsmAnd/res/layout-land/menu_obj_selection_fragment.xml +++ b/OsmAnd/res/layout-land/menu_obj_selection_fragment.xml @@ -2,7 +2,7 @@ @@ -65,7 +65,7 @@ android:layout_marginTop="2dp" android:layout_marginLeft="12dp" android:layout_marginStart="12dp" - android:scaleType="center" + android:scaleType="centerInside" android:src="@drawable/ic_action_building_number"/> @@ -122,7 +122,7 @@ android:layout_marginTop="2dp" android:layout_marginLeft="12dp" android:layout_marginStart="12dp" - android:scaleType="center" + android:scaleType="centerInside" android:src="@drawable/ic_action_building_number"/> diff --git a/OsmAnd/res/layout/dashboard_toolbar.xml b/OsmAnd/res/layout/dashboard_toolbar.xml index bf7aea1728..b3cb7f2280 100644 --- a/OsmAnd/res/layout/dashboard_toolbar.xml +++ b/OsmAnd/res/layout/dashboard_toolbar.xml @@ -14,7 +14,7 @@ android:id="@+id/toolbar_back" android:contentDescription="@string/back_to_map" android:layout_width="@dimen/list_item_height" - android:layout_height="@dimen/list_item_height" + android:layout_height="match_parent" android:layout_gravity="left" android:background="@drawable/dashboard_button_light" android:scaleType="center" @@ -25,17 +25,18 @@ android:id="@+id/toolbar_list" android:contentDescription="@string/backToMenu" android:layout_width="@dimen/list_item_height" - android:layout_height="@dimen/list_item_height" + android:layout_height="match_parent" android:layout_gravity="left" android:background="@drawable/dashboard_button_light" android:scaleType="center" - android:src="@drawable/ic_navigation_drawer"/> + android:src="@drawable/ic_navigation_drawer" + tools:visibility="gone"/> + tools:visibility="visible"/> @@ -130,7 +130,7 @@ android:layout_marginLeft="12dp" android:layout_marginStart="12dp" android:layout_marginTop="2dp" - android:scaleType="center" + android:scaleType="centerInside" android:src="@drawable/ic_action_building_number"/> diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteRecordingMenu.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteRecordingMenu.java index c0c909cdf9..0386a0dc72 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteRecordingMenu.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteRecordingMenu.java @@ -30,7 +30,6 @@ public class AudioVideoNoteRecordingMenu { protected long startTime; protected Handler handler; protected boolean portraitMode; - protected boolean largeDevice; protected Timer recTimer; protected double lat; @@ -50,7 +49,6 @@ public class AudioVideoNoteRecordingMenu { MapActivity mapActivity = plugin.getMapActivity(); portraitMode = AndroidUiHelper.isOrientationPortrait(mapActivity); - largeDevice = AndroidUiHelper.isXLargeDevice(mapActivity); initView(mapActivity); viewfinder = (LinearLayout) view.findViewById(R.id.viewfinder); @@ -106,7 +104,7 @@ public class AudioVideoNoteRecordingMenu { } public boolean isLandscapeLayout() { - return !portraitMode && !largeDevice; + return !portraitMode; } public void show() { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/BaseMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/BaseMenuController.java index c75cacc925..0d7cb6393e 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/BaseMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/BaseMenuController.java @@ -9,12 +9,10 @@ import net.osmand.plus.helpers.AndroidUiHelper; public abstract class BaseMenuController { - public final static float LANDSCAPE_WIDTH_DP = 366f; - private MapActivity mapActivity; private boolean portraitMode; - private boolean largeDevice; private boolean nightMode; + private int landscapeWidthPx; public BaseMenuController(MapActivity mapActivity) { this.mapActivity = mapActivity; @@ -23,7 +21,7 @@ public abstract class BaseMenuController { private void init() { portraitMode = AndroidUiHelper.isOrientationPortrait(mapActivity); - largeDevice = AndroidUiHelper.isXLargeDevice(mapActivity); + landscapeWidthPx = mapActivity.getResources().getDimensionPixelSize(R.dimen.dashboard_land_width); updateNightMode(); } @@ -48,8 +46,8 @@ public abstract class BaseMenuController { return !portraitMode; } - public float getLandscapeWidthDp() { - return LANDSCAPE_WIDTH_DP; + public int getLandscapeWidthPx() { + return landscapeWidthPx; } public float getHalfScreenMaxHeightKoef() { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 5ad8a414b5..ec58a05313 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -714,11 +714,11 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL return menuController != null && menuController.isLandscapeLayout(); } - public float getLandscapeWidthDp() { + public int getLandscapeWidthPx() { if (menuController != null) { - return menuController.getLandscapeWidthDp(); + return menuController.getLandscapeWidthPx(); } else { - return 0f; + return 0; } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index a13a0f1314..74e36558a1 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -228,10 +228,10 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { final TypedValue typedValueAttr = new TypedValue(); getMapActivity().getTheme().resolveAttribute(R.attr.left_menu_view_bg, typedValueAttr, true); mainView.setBackgroundResource(typedValueAttr.resourceId); - mainView.setLayoutParams(new FrameLayout.LayoutParams(dpToPx(menu.getLandscapeWidthDp()), + mainView.setLayoutParams(new FrameLayout.LayoutParams(menu.getLandscapeWidthPx(), ViewGroup.LayoutParams.MATCH_PARENT)); View fabContainer = view.findViewById(R.id.context_menu_fab_container); - fabContainer.setLayoutParams(new FrameLayout.LayoutParams(dpToPx(menu.getLandscapeWidthDp()), + fabContainer.setLayoutParams(new FrameLayout.LayoutParams(menu.getLandscapeWidthPx(), ViewGroup.LayoutParams.MATCH_PARENT)); } @@ -1098,7 +1098,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { latlon = box.getLatLonFromPixel(markerMapCenterX, markerMapCenterY); } if (menu.isLandscapeLayout()) { - int x = dpToPx(menu.getLandscapeWidthDp()); + int x = menu.getLandscapeWidthPx(); if (markerX - markerPaddingXPx < x || markerX > origMarkerX) { int dx = (x + markerPaddingXPx) - markerX; int dy = 0; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 3c244f5a4d..5f10b0967d 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -31,7 +31,7 @@ import static android.util.TypedValue.COMPLEX_UNIT_DIP; public class MenuBuilder { - public static final float SHADOW_HEIGHT_TOP_DP = 16f; + public static final float SHADOW_HEIGHT_TOP_DP = 17f; protected OsmandApplication app; protected LinkedList plainMenuItems; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditor.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditor.java index 99fdb93516..047c8fbe9a 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditor.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditor.java @@ -15,13 +15,11 @@ public abstract class PointEditor { protected boolean isNew; private boolean portraitMode; - private boolean largeDevice; private boolean nightMode; public PointEditor(MapActivity mapActivity) { this.app = mapActivity.getMyApplication(); this.mapActivity = mapActivity; - largeDevice = AndroidUiHelper.isXLargeDevice(mapActivity); updateLandscapePortrait(); updateNightMode(); } @@ -35,7 +33,7 @@ public abstract class PointEditor { } public boolean isLandscapeLayout() { - return !portraitMode && !largeDevice; + return !portraitMode; } public boolean isLight() { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenuFragment.java index 4e12544e30..e1afccf37d 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenuFragment.java @@ -115,8 +115,7 @@ public class MapRouteInfoMenuFragment extends Fragment { public void applyDayNightMode() { MapActivity ctx = getMapActivity(); boolean portraitMode = AndroidUiHelper.isOrientationPortrait(ctx); - boolean largeDevice = AndroidUiHelper.isXLargeDevice(ctx); - boolean landscapeLayout = !portraitMode && !largeDevice; + boolean landscapeLayout = !portraitMode; boolean nightMode = ctx.getMyApplication().getDaynightHelper().isNightModeForMapControls(); if (!landscapeLayout) { AndroidUtils.setBackground(ctx, mainView, nightMode, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark); diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java index a02d404674..939acdf771 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java @@ -36,7 +36,6 @@ public class MapMarkersWidgetsFactory { private MapMarkersHelper helper; private int screenOrientation; private boolean portraitMode; - private boolean largeDevice; private View topBar; private View addressTopBar; @@ -62,7 +61,6 @@ public class MapMarkersWidgetsFactory { helper = map.getMyApplication().getMapMarkersHelper(); screenOrientation = DashLocationFragment.getScreenOrientation(map); portraitMode = AndroidUiHelper.isOrientationPortrait(map); - largeDevice = AndroidUiHelper.isXLargeDevice(map); addressTopBar = map.findViewById(R.id.map_top_bar); topBar = map.findViewById(R.id.map_markers_top_bar); @@ -304,7 +302,7 @@ public class MapMarkersWidgetsFactory { } public boolean isLandscapeLayout() { - return !portraitMode && !largeDevice; + return !portraitMode; } public abstract static class DistanceToMapMarkerControl extends TextInfoWidget {