diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm index 76f7d85f80..78d8f5f104 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm @@ -261,7 +261,10 @@ using TInfoDisplays = NSHashTable<__kindof TInfoDisplay>; _topBound = topBound; if (_routePreview) self.routePreview.topBound = topBound; + if (_navigationInfoView) + self.navigationInfoView.topBound = topBound; } + - (void)setLeftBound:(CGFloat)leftBound { _leftBound = leftBound; diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationInfoView.h b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationInfoView.h index 6e40c3ec6c..ccbcf450ed 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationInfoView.h +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationInfoView.h @@ -14,6 +14,7 @@ enum class NavigationSearchState @interface MWMNavigationInfoView : UIView +@property(nonatomic) CGFloat topBound; @property(nonatomic) CGFloat leftBound; @property(nonatomic, readonly) CGFloat leftHeight; @property(nonatomic, readonly) CGFloat rightHeight; diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationInfoView.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationInfoView.mm index ac680181d2..b2a8e8eb1b 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationInfoView.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationInfoView.mm @@ -17,14 +17,16 @@ namespace { -CGFloat constexpr kTurnsiPhoneWidth = 96; -CGFloat constexpr kTurnsiPadWidth = 140; +CGFloat const kTurnsiPhoneWidth = 96; +CGFloat const kTurnsiPadWidth = 140; -CGFloat constexpr kSearchButtonsViewHeightPortrait = 200; -CGFloat constexpr kSearchButtonsViewWidthPortrait = 200; -CGFloat constexpr kSearchButtonsViewHeightLandscape = 56; -CGFloat constexpr kSearchButtonsViewWidthLandscape = 286; -CGFloat constexpr kSearchButtonsSideSize = 44; +CGFloat const kSearchButtonsViewHeightPortrait = 200; +CGFloat const kSearchButtonsViewWidthPortrait = 200; +CGFloat const kSearchButtonsViewHeightLandscape = 56; +CGFloat const kSearchButtonsViewWidthLandscape = 286; +CGFloat const kSearchButtonsSideSize = 44; +CGFloat const kBaseTurnsTopOffset = 28; +CGFloat const kShiftedTurnsTopOffset = 8; NSTimeInterval constexpr kCollapseSearchTimeout = 5.0; @@ -77,6 +79,7 @@ BOOL defaultOrientation(CGSize const & size) @property(weak, nonatomic) IBOutlet MWMButton * searchFoodButton; @property(weak, nonatomic) IBOutlet MWMButton * searchShopButton; @property(weak, nonatomic) IBOutlet MWMButton * searchATMButton; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * turnsTopOffset; @property(nonatomic, readwrite) NavigationSearchState searchState; @property(nonatomic) BOOL isVisible; @@ -101,6 +104,7 @@ BOOL defaultOrientation(CGSize const & size) - (void)remove { self.isVisible = NO; } - (void)layoutSubviews { + [super layoutSubviews]; if (!CGRectEqualToRect(self.frame, self.defaultFrame)) { self.frame = self.defaultFrame; @@ -110,7 +114,6 @@ BOOL defaultOrientation(CGSize const & size) if (!self.isVisible) [self removeFromSuperview]; - [super layoutSubviews]; } - (CGFloat)leftHeight { return self.turnsView.maxY; } @@ -383,15 +386,21 @@ BOOL defaultOrientation(CGSize const & size) - (CGRect)defaultFrame { - return CGRectMake(self.leftBound, 0.0, self.superview.width - self.leftBound, - self.superview.height); + return {{self.leftBound, self.topBound}, + {self.superview.width - self.leftBound, self.superview.height - self.topBound}}; +} + +- (void)setTopBound:(CGFloat)topBound +{ + _topBound = MAX(topBound, 0.0); + self.turnsTopOffset.constant = topBound > 0 ? kShiftedTurnsTopOffset : kBaseTurnsTopOffset; + [self setNeedsLayout]; } - (void)setLeftBound:(CGFloat)leftBound { _leftBound = MAX(leftBound, 0.0); [self setNeedsLayout]; - [self layoutIfNeeded]; } @end diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationInfoView.xib b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationInfoView.xib index 757ae4c77f..52f9b4ead3 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationInfoView.xib +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationInfoView.xib @@ -1,11 +1,11 @@ - + - + @@ -334,6 +334,7 @@ +