Fix route info bottom gap

This commit is contained in:
crimean 2019-04-11 11:59:52 +03:00
parent 83a2f7abef
commit e7228c49e2
2 changed files with 14 additions and 6 deletions

View file

@ -176,6 +176,14 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
return paused; return paused;
} }
public int getMenuFullHeightMax() {
return menuFullHeightMax;
}
public int getMenuFullHeight() {
return menuFullHeight;
}
@Nullable @Nullable
public MapActivity getMapActivity() { public MapActivity getMapActivity() {
FragmentActivity activity = getActivity(); FragmentActivity activity = getActivity();

View file

@ -174,11 +174,11 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
return transportCard; return transportCard;
} }
@Override @Override
protected void changeMenuState(int currentY, boolean slidingUp, boolean slidingDown, boolean animated) { protected void updateMainViewLayout(int posY) {
super.changeMenuState(currentY, slidingUp, slidingDown, animated); super.updateMainViewLayout(posY);
View mainView = getMainView(); if (isPortrait()) {
if (mainView != null && isPortrait()) {
updateCardsLayout(); updateCardsLayout();
} }
} }
@ -209,8 +209,8 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
LinearLayout cardsContainer = getCardsContainer(); LinearLayout cardsContainer = getCardsContainer();
View topShadow = getTopShadow(); View topShadow = getTopShadow();
FrameLayout bottomContainer = getBottomContainer(); FrameLayout bottomContainer = getBottomContainer();
int halfScreenY = getMenuStatePosY(MenuState.HALF_SCREEN); int top = Math.max(getMenuStatePosY(MenuState.HALF_SCREEN), getViewHeight() - getMenuFullHeightMax());
if (y > halfScreenY) { if (y > top) {
topShadow.setVisibility(View.INVISIBLE); topShadow.setVisibility(View.INVISIBLE);
bottomContainer.setBackgroundDrawable(null); bottomContainer.setBackgroundDrawable(null);
AndroidUtils.setBackground(mainView.getContext(), cardsContainer, isNightMode(), R.drawable.travel_card_bg_light, R.drawable.travel_card_bg_dark); AndroidUtils.setBackground(mainView.getContext(), cardsContainer, isNightMode(), R.drawable.travel_card_bg_light, R.drawable.travel_card_bg_dark);