diff --git a/iphone/Maps/Bridging-Header.h b/iphone/Maps/Bridging-Header.h index f679a6b157..b4762588c7 100644 --- a/iphone/Maps/Bridging-Header.h +++ b/iphone/Maps/Bridging-Header.h @@ -25,6 +25,7 @@ #import "MWMNoMapsViewController.h" #import "MWMPlacePageButtonsProtocol.h" #import "MWMPlacePageCellUpdateProtocol.h" +#import "MWMPlacePageManagerHelper.h" #import "MWMPlacePageTaxiProvider.h" #import "MWMPushNotifications.h" #import "MWMRouter.h" diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm index a94ecfeab8..cf2815f016 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm @@ -129,7 +129,6 @@ extern NSString * const kAlohalyticsTapEventKey; { [self.trafficButton viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; [self.menuController viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; - [self.placePageManager viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; [self.searchManager viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; [coordinator animateAlongsideTransition:^( id _Nonnull context) { @@ -296,13 +295,11 @@ extern NSString * const kAlohalyticsTapEventKey; { CGFloat const bound = newFrame.origin.x + newFrame.size.width; self.navigationManager.leftBound = bound; - self.placePageManager.leftBound = bound; self.trafficButton.leftBound = bound; } else { CGFloat const bound = newFrame.origin.y + newFrame.size.height; - self.placePageManager.topBound = bound; self.sideButtons.topBound = bound; self.trafficButton.topBound = bound; } @@ -312,21 +309,13 @@ extern NSString * const kAlohalyticsTapEventKey; { auto nm = self.navigationManager; if (IPAD) - { - [self.placePageManager setTopBound:self.topBound + nm.leftTop]; - } - else - { - auto const topBound = self.topBound + nm.rightTop; - auto const bottomBound = nm.bottom; - [self.sideButtons setTopBound:topBound]; - [self.sideButtons setBottomBound:bottomBound]; - [MWMMapWidgets widgetsManager].bottomBound = bottomBound; - [MWMMapWidgets widgetsManager].leftBound = nm.left; - BOOL const skipNavDashboardHeight = - self.navigationManager.state == MWMNavigationDashboardStateNavigation; - [self.placePageManager setTopBound:skipNavDashboardHeight ? self.topBound : topBound]; - } + return; + auto const topBound = self.topBound + nm.rightTop; + auto const bottomBound = nm.bottom; + [self.sideButtons setTopBound:topBound]; + [self.sideButtons setBottomBound:bottomBound]; + [MWMMapWidgets widgetsManager].bottomBound = bottomBound; + [MWMMapWidgets widgetsManager].leftBound = nm.left; } - (void)setDisableStandbyOnRouteFollowing:(BOOL)disableStandbyOnRouteFollowing @@ -511,7 +500,6 @@ extern NSString * const kAlohalyticsTapEventKey; if (IPAD) return; _topBound = topBound; - self.placePageManager.topBound = topBound; self.sideButtons.topBound = topBound; self.navigationManager.topBound = topBound; self.trafficButton.topBound = topBound; @@ -523,8 +511,8 @@ extern NSString * const kAlohalyticsTapEventKey; return; if ([MWMRouter isRoutingActive]) return; - _leftBound = self.placePageManager.leftBound = self.navigationManager.leftBound = - self.menuController.leftBound = self.trafficButton.leftBound = leftBound; + _leftBound = self.navigationManager.leftBound = self.menuController.leftBound = + self.trafficButton.leftBound = leftBound; } - (BOOL)searchHidden { return self.searchManager.state == MWMSearchManagerStateHidden; } diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm index 952e7c2c02..1d3b62457c 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm @@ -60,8 +60,10 @@ BOOL defaultOrientation(CGSize const & size) @interface MWMNavigationInfoView () @property(weak, nonatomic) IBOutlet UIView * streetNameView; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * streetNameViewHideOffset; @property(weak, nonatomic) IBOutlet UILabel * streetNameLabel; @property(weak, nonatomic) IBOutlet UIView * turnsView; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * turnsViewHideOffset; @property(weak, nonatomic) IBOutlet UIImageView * nextTurnImageView; @property(weak, nonatomic) IBOutlet UILabel * roundTurnLabel; @property(weak, nonatomic) IBOutlet UILabel * distanceToNextTurnLabel; @@ -273,16 +275,16 @@ BOOL defaultOrientation(CGSize const & size) return; if (info.streetName.length != 0) { - self.streetNameView.hidden = NO; + [self setStreetNameVisible:YES]; self.streetNameLabel.text = info.streetName; } else { - self.streetNameView.hidden = YES; + [self setStreetNameVisible:NO]; } if (info.turnImage) { - self.turnsView.hidden = NO; + [self setTurnsViewVisible:YES]; self.nextTurnImageView.image = info.turnImage; self.nextTurnImageView.mwm_coloring = MWMImageColoringWhite; @@ -327,9 +329,8 @@ BOOL defaultOrientation(CGSize const & size) } else { - self.turnsView.hidden = YES; + [self setTurnsViewVisible:NO]; } - self.hidden = self.streetNameView.hidden && self.turnsView.hidden; [self setNeedsLayout]; } @@ -491,12 +492,26 @@ BOOL defaultOrientation(CGSize const & size) break; case MWMNavigationInfoViewStatePrepare: self.isVisible = YES; - self.streetNameView.hidden = YES; - self.turnsView.hidden = YES; + [self setStreetNameVisible:NO]; + [self setTurnsViewVisible:NO]; break; } } +- (void)setStreetNameVisible:(BOOL)isVisible +{ + self.streetNameView.hidden = !isVisible; + self.streetNameViewHideOffset.priority = + isVisible ? UILayoutPriorityDefaultLow : UILayoutPriorityDefaultHigh; +} + +- (void)setTurnsViewVisible:(BOOL)isVisible +{ + self.turnsView.hidden = !isVisible; + self.turnsViewHideOffset.priority = + isVisible ? UILayoutPriorityDefaultLow : UILayoutPriorityDefaultHigh; +} + - (void)setIsVisible:(BOOL)isVisible { [self setNeedsLayout]; diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.xib b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.xib index 20cf79cb44..b76c23de31 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.xib +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.xib @@ -72,7 +72,7 @@ -