diff --git a/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.h b/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.h index 96806e9add..63177d65c5 100644 --- a/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.h +++ b/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.h @@ -24,7 +24,7 @@ NS_SWIFT_NAME(FrameworkHelper) + (void)zoomMap:(MWMZoomMode)mode; + (void)moveMap:(UIOffset)offset; + (void)scrollMap:(double)distanceX :(double) distanceY; -+ (void)deactivateMapSelection:(BOOL)notifyUI NS_SWIFT_NAME(deactivateMapSelection(notifyUI:)); ++ (void)deactivateMapSelection; + (void)switchMyPositionMode; + (void)stopLocationFollow; + (NSArray *)obtainLastSearchQueries; diff --git a/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.mm b/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.mm index a43f83c691..ff915d93a7 100644 --- a/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.mm +++ b/iphone/CoreApi/CoreApi/Framework/MWMFrameworkHelper.mm @@ -116,8 +116,8 @@ GetFramework().Scroll(distanceX, distanceY); } -+ (void)deactivateMapSelection:(BOOL)notifyUI { - GetFramework().DeactivateMapSelection(notifyUI); ++ (void)deactivateMapSelection { + GetFramework().DeactivateMapSelection(); } + (void)switchMyPositionMode { diff --git a/iphone/Maps/Bookmarks/BookmarksCoordinator.swift b/iphone/Maps/Bookmarks/BookmarksCoordinator.swift index 81f38405a5..19ea1d6b3d 100644 --- a/iphone/Maps/Bookmarks/BookmarksCoordinator.swift +++ b/iphone/Maps/Bookmarks/BookmarksCoordinator.swift @@ -68,7 +68,7 @@ import UIKit animations: { navigationController.setViewControllers(controllers, animated: false) }, completion: nil) - FrameworkHelper.deactivateMapSelection(notifyUI: true) + FrameworkHelper.deactivateMapSelection() self.bookmarksControllers = nil case .closed: navigationController.popToRootViewController(animated: true) diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index a35306c76a..d11efe5030 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -136,7 +136,7 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing"; } - (void)dismissPlacePage { - GetFramework().DeactivateMapSelection(true); + GetFramework().DeactivateMapSelection(); } - (void)hideRegularPlacePage { @@ -155,7 +155,7 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing"; self.controlsManager.trafficButtonHidden = NO; } -- (void)onMapObjectDeselected:(bool)switchFullScreenMode { +- (void)onMapObjectDeselected { [self hidePlacePage]; MWMSearchManager * searchManager = MWMSearchManager.manager; @@ -168,16 +168,11 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing"; searchManager.state = MWMSearchManagerStateHidden; } } +} - if (!switchFullScreenMode) - return; - - // TODO(AB): Switch to full screen mode directly from the tap, in one place, instead of - // every call to onMapObjectDeselected. - if (DeepLinkHandler.shared.isLaunchedByDeeplink) - return; - - BOOL const isSearchHidden = searchManager.state == MWMSearchManagerStateHidden; +- (void)onSwitchFullScreen { + BOOL const isNavigationDashboardHidden = [MWMNavigationDashboardManager sharedManager].state == MWMNavigationDashboardStateHidden; + BOOL const isSearchHidden = MWMSearchManager.manager.state == MWMSearchManagerStateHidden; if (isSearchHidden && isNavigationDashboardHidden) { self.controlsManager.hidden = !self.controlsManager.hidden; } @@ -448,8 +443,9 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing"; Framework &f = GetFramework(); // TODO: Review and improve this code. f.SetPlacePageListeners([self]() { [self onMapObjectSelected]; }, - [self](bool switchFullScreen) { [self onMapObjectDeselected:switchFullScreen]; }, - [self]() { [self onMapObjectUpdated]; }); + [self]() { [self onMapObjectDeselected]; }, + [self]() { [self onMapObjectUpdated]; }, + [self]() { [self onSwitchFullScreen]; }); // TODO: Review and improve this code. f.SetMyPositionModeListener([self](location::EMyPositionMode mode, bool routingActive) { // TODO: Two global listeners are subscribed to the same event from the core. diff --git a/iphone/Maps/Core/Routing/MWMRouter.mm b/iphone/Maps/Core/Routing/MWMRouter.mm index 83b68d6b61..8f986da842 100644 --- a/iphone/Maps/Core/Routing/MWMRouter.mm +++ b/iphone/Maps/Core/Routing/MWMRouter.mm @@ -433,7 +433,7 @@ char const *kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeIm - (void)onRouteReady:(BOOL)hasWarnings { self.routingOptions = [MWMRoutingOptions new]; - GetFramework().DeactivateMapSelection(true); + GetFramework().DeactivateMapSelection(); auto startPoint = [MWMRouter startPoint]; if (!startPoint || !startPoint.isMyPosition) { diff --git a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm index 8bdf2aae78..16a6bf345d 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm @@ -30,7 +30,7 @@ using namespace storage; return GetFramework().HasPlacePageInfo(); } -- (void)closePlacePage { GetFramework().DeactivateMapSelection(true); } +- (void)closePlacePage { GetFramework().DeactivateMapSelection(); } - (void)routeFrom:(PlacePageData *)data { MWMRoutePoint *point = [self routePoint:data withType:MWMRoutePointTypeStart intermediateIndex:0]; diff --git a/iphone/Maps/UI/Search/MWMSearchManager.mm b/iphone/Maps/UI/Search/MWMSearchManager.mm index 2d09f473e2..44dab5b6ea 100644 --- a/iphone/Maps/UI/Search/MWMSearchManager.mm +++ b/iphone/Maps/UI/Search/MWMSearchManager.mm @@ -216,7 +216,7 @@ const CGFloat kWidthForiPad = 320; [self.navigationController popToRootViewControllerAnimated:NO]; self.searchBarView.state = SearchBarStateReady; - GetFramework().DeactivateMapSelection(true); + GetFramework().DeactivateMapSelection(); [self animateConstraints:^{ self.contentViewTopHidden.priority = UILayoutPriorityDefaultLow; self.contentViewBottomHidden.priority = UILayoutPriorityDefaultLow; @@ -237,7 +237,7 @@ const CGFloat kWidthForiPad = 320; [self.navigationController popToRootViewControllerAnimated:NO]; self.searchBarView.state = SearchBarStateReady; - GetFramework().DeactivateMapSelection(true); + GetFramework().DeactivateMapSelection(); [self updateTableSearchActionBar]; auto const navigationManagerState = [MWMNavigationDashboardManager sharedManager].state; if (navigationManagerState == MWMNavigationDashboardStateHidden) { @@ -265,7 +265,7 @@ const CGFloat kWidthForiPad = 320; auto const navigationManagerState = [MWMNavigationDashboardManager sharedManager].state; [self viewHidden:navigationManagerState != MWMNavigationDashboardStateHidden]; self.controlsManager.menuState = MWMBottomMenuStateHidden; - GetFramework().DeactivateMapSelection(true); + GetFramework().DeactivateMapSelection(); [MWMSearch setSearchOnMap:YES]; [self.tableViewController reloadData];