diff --git a/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java index 2f8abc1391..5a530f6158 100644 --- a/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java @@ -142,14 +142,12 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra scrollView.requestLayout(); } + // 8dp is the shadow height + boolean showTopShadow = screenHeight - statusBarHeight - mainView.getHeight() >= AndroidUtils.dpToPx(activity, 8); if (AndroidUiHelper.isOrientationPortrait(activity)) { - mainView.setBackgroundResource(getPortraitBgResId()); + mainView.setBackgroundResource(showTopShadow ? getPortraitBgResId() : getBgColorId()); } else { - if (screenHeight - statusBarHeight - mainView.getHeight() >= getResources().getDimension(R.dimen.bottom_sheet_content_padding_small)) { - mainView.setBackgroundResource(getLandscapeTopsidesBgResId()); - } else { - mainView.setBackgroundResource(getLandscapeSidesBgResId()); - } + mainView.setBackgroundResource(showTopShadow ? getLandscapeTopsidesBgResId() : getLandscapeSidesBgResId()); } ViewTreeObserver obs = mainView.getViewTreeObserver(); @@ -176,6 +174,11 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra } + @ColorRes + protected int getBgColorId() { + return nightMode ? R.color.bg_color_dark : R.color.bg_color_light; + } + @DrawableRes protected int getPortraitBgResId() { return nightMode ? R.drawable.bg_bottom_menu_dark : R.drawable.bg_bottom_menu_light; diff --git a/OsmAnd/src/net/osmand/plus/dialogs/AddWaypointBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/dialogs/AddWaypointBottomSheetDialogFragment.java index 17d5b7c289..6d09efcfab 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/AddWaypointBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/AddWaypointBottomSheetDialogFragment.java @@ -144,6 +144,11 @@ public class AddWaypointBottomSheetDialogFragment extends MenuBottomSheetDialogF return getIcon(id, nightMode ? R.color.ctx_menu_direction_color_dark : R.color.map_widget_blue); } + @Override + protected int getBgColorId() { + return nightMode ? R.color.ctx_menu_bg_dark : R.color.bg_color_light; + } + @Override protected int getPortraitBgResId() { return nightMode ? R.drawable.bg_additional_menu_dark : R.drawable.bg_bottom_menu_light;