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;
}
public int getMenuFullHeightMax() {
return menuFullHeightMax;
}
public int getMenuFullHeight() {
return menuFullHeight;
}
@Nullable
public MapActivity getMapActivity() {
FragmentActivity activity = getActivity();

View file

@ -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);