diff --git a/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java index 6fcf147364..6de34d35ad 100644 --- a/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java @@ -179,7 +179,11 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra public void onGlobalLayout() { final View contentView = useScrollableItemsContainer() ? mainView.findViewById(R.id.scroll_view) : itemsContainer; if (contentView.getHeight() > contentHeight) { - contentView.getLayoutParams().height = contentHeight; + if (useScrollableItemsContainer()) { + contentView.getLayoutParams().height = contentHeight; + } else { + contentView.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT; + } contentView.requestLayout(); } @@ -187,6 +191,9 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra boolean showTopShadow = screenHeight - statusBarHeight - mainView.getHeight() >= AndroidUtils.dpToPx(activity, 8); if (AndroidUiHelper.isOrientationPortrait(activity)) { mainView.setBackgroundResource(showTopShadow ? getPortraitBgResId() : getBgColorId()); + if (!useScrollableItemsContainer() && !showTopShadow) { + mainView.setPadding(0, 0, 0, 0); + } } else { mainView.setBackgroundResource(showTopShadow ? getLandscapeTopsidesBgResId() : getLandscapeSidesBgResId()); } diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AvoidRoadsBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AvoidRoadsBottomSheetDialogFragment.java index b127feaf5b..0638172652 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AvoidRoadsBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AvoidRoadsBottomSheetDialogFragment.java @@ -188,7 +188,6 @@ public class AvoidRoadsBottomSheetDialogFragment extends MenuBottomSheetDialogFr counter++; } - } private void populateImpassableRoadsTypes() { diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ShowAlongTheRouteBottomSheet.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ShowAlongTheRouteBottomSheet.java index 2ac835d94b..c7d1a597cb 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ShowAlongTheRouteBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ShowAlongTheRouteBottomSheet.java @@ -182,6 +182,7 @@ public class ShowAlongTheRouteBottomSheet extends MenuBottomSheetDialogFragment if (adapter != null) { adapter.contentItem = getAdapterContentItems(); adapter.notifyDataSetChanged(); + setupHeightAndBackground(getView()); } } @@ -309,6 +310,7 @@ public class ShowAlongTheRouteBottomSheet extends MenuBottomSheetDialogFragment } if (isChecked) { expListView.expandGroup(groupPosition); + setupHeightAndBackground(getView()); } } }); @@ -322,6 +324,7 @@ public class ShowAlongTheRouteBottomSheet extends MenuBottomSheetDialogFragment } else { expListView.expandGroup(groupPosition); } + setupHeightAndBackground(getView()); } } });