diff options
author | Ilya Grechuhin <i.grechuhin@mapswithme.com> | 2015-06-25 11:55:32 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:52:59 +0300 |
commit | 688307aee358f13056be6d2e1795103c4c72ef74 (patch) | |
tree | 76569f367f0fc2a42c39e99bc1ee2b8ed804a03f /iphone/Maps/Classes/MWMiPadPlacePage.mm | |
parent | 9de3f407e7e556de041e3ffbfa32a3a68c78965a (diff) |
[ios] Fixed PP reopen bug. Code cleanup.
Diffstat (limited to 'iphone/Maps/Classes/MWMiPadPlacePage.mm')
-rw-r--r-- | iphone/Maps/Classes/MWMiPadPlacePage.mm | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/iphone/Maps/Classes/MWMiPadPlacePage.mm b/iphone/Maps/Classes/MWMiPadPlacePage.mm index fe3cff06a4..431f0f0ce5 100644 --- a/iphone/Maps/Classes/MWMiPadPlacePage.mm +++ b/iphone/Maps/Classes/MWMiPadPlacePage.mm @@ -71,6 +71,22 @@ static CGFloat const kBottomOffset = 12.; [super pushViewController:viewController animated:animated]; } +- (UIViewController *)popViewControllerAnimated:(BOOL)animated +{ + NSUInteger const count = self.viewControllers.count; + CGFloat const height = count > 1 ? ((UIViewController *)self.viewControllers[count - 2]).view.height + self.navigationBar.height: 0.0; + + [UIView animateWithDuration:0.1 animations:^ + { + self.view.height = height; + } + completion:^(BOOL finished) + { + [super popViewControllerAnimated:animated]; + }]; + return self.viewControllers.lastObject; +} + @end @interface MWMiPadPlacePage () @@ -210,7 +226,7 @@ static CGFloat const kBottomOffset = 12.; - (void)updatePlacePagePosition { UIView * view = self.navigationController.view; - view.maxY = self.availableHeight + kTopOffset; + view.maxY = [self getAvailableHeight] + kTopOffset; view.minY = MIN(view.minY, self.topBound + kTopOffset); [self configureContentInset]; } @@ -235,7 +251,7 @@ static CGFloat const kBottomOffset = 12.; } } -- (CGFloat)availableHeight +- (CGFloat)getAvailableHeight { return self.parentViewHeight - self.keyboardHeight - kTopOffset - kBottomOffset; } @@ -244,7 +260,7 @@ static CGFloat const kBottomOffset = 12.; - (void)setHeight:(CGFloat)height { - _height = MIN(height, self.availableHeight); + _height = MIN(height, [self getAvailableHeight]); self.navigationController.view.height = _height; self.extendedPlacePageView.height = _height; } |