diff --git a/iphone/Maps/Bridging-Header.h b/iphone/Maps/Bridging-Header.h index b4762588c7..d95d3756a7 100644 --- a/iphone/Maps/Bridging-Header.h +++ b/iphone/Maps/Bridging-Header.h @@ -22,6 +22,7 @@ #import "MWMFrameworkHelper.h" #import "MWMKeyboard.h" #import "MWMLocationManager.h" +#import "MWMMapWidgetsHelper.h" #import "MWMNoMapsViewController.h" #import "MWMPlacePageButtonsProtocol.h" #import "MWMPlacePageCellUpdateProtocol.h" diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm index cf2815f016..962a6970d9 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm @@ -254,7 +254,6 @@ extern NSString * const kAlohalyticsTapEventKey; { self.trafficButtonHidden = NO; self.menuState = MWMBottomMenuStateInactive; - static_cast(self.ownerController.view).widgetsManager.fullScreen = NO; } - (void)addPlace:(BOOL)isBusiness hasPoint:(BOOL)hasPoint point:(m2::PointD const &)point @@ -262,7 +261,6 @@ extern NSString * const kAlohalyticsTapEventKey; self.trafficButtonHidden = YES; self.menuState = MWMBottomMenuStateHidden; MapViewController * ownerController = self.ownerController; - static_cast(ownerController.view).widgetsManager.fullScreen = YES; [self.placePageManager close]; self.searchManager.state = MWMSearchManagerStateHidden; @@ -314,8 +312,6 @@ extern NSString * const kAlohalyticsTapEventKey; 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 @@ -452,8 +448,6 @@ extern NSString * const kAlohalyticsTapEventKey; self.sideButtonsHidden = _sideButtonsHidden; self.trafficButtonHidden = _trafficButtonHidden; self.menuState = _menuState; - EAGLView * glView = (EAGLView *)self.ownerController.view; - glView.widgetsManager.fullScreen = hidden; } - (void)setZoomHidden:(BOOL)zoomHidden diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm index a23a7e96a0..62d9888bdb 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.mm @@ -433,9 +433,6 @@ BOOL defaultOrientation(CGSize const & size) : kSearchButtonsViewHeightLandscape) / 2; [self layoutIfNeeded]; - } - completion:^(BOOL finished) { - [[MWMMapWidgets widgetsManager] layoutWidgets]; }]; } diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationAddPointToastView.swift b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationAddPointToastView.swift index 5999477b31..c52d209e0f 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationAddPointToastView.swift +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationAddPointToastView.swift @@ -30,4 +30,6 @@ final class NavigationAddPointToastView: UIView { separator.isHidden = true } } + + override var widgetsAreaAffectDirections: MWMAvailableAreaAffectDirections { return .bottom } } diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMRoutePreview.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMRoutePreview.mm index 3df9600f68..e96d7f1020 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMRoutePreview.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMRoutePreview.mm @@ -311,18 +311,25 @@ CGFloat constexpr kAdditionalHeight = 20.; self.arriveLabel.text = [NSString stringWithFormat:L(@"routing_arrive"), arriveStr.UTF8String]; } -#pragma mark - VisibleArea +#pragma mark - AvailableArea / VisibleArea - (MWMAvailableAreaAffectDirections)visibleAreaAffectDirections { return IPAD ? MWMAvailableAreaAffectDirectionsLeft : MWMAvailableAreaAffectDirectionsTop; } -#pragma mark - PlacePageArea +#pragma mark - AvailableArea / PlacePageArea - (MWMAvailableAreaAffectDirections)placePageAreaAffectDirections { return IPAD ? MWMAvailableAreaAffectDirectionsLeft : MWMAvailableAreaAffectDirectionsNone; } +#pragma mark - AvailableArea / WidgetsArea + +- (MWMAvailableAreaAffectDirections)widgetsAreaAffectDirections +{ + return IPAD ? MWMAvailableAreaAffectDirectionsLeft : MWMAvailableAreaAffectDirectionsNone; +} + @end diff --git a/iphone/Maps/Classes/Widgets/MWMMapWidgets.h b/iphone/Maps/Classes/Widgets/MWMMapWidgets.h index 6b4c133ad7..c763c8539c 100644 --- a/iphone/Maps/Classes/Widgets/MWMMapWidgets.h +++ b/iphone/Maps/Classes/Widgets/MWMMapWidgets.h @@ -4,13 +4,9 @@ + (MWMMapWidgets *)widgetsManager; -@property (nonatomic) BOOL fullScreen; -@property (nonatomic) CGFloat leftBound; -@property (nonatomic) CGFloat bottomBound; - - (void)setupWidgets:(Framework::DrapeCreationParams &)p; -- (void)resize:(CGSize)size; -- (void)layoutWidgets; +- (void)resize:(CGSize)size; +- (void)updateAvailableArea:(CGRect)frame; @end diff --git a/iphone/Maps/Classes/Widgets/MWMMapWidgets.mm b/iphone/Maps/Classes/Widgets/MWMMapWidgets.mm index d5bc1e5399..028d03234f 100644 --- a/iphone/Maps/Classes/Widgets/MWMMapWidgets.mm +++ b/iphone/Maps/Classes/Widgets/MWMMapWidgets.mm @@ -10,6 +10,7 @@ @interface MWMMapWidgets () @property(nonatomic) float visualScale; +@property(nonatomic) CGRect availableArea; @end @@ -38,73 +39,34 @@ - (void)resize:(CGSize)size { m_skin->Resize(size.width, size.height); - [self layoutWidgets]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateAvailableArea:self.availableArea]; + }); } -- (void)doLayoutWidgets +- (void)updateAvailableArea:(CGRect)frame { + self.availableArea = frame; if (m_skin == nullptr) return; gui::TWidgetsLayoutInfo layout; - if (self.fullScreen) - { - layout[gui::WIDGET_RULER] = m_skin->ResolvePosition(gui::WIDGET_RULER).m_pixelPivot; - layout[gui::WIDGET_COMPASS] = m_skin->ResolvePosition(gui::WIDGET_COMPASS).m_pixelPivot; - } - else - { - m_skin->ForEach([&layout, &self](gui::EWidget w, gui::Position const & pos) { - m2::PointF pivot = pos.m_pixelPivot; - switch (w) - { - case gui::WIDGET_RULER: - case gui::WIDGET_COPYRIGHT: - { - auto const vs = self.visualScale; - pivot -= m2::PointF(-self.leftBound * vs, - ([MapViewController controller].view.height - self.bottomBound) * vs); - break; - } - case gui::WIDGET_COMPASS: - case gui::WIDGET_SCALE_LABEL: - case gui::WIDGET_CHOOSE_POSITION_MARK: break; - } - layout[w] = pivot; - }); - } + auto const vs = self.visualScale; + auto const viewHeight = [MapViewController controller].view.height; + auto const rulerOffset = + m2::PointF(frame.origin.x * vs, (frame.origin.y + frame.size.height - viewHeight) * vs); + m_skin->ForEach([&layout, &rulerOffset](gui::EWidget w, gui::Position const & pos) { + m2::PointF pivot = pos.m_pixelPivot; + switch (w) + { + case gui::WIDGET_RULER: + case gui::WIDGET_COPYRIGHT: pivot += rulerOffset; break; + case gui::WIDGET_COMPASS: + case gui::WIDGET_SCALE_LABEL: + case gui::WIDGET_CHOOSE_POSITION_MARK: break; + } + layout[w] = pivot; + }); GetFramework().SetWidgetLayout(move(layout)); } -- (void)layoutWidgets -{ - auto doLayoutWidgets = @selector(doLayoutWidgets); - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:doLayoutWidgets object:nil]; - [self performSelector:doLayoutWidgets withObject:nil afterDelay:0]; -} - -#pragma mark - Properties - -- (void)setFullScreen:(BOOL)fullScreen -{ - _fullScreen = fullScreen; - [self layoutWidgets]; -} - -- (void)setLeftBound:(CGFloat)leftBound -{ - CGFloat const newLeftBound = MAX(leftBound, 0.0); - if (equalScreenDimensions(_leftBound, newLeftBound)) - return; - _leftBound = newLeftBound; - [self layoutWidgets]; -} - -- (void)setBottomBound:(CGFloat)bottomBound -{ - if (equalScreenDimensions(_bottomBound, bottomBound)) - return; - _bottomBound = bottomBound; - [self layoutWidgets]; -} - @end diff --git a/iphone/Maps/Classes/Widgets/MWMMapWidgetsHelper.h b/iphone/Maps/Classes/Widgets/MWMMapWidgetsHelper.h new file mode 100644 index 0000000000..9eaf865516 --- /dev/null +++ b/iphone/Maps/Classes/Widgets/MWMMapWidgetsHelper.h @@ -0,0 +1,5 @@ +@interface MWMMapWidgetsHelper : NSObject + ++ (void)updateAvailableArea:(CGRect)frame; + +@end diff --git a/iphone/Maps/Classes/Widgets/MWMMapWidgetsHelper.mm b/iphone/Maps/Classes/Widgets/MWMMapWidgetsHelper.mm new file mode 100644 index 0000000000..1038217b0c --- /dev/null +++ b/iphone/Maps/Classes/Widgets/MWMMapWidgetsHelper.mm @@ -0,0 +1,11 @@ +#import "MWMMapWidgetsHelper.h" +#import "MWMMapWidgets.h" + +@implementation MWMMapWidgetsHelper + ++ (void)updateAvailableArea:(CGRect)frame +{ + [[MWMMapWidgets widgetsManager] updateAvailableArea:frame]; +} + +@end diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 98a4ac4b03..944d2e27b8 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -160,6 +160,12 @@ 343E75971E5B1EE20041226A /* MWMCollectionViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 343E75961E5B1EE20041226A /* MWMCollectionViewController.mm */; }; 343E75981E5B1EE20041226A /* MWMCollectionViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 343E75961E5B1EE20041226A /* MWMCollectionViewController.mm */; }; 343E75991E5B1EE20041226A /* MWMCollectionViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 343E75961E5B1EE20041226A /* MWMCollectionViewController.mm */; }; + 3444DFCC1F1760B900E73099 /* WidgetsArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3444DFCB1F1760B900E73099 /* WidgetsArea.swift */; }; + 3444DFCD1F1760B900E73099 /* WidgetsArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3444DFCB1F1760B900E73099 /* WidgetsArea.swift */; }; + 3444DFCE1F1760B900E73099 /* WidgetsArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3444DFCB1F1760B900E73099 /* WidgetsArea.swift */; }; + 3444DFD11F17620C00E73099 /* MWMMapWidgetsHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3444DFD01F17620C00E73099 /* MWMMapWidgetsHelper.mm */; }; + 3444DFD21F17620C00E73099 /* MWMMapWidgetsHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3444DFD01F17620C00E73099 /* MWMMapWidgetsHelper.mm */; }; + 3444DFD31F17620C00E73099 /* MWMMapWidgetsHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3444DFD01F17620C00E73099 /* MWMMapWidgetsHelper.mm */; }; 3446C6771DDCA9A200146687 /* libtraffic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3446C6761DDCA9A200146687 /* libtraffic.a */; }; 344D63171E795A2D006F17CB /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 344D63161E795A2D006F17CB /* SystemConfiguration.framework */; }; 344D63181E795A3C006F17CB /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 344D63161E795A2D006F17CB /* SystemConfiguration.framework */; }; @@ -1734,6 +1740,9 @@ 3432E1771E49B3A2008477E9 /* Bolts.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Bolts.framework; sourceTree = ""; }; 343E75951E5B1EE20041226A /* MWMCollectionViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMCollectionViewController.h; sourceTree = ""; }; 343E75961E5B1EE20041226A /* MWMCollectionViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMCollectionViewController.mm; sourceTree = ""; }; + 3444DFCB1F1760B900E73099 /* WidgetsArea.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WidgetsArea.swift; sourceTree = ""; }; + 3444DFCF1F17620C00E73099 /* MWMMapWidgetsHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMMapWidgetsHelper.h; sourceTree = ""; }; + 3444DFD01F17620C00E73099 /* MWMMapWidgetsHelper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMMapWidgetsHelper.mm; sourceTree = ""; }; 3446C6761DDCA9A200146687 /* libtraffic.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtraffic.a; path = "../../../omim-build/xcode/Debug/libtraffic.a"; sourceTree = ""; }; 344D63161E795A2D006F17CB /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 345050211E028B8000A8DC59 /* Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = ""; }; @@ -3409,6 +3418,7 @@ 34E7760E1F14B165003040B3 /* VisibleArea.swift */, 34E776161F14B6E2003040B3 /* MWMAvailableAreaAffectDirection.h */, 34E7761D1F14DB48003040B3 /* PlacePageArea.swift */, + 3444DFCB1F1760B900E73099 /* WidgetsArea.swift */, ); path = AvailableArea; sourceTree = ""; @@ -3492,6 +3502,8 @@ 3406FA131C6E0C3300E9FAD2 /* MWMMapDownloadDialog.h */, 3406FA141C6E0C3300E9FAD2 /* MWMMapDownloadDialog.mm */, 3406FA171C6E0D8F00E9FAD2 /* MWMMapDownloadDialog.xib */, + 3444DFCF1F17620C00E73099 /* MWMMapWidgetsHelper.h */, + 3444DFD01F17620C00E73099 /* MWMMapWidgetsHelper.mm */, ); path = Widgets; sourceTree = ""; @@ -5414,6 +5426,7 @@ 340475581E081A4600C92850 /* WebViewController.mm in Sources */, F6FEA82D1C58E89B007223CC /* MWMButton.mm in Sources */, 34F407401E9E1AFF00E57AC0 /* RBBanner.swift in Sources */, + 3444DFD11F17620C00E73099 /* MWMMapWidgetsHelper.mm in Sources */, F6E2FE3C1E097BA00083EBEC /* MWMMigrationViewController.mm in Sources */, F6150E471EFA5C94000B955D /* UGCTextReviewCell.swift in Sources */, F6E2FD4F1E097BA00083EBEC /* MWMMapDownloaderAdsTableViewCell.mm in Sources */, @@ -5446,6 +5459,7 @@ 340475551E081A4600C92850 /* Statistics.mm in Sources */, F68FCB851DA7BBA6007CC7D7 /* MWMTaxiPreviewDataSource.mm in Sources */, F653CE161C71F60200A453F1 /* MWMAddPlaceNavigationBar.mm in Sources */, + 3444DFCC1F1760B900E73099 /* WidgetsArea.swift in Sources */, F6E2FE991E097BA00083EBEC /* MWMiPadPlacePageLayoutImpl.mm in Sources */, 34D3B03B1E389D05004100F9 /* MWMEditorSwitchTableViewCell.mm in Sources */, 3454D7CD1E07F045004AF2AD /* UIFont+MapsMeFonts.mm in Sources */, @@ -5724,6 +5738,7 @@ 342CC5F21C2D7730005F3FE5 /* MWMAuthorizationLoginViewController.mm in Sources */, 340475591E081A4600C92850 /* WebViewController.mm in Sources */, 34F407411E9E1AFF00E57AC0 /* RBBanner.swift in Sources */, + 3444DFD21F17620C00E73099 /* MWMMapWidgetsHelper.mm in Sources */, F6E2FE3D1E097BA00083EBEC /* MWMMigrationViewController.mm in Sources */, F6150E481EFA5C94000B955D /* UGCTextReviewCell.swift in Sources */, F6E2FD501E097BA00083EBEC /* MWMMapDownloaderAdsTableViewCell.mm in Sources */, @@ -5756,6 +5771,7 @@ 346DB82E1E5C4F6700E3123E /* GalleryItemViewController.swift in Sources */, 340475561E081A4600C92850 /* Statistics.mm in Sources */, F6381BF61CD12045004CA943 /* LocaleTranslator.mm in Sources */, + 3444DFCD1F1760B900E73099 /* WidgetsArea.swift in Sources */, F68FCB861DA7BBA6007CC7D7 /* MWMTaxiPreviewDataSource.mm in Sources */, F6E2FE9A1E097BA00083EBEC /* MWMiPadPlacePageLayoutImpl.mm in Sources */, 34D3B03C1E389D05004100F9 /* MWMEditorSwitchTableViewCell.mm in Sources */, @@ -6034,6 +6050,7 @@ 3454D7E41E07F045004AF2AD /* UITextView+RuntimeAttributes.mm in Sources */, 849CF6E91DE842290024A8A5 /* MWMCircularProgressView.mm in Sources */, 34F407421E9E1AFF00E57AC0 /* RBBanner.swift in Sources */, + 3444DFD31F17620C00E73099 /* MWMMapWidgetsHelper.mm in Sources */, F6E2FE3E1E097BA00083EBEC /* MWMMigrationViewController.mm in Sources */, F6150E491EFA5C94000B955D /* UGCTextReviewCell.swift in Sources */, F6E2FD511E097BA00083EBEC /* MWMMapDownloaderAdsTableViewCell.mm in Sources */, @@ -6066,6 +6083,7 @@ 849CF6FB1DE842290024A8A5 /* BookmarksVC.mm in Sources */, 849CF6FC1DE842290024A8A5 /* MWMSideButtonsView.mm in Sources */, 3454D7C01E07F045004AF2AD /* DateComponentsFormatter+ETA.swift in Sources */, + 3444DFCE1F1760B900E73099 /* WidgetsArea.swift in Sources */, F6E2FE9B1E097BA00083EBEC /* MWMiPadPlacePageLayoutImpl.mm in Sources */, 34D3B03D1E389D05004100F9 /* MWMEditorSwitchTableViewCell.mm in Sources */, 849CF7071DE842290024A8A5 /* LocaleTranslator.mm in Sources */, diff --git a/iphone/Maps/UI/AvailableArea/AvailableArea.swift b/iphone/Maps/UI/AvailableArea/AvailableArea.swift index afd22a3979..e3e1f3ca91 100644 --- a/iphone/Maps/UI/AvailableArea/AvailableArea.swift +++ b/iphone/Maps/UI/AvailableArea/AvailableArea.swift @@ -79,15 +79,9 @@ class AvailableArea: UIView { perform(selector, with: nil, afterDelay: 0) } - func isAreaAffectingView(_ other: UIView) -> Bool { - return false - } - - func addAffectingView(_ other: UIView) { - } - - func notifyObserver() { - } + func isAreaAffectingView(_ other: UIView) -> Bool { return false } + func addAffectingView(_ other: UIView) {} + func notifyObserver() {} } extension MWMAvailableAreaAffectDirections: Hashable { diff --git a/iphone/Maps/UI/AvailableArea/WidgetsArea.swift b/iphone/Maps/UI/AvailableArea/WidgetsArea.swift new file mode 100644 index 0000000000..53d5e2a390 --- /dev/null +++ b/iphone/Maps/UI/AvailableArea/WidgetsArea.swift @@ -0,0 +1,21 @@ +final class WidgetsArea: AvailableArea { + override func isAreaAffectingView(_ other: UIView) -> Bool { + return !other.widgetsAreaAffectDirections.isEmpty + } + + override func addAffectingView(_ other: UIView) { + let ov = other.widgetsAreaAffectView + let directions = ov.widgetsAreaAffectDirections + addConstraints(otherView: ov, directions: directions) + } + + override func notifyObserver() { + MWMMapWidgetsHelper.updateAvailableArea(frame) + } +} + +extension UIView { + var widgetsAreaAffectDirections: MWMAvailableAreaAffectDirections { return [] } + + var widgetsAreaAffectView: UIView { return self } +} diff --git a/iphone/Maps/UI/BottomMenu/MWMBottomMenuView.mm b/iphone/Maps/UI/BottomMenu/MWMBottomMenuView.mm index 7d81d7f6b9..af203dce03 100644 --- a/iphone/Maps/UI/BottomMenu/MWMBottomMenuView.mm +++ b/iphone/Maps/UI/BottomMenu/MWMBottomMenuView.mm @@ -176,7 +176,6 @@ CGFloat constexpr kTimeWidthRegular = 128; if (self.state == MWMBottomMenuStateHidden) return; CGFloat const height = self.superview.height - self.mainButtonsHeight.constant; - [MWMMapWidgets widgetsManager].bottomBound = height; [MWMSideButtons buttons].bottomBound = height; } @@ -741,11 +740,18 @@ CGFloat constexpr kTimeWidthRegular = 128; _searchIsActive = self.searchButton.selected = searchIsActive; } -#pragma mark - VisibleArea / PlacePageArea +#pragma mark - AvailableArea / PlacePageArea - (MWMAvailableAreaAffectDirections)placePageAreaAffectDirections { return IPAD ? MWMAvailableAreaAffectDirectionsBottom : MWMAvailableAreaAffectDirectionsNone; } +#pragma mark - AvailableArea / WidgetsArea + +- (MWMAvailableAreaAffectDirections)widgetsAreaAffectDirections +{ + return MWMAvailableAreaAffectDirectionsBottom; +} + @end diff --git a/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm b/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm index 62acf5cd05..7a8d222d0f 100644 --- a/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm +++ b/iphone/Maps/UI/BottomMenu/MWMBottomMenuViewController.mm @@ -583,7 +583,6 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) { - (void)setLeftBound:(CGFloat)leftBound { ((MWMBottomMenuView *)self.view).leftBound = leftBound; - ((EAGLView *)self.controller.view).widgetsManager.leftBound = leftBound; } - (CGFloat)leftBound { return ((MWMBottomMenuView *)self.view).leftBound; } diff --git a/iphone/Maps/UI/Search/SearchBar.swift b/iphone/Maps/UI/Search/SearchBar.swift index 05072164a9..630245a928 100644 --- a/iphone/Maps/UI/Search/SearchBar.swift +++ b/iphone/Maps/UI/Search/SearchBar.swift @@ -4,4 +4,6 @@ class SearchBar: SolidTouchView { override var visibleAreaAffectDirections: MWMAvailableAreaAffectDirections { return alternative(iPhone: .top, iPad: .left) } override var placePageAreaAffectDirections: MWMAvailableAreaAffectDirections { return alternative(iPhone: [], iPad: .left) } + + override var widgetsAreaAffectDirections: MWMAvailableAreaAffectDirections { return alternative(iPhone: [], iPad: .left) } } diff --git a/iphone/Maps/UI/Storyboard/Main.storyboard b/iphone/Maps/UI/Storyboard/Main.storyboard index da10dc006a..198a041ed5 100644 --- a/iphone/Maps/UI/Storyboard/Main.storyboard +++ b/iphone/Maps/UI/Storyboard/Main.storyboard @@ -37,17 +37,25 @@ + + + + + @@ -465,18 +473,18 @@ - +