From 46ff18eb1c7261d109e8c4ed71745bf789ab2f56 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Wed, 23 Aug 2017 16:22:17 +0300 Subject: [PATCH] [MAPSME-5411] [ios] Fixed PP opening issue. --- iphone/Maps/Classes/MapViewController.mm | 3 ++- .../MWMiPhonePlacePageLayoutImpl.mm | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 1bc6c3c041..6746817aeb 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -586,8 +586,9 @@ BOOL gIsFirstMyPositionMode = YES; { auto const kbHeight = [MWMKeyboard keyboardHeight]; self.visibleAreaKeyboard.constant = kbHeight; - self.placePageAreaKeyboard.constant = kbHeight; self.sideButtonsAreaKeyboard.constant = kbHeight; + if (IPAD) + self.placePageAreaKeyboard.constant = kbHeight; [self.view layoutIfNeeded]; } #pragma mark - Properties diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMiPhonePlacePageLayoutImpl.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMiPhonePlacePageLayoutImpl.mm index d0d9fe4004..0815f9aaf0 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMiPhonePlacePageLayoutImpl.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMiPhonePlacePageLayoutImpl.mm @@ -190,28 +190,28 @@ CGFloat const kMinOffset = 1; if ([scrollView isEqual:ppView.tableView]) return; - auto const & offset = scrollView.contentOffset; + auto const & offsetY = scrollView.contentOffset.y; id delegate = self.delegate; - if (offset.y <= 0) + if (offsetY <= 0) { [delegate onPlacePageTopBoundChanged:0]; [delegate closePlacePage]; return; } - if (offset.y > ppView.height + kLuftDraggingOffset) + auto const bounded = ppView.height + kLuftDraggingOffset; + if (offsetY > bounded) { - auto const bounded = ppView.height + kLuftDraggingOffset; [scrollView setContentOffset:{0, bounded}]; [delegate onPlacePageTopBoundChanged:bounded]; } else { - [delegate onPlacePageTopBoundChanged:offset.y]; + [delegate onPlacePageTopBoundChanged:offsetY]; } - self.direction = self.lastContentOffset < offset.y ? ScrollDirection::Up : ScrollDirection::Down; - self.lastContentOffset = offset.y; + self.direction = self.lastContentOffset < offsetY ? ScrollDirection::Up : ScrollDirection::Down; + self.lastContentOffset = offsetY; } - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView