diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2016-10-05 13:54:11 +0300 |
---|---|---|
committer | VladiMihaylenko <vxmihaylenko@gmail.com> | 2016-10-17 17:17:50 +0300 |
commit | 54798069b30de479fd804e44a1a036ea3db1c753 (patch) | |
tree | fc811cbee313607ed370b2f89d561e3517f6614e /iphone/Maps/Classes/CustomViews/MapViewControls | |
parent | c3b17e75f77632139aaa0643e4b4084aade2a991 (diff) |
[ios] New place page
Diffstat (limited to 'iphone/Maps/Classes/CustomViews/MapViewControls')
3 files changed, 33 insertions, 19 deletions
diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h index 9f218003f9..5af2b8b449 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h @@ -9,6 +9,7 @@ @class MapViewController; @class MWMPlacePageEntity; +@protocol MWMFeatureHolder; @interface MWMMapViewControlsManager : NSObject @@ -20,8 +21,8 @@ @property(nonatomic) MWMBottomMenuState menuState; @property(nonatomic) MWMBottomMenuState menuRestoreState; @property(nonatomic, readonly) MWMNavigationDashboardState navigationState; -@property(nonatomic, readonly) MWMPlacePageEntity * placePageEntity; @property(nonatomic) BOOL searchHidden; +@property(nonatomic) BOOL isDirectionViewHidden; - (instancetype)init __attribute__((unavailable("init is not available"))); - (instancetype)initWithParentController:(MapViewController *)controller; @@ -40,8 +41,6 @@ #pragma mark - MWMPlacePageViewManager -@property(nonatomic, readonly) BOOL isDirectionViewShown; - - (void)dismissPlacePage; - (void)showPlacePage:(place_page::Info const &)info; - (void)addPlacePageViews:(NSArray *)views; @@ -68,4 +67,8 @@ - (void)searchFrameUpdated:(CGRect)frame; - (void)searchText:(NSString *)text forInputLocale:(NSString *)locale; +#pragma mark - MWMFeatureHolder + +- (id<MWMFeatureHolder>)featureHolder; + @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm index f5877cf524..06f83de0a5 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm @@ -10,6 +10,7 @@ #import "MWMFrameworkListener.h" #import "MWMObjectsCategorySelectorController.h" #import "MWMPlacePageEntity.h" +#import "MWMPlacePageManager.h" #import "MWMPlacePageViewManager.h" #import "MWMRoutePreview.h" #import "MWMRouter.h" @@ -42,7 +43,7 @@ extern NSString * const kAlohalyticsTapEventKey; @property(nonatomic) MWMSideButtons * sideButtons; @property(nonatomic) MWMBottomMenuViewController * menuController; -@property(nonatomic) MWMPlacePageViewManager * placePageManager; +@property(nonatomic) id<MWMPlacePageProtocol> placePageManager; @property(nonatomic) MWMNavigationDashboardManager * navigationManager; @property(nonatomic) MWMSearchManager * searchManager; @@ -84,7 +85,7 @@ extern NSString * const kAlohalyticsTapEventKey; searchManagerState != MWMSearchManagerStateHidden) || self.navigationState == MWMNavigationDashboardStatePlanning || self.navigationState == MWMNavigationDashboardStateReady || - self.menuState == MWMBottomMenuStateActive || self.isDirectionViewShown || + self.menuState == MWMBottomMenuStateActive || !self.isDirectionViewHidden || (isNightMode && self.navigationState != MWMNavigationDashboardStateHidden) || MapsAppDelegate.theApp.routingPlaneMode != MWMRoutingPlaneModeNone; return (isLight || (!isLight && isNightMode)) ? UIStatusBarStyleLightContent @@ -292,12 +293,19 @@ extern NSString * const kAlohalyticsTapEventKey; { if (IPAD) return; - CGSize const ownerViewSize = self.ownerController.view.size; - if (ownerViewSize.width > ownerViewSize.height) + if (isIOS7) { - CGFloat const leftBound = frame.origin.x + frame.size.width; - self.menuController.leftBound = leftBound; - [MWMNavigationDashboardManager manager].leftBound = leftBound; + CGSize const ownerViewSize = self.ownerController.view.size; + if (ownerViewSize.width > ownerViewSize.height) + { + CGFloat const leftBound = frame.origin.x + frame.size.width; + self.menuController.leftBound = leftBound; + [MWMNavigationDashboardManager manager].leftBound = leftBound; + } + else + { + [self.sideButtons setBottomBound:frame.origin.y]; + } } else { @@ -459,11 +467,13 @@ extern NSString * const kAlohalyticsTapEventKey; return _menuController; } -- (MWMPlacePageViewManager *)placePageManager +- (id)placePageManager { + auto const PlacePageClass = isIOS7 || IPAD ? [MWMPlacePageViewManager class] : [MWMPlacePageManager class]; + if (!_placePageManager) _placePageManager = - [[MWMPlacePageViewManager alloc] initWithViewController:self.ownerController]; + [[PlacePageClass alloc] initWithViewController:self.ownerController]; return _placePageManager; } @@ -526,12 +536,6 @@ extern NSString * const kAlohalyticsTapEventKey; } - (MWMNavigationDashboardState)navigationState { return self.navigationManager.state; } -- (MWMPlacePageEntity *)placePageEntity { return self.placePageManager.entity; } -- (BOOL)isDirectionViewShown -{ - return _placePageManager ? _placePageManager.isDirectionViewShown : NO; -} - - (void)setTopBound:(CGFloat)topBound { if (IPAD) @@ -558,4 +562,11 @@ extern NSString * const kAlohalyticsTapEventKey; searchHidden ? MWMSearchManagerStateHidden : MWMSearchManagerStateDefault; } +#pragma mark - MWMFeatureHolder + +- (id<MWMFeatureHolder>)featureHolder +{ + return self.placePageManager; +} + @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/BookmarksTab/MWMSearchBookmarksCell.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/BookmarksTab/MWMSearchBookmarksCell.mm index 54cf32d377..3d2ac72aa7 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/BookmarksTab/MWMSearchBookmarksCell.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/BookmarksTab/MWMSearchBookmarksCell.mm @@ -57,7 +57,7 @@ - (IBAction)openBookmarks { - BookmarksVC * bvc = [[BookmarksVC alloc] initWithCategory:self.index]; + BookmarksVC * bvc = [[BookmarksVC alloc] initWithCategory:static_cast<int>(self.index)]; UINavigationController * rootVC = (UINavigationController *)UIApplication.sharedApplication.delegate.window.rootViewController; [rootVC pushViewController:bvc animated:YES]; } |