From dbd348cec8d952b5eb4e2d988914c170e71cd946 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Wed, 6 Dec 2017 12:04:05 +0200 Subject: [PATCH] revert changing menu --- .../base/MenuBottomSheetDialogFragment.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java index a53bcfccc3..0a3687b8e3 100644 --- a/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/base/MenuBottomSheetDialogFragment.java @@ -72,25 +72,24 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra final View scrollView = mainView.findViewById(scrollViewId); int scrollViewHeight = scrollView.getHeight(); int dividerHeight = AndroidUtils.dpToPx(getContext(), 1); - int shadowHeight = AndroidUtils.dpToPx(getContext(), 15); int cancelButtonHeight = getContext().getResources().getDimensionPixelSize(R.dimen.bottom_sheet_cancel_button_height); - int spaceForScrollView = screenHeight - statusBarHeight - dividerHeight - cancelButtonHeight; + int spaceForScrollView = screenHeight - statusBarHeight - navBarHeight - dividerHeight - cancelButtonHeight; if (scrollViewHeight > spaceForScrollView) { scrollView.getLayoutParams().height = spaceForScrollView; scrollView.requestLayout(); } -// if (AndroidUiHelper.isOrientationPortrait(activity)) { -// AndroidUtils.setBackground(activity, mainView, nightMode, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark); -// } else { -// if (screenHeight - statusBarHeight - mainView.getHeight() >= getResources().getDimension(R.dimen.bottom_sheet_content_padding_small)) { -// AndroidUtils.setBackground(activity, mainView, nightMode, -// R.drawable.bg_bottom_sheet_topsides_landscape_light, R.drawable.bg_bottom_sheet_topsides_landscape_dark); -// } else { -// AndroidUtils.setBackground(activity, mainView, nightMode, -// R.drawable.bg_bottom_sheet_sides_landscape_light, R.drawable.bg_bottom_sheet_sides_landscape_dark); -// } -// } + if (AndroidUiHelper.isOrientationPortrait(activity)) { + AndroidUtils.setBackground(activity, mainView, nightMode, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark); + } else { + if (screenHeight - statusBarHeight - mainView.getHeight() >= getResources().getDimension(R.dimen.bottom_sheet_content_padding_small)) { + AndroidUtils.setBackground(activity, mainView, nightMode, + R.drawable.bg_bottom_sheet_topsides_landscape_light, R.drawable.bg_bottom_sheet_topsides_landscape_dark); + } else { + AndroidUtils.setBackground(activity, mainView, nightMode, + R.drawable.bg_bottom_sheet_sides_landscape_light, R.drawable.bg_bottom_sheet_sides_landscape_dark); + } + } ViewTreeObserver obs = mainView.getViewTreeObserver(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {