diff --git a/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java index de7cf24232..d78e4380d5 100644 --- a/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/base/ContextMenuFragment.java @@ -176,6 +176,14 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment { return paused; } + public int getMenuFullHeightMax() { + return menuFullHeightMax; + } + + public int getMenuFullHeight() { + return menuFullHeight; + } + @Nullable public MapActivity getMapActivity() { FragmentActivity activity = getActivity(); diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java index 6917af8ada..b144e7d539 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/RouteDetailsFragment.java @@ -174,11 +174,11 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT return transportCard; } + @Override - protected void changeMenuState(int currentY, boolean slidingUp, boolean slidingDown, boolean animated) { - super.changeMenuState(currentY, slidingUp, slidingDown, animated); - View mainView = getMainView(); - if (mainView != null && isPortrait()) { + protected void updateMainViewLayout(int posY) { + super.updateMainViewLayout(posY); + if (isPortrait()) { updateCardsLayout(); } } @@ -209,8 +209,8 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT LinearLayout cardsContainer = getCardsContainer(); View topShadow = getTopShadow(); FrameLayout bottomContainer = getBottomContainer(); - int halfScreenY = getMenuStatePosY(MenuState.HALF_SCREEN); - if (y > halfScreenY) { + int top = Math.max(getMenuStatePosY(MenuState.HALF_SCREEN), getViewHeight() - getMenuFullHeightMax()); + if (y > top) { topShadow.setVisibility(View.INVISIBLE); bottomContainer.setBackgroundDrawable(null); AndroidUtils.setBackground(mainView.getContext(), cardsContainer, isNightMode(), R.drawable.travel_card_bg_light, R.drawable.travel_card_bg_dark);