diff --git a/android/res/layout/place_page.xml b/android/res/layout/place_page.xml index f8a6159e3c..76fa88dda7 100644 --- a/android/res/layout/place_page.xml +++ b/android/res/layout/place_page.xml @@ -25,6 +25,12 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?panel"/> + + diff --git a/android/src/com/mapswithme/maps/widget/placepage/BannerController.java b/android/src/com/mapswithme/maps/widget/placepage/BannerController.java index a7b3298bcf..5f70a08e35 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/BannerController.java +++ b/android/src/com/mapswithme/maps/widget/placepage/BannerController.java @@ -128,10 +128,10 @@ final class BannerController implements View.OnClickListener mFrame.setOnClickListener(this); } - void close() + boolean close() { if (!isShowing() || mBanner == null || !mIsOpened) - return; + return false; mIsOpened = false; setFrameHeight((int) mCloseFrameHeight); @@ -147,6 +147,13 @@ final class BannerController implements View.OnClickListener if (mTitle != null) mTitle.setMaxLines(1); mFrame.setOnClickListener(null); + + return true; + } + + int getLastBannerHeight() + { + return mFrame.getHeight(); } private void setFrameHeight(int height) diff --git a/android/src/com/mapswithme/maps/widget/placepage/BottomPlacePageAnimationController.java b/android/src/com/mapswithme/maps/widget/placepage/BottomPlacePageAnimationController.java index 3a589511a2..65d98991af 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/BottomPlacePageAnimationController.java +++ b/android/src/com/mapswithme/maps/widget/placepage/BottomPlacePageAnimationController.java @@ -8,7 +8,6 @@ import android.support.annotation.Nullable; import android.support.v4.view.GestureDetectorCompat; import android.support.v7.widget.Toolbar; import android.util.DisplayMetrics; -import android.util.Log; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index d3ec0dd98d..c91d9fdc10 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -168,6 +168,9 @@ public class PlacePageView extends RelativeLayout @Nullable BannerController mBannerController; + @Nullable + View mHeightCompensationView; + // Animations private BaseShadowController mShadowController; private BasePlacePageAnimationController mAnimationController; @@ -332,6 +335,8 @@ public class PlacePageView extends RelativeLayout ViewGroup ppButtons = (ViewGroup) findViewById(R.id.pp__buttons); + mHeightCompensationView = findViewById(R.id.pp__height_compensation); + // TODO: remove this after booking_api.cpp will be done mHotelMore = findViewById(R.id.ll__more); mHotelMore.setOnClickListener(this); @@ -797,12 +802,25 @@ public class PlacePageView extends RelativeLayout if (state == State.HIDDEN) clearBookmarkWebView(); + int heightCompensation = 0; if (mBannerController != null) { if ((state == State.HIDDEN || state == State.PREVIEW) && !UiUtils.isLandscape(getContext())) - mBannerController.close(); + { + if (mBannerController.close()) + heightCompensation = mBannerController.getLastBannerHeight(); + } else + { mBannerController.open(); + } + } + + if (mHeightCompensationView != null) + { + ViewGroup.LayoutParams lp = mHeightCompensationView.getLayoutParams(); + lp.height = heightCompensation; + mHeightCompensationView.setLayoutParams(lp); } if (mMapObject != null)