diff --git a/OsmAnd/res/layout/bottom_sheet_menu_base.xml b/OsmAnd/res/layout/bottom_sheet_menu_base.xml index 6763bb50a6..7e98ba5ca1 100644 --- a/OsmAnd/res/layout/bottom_sheet_menu_base.xml +++ b/OsmAnd/res/layout/bottom_sheet_menu_base.xml @@ -14,7 +14,7 @@ android:layout_height="wrap_content"> + + spaceForScrollView) { - scrollView.getLayoutParams().height = spaceForScrollView; - scrollView.requestLayout(); + final View viewToAdjust = useScrollableItemsContainer() ? mainView.findViewById(R.id.scroll_view) : itemsContainer; + if (viewToAdjust.getHeight() > availableHeight) { + viewToAdjust.getLayoutParams().height = availableHeight; + viewToAdjust.requestLayout(); } // 8dp is the shadow height @@ -165,6 +170,10 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra }); } + protected boolean useScrollableItemsContainer() { + return true; + } + @ColorRes protected int getBottomDividerColorId() { return -1; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/AddGroupBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/AddGroupBottomSheetDialogFragment.java index 6dc530bef5..2c37c532c2 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/AddGroupBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/AddGroupBottomSheetDialogFragment.java @@ -77,6 +77,11 @@ public abstract class AddGroupBottomSheetDialogFragment extends MenuBottomSheetD super.onDestroyView(); } + @Override + protected boolean useScrollableItemsContainer() { + return false; + } + private void showProgressBar() { mainView.findViewById(R.id.groups_recycler_view).setVisibility(View.GONE); mainView.findViewById(R.id.progress_bar).setVisibility(View.VISIBLE);