From 52cd23bfb5ef80426f7b04c13b2fc841a0bd9e91 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Wed, 23 Aug 2017 12:30:19 +0300 Subject: [PATCH] [MAPSME-5401] [ios] Fixed map selection update on PP close. --- .../MWMMapViewControlsManager.mm | 4 ++-- .../Maps/UI/PlacePage/MWMPlacePageManager.mm | 20 +++++++++---------- .../Maps/UI/PlacePage/MWMPlacePageProtocol.h | 2 +- .../PlacePageLayout/MWMPlacePageLayout.h | 4 ++-- .../MWMiPadPlacePageLayoutImpl.mm | 4 ++-- .../MWMiPhonePlacePageLayoutImpl.mm | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm index e7bd4bb9ea..fbf1934e33 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm @@ -113,7 +113,7 @@ extern NSString * const kAlohalyticsTapEventKey; - (void)dismissPlacePage { self.trafficButtonHidden = NO; - [self.placePageManager close]; + [self.placePageManager dismiss]; } - (void)showPlacePage:(place_page::Info const &)info @@ -191,7 +191,7 @@ extern NSString * const kAlohalyticsTapEventKey; self.trafficButtonHidden = YES; self.menuState = MWMBottomMenuStateHidden; MapViewController * ownerController = self.ownerController; - [self.placePageManager close]; + [self.placePageManager dismiss]; self.searchManager.state = MWMSearchManagerStateHidden; [MWMAddPlaceNavigationBar showInSuperview:ownerController.view diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm index 8399fc0145..2e5c74925c 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm @@ -103,7 +103,7 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) [self processCountryEvent:self.data.countryId]; } -- (void)close +- (void)dismiss { [self.layout close]; self.data = nil; @@ -129,7 +129,7 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) bookmarkAndCategory.m_categoryIndex != deletedBookmarkAndCategory.m_categoryIndex) return; - [self shouldClose]; + [self closePlacePage]; } - (void)handleBookmarkCategoryDeleting:(NSNotification *)notification @@ -144,7 +144,7 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) if (index != deletedIndex) return; - [self shouldClose]; + [self closePlacePage]; } #pragma mark - MWMPlacePageLayoutDataSource @@ -229,8 +229,8 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) [self.layout checkCellsVisible]; } -- (void)shouldDestroyLayout { self.layout = nil; } -- (void)shouldClose { GetFramework().DeactivateMapSelection(true); } +- (void)destroyLayout { self.layout = nil; } +- (void)closePlacePage { GetFramework().DeactivateMapSelection(true); } - (BOOL)isExpandedOnShow { auto data = self.data; @@ -302,7 +302,7 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) MWMRoutePoint * point = [self routePointWithType:MWMRoutePointTypeStart intermediateIndex:0]; [MWMRouter buildFromPoint:point bestRouter:YES]; - [self close]; + [self closePlacePage]; } - (void)routeTo @@ -312,7 +312,7 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) MWMRoutePoint * point = [self routePointWithType:MWMRoutePointTypeFinish intermediateIndex:0]; [MWMRouter buildToPoint:point bestRouter:YES]; - [self close]; + [self closePlacePage]; } - (void)addStop @@ -320,7 +320,7 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) MWMRoutePoint * point = [self routePointWithType:MWMRoutePointTypeIntermediate intermediateIndex:0]; [MWMRouter addPointAndRebuild:point]; - [self shouldClose]; + [self closePlacePage]; } - (void)removeStop @@ -343,7 +343,7 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) break; } [MWMRouter removePointAndRebuild:point]; - [self shouldClose]; + [self closePlacePage]; } - (void)orderTaxi:(MWMPlacePageTaxiProvider)provider @@ -363,7 +363,7 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) [MWMRouter setType:MWMRouterTypeTaxi]; MWMRoutePoint * point = [self routePointWithType:MWMRoutePointTypeFinish intermediateIndex:0]; [MWMRouter buildToPoint:point bestRouter:NO]; - [self close]; + [self closePlacePage]; } - (MWMRoutePoint *)routePointWithType:(MWMRoutePointType)type diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageProtocol.h b/iphone/Maps/UI/PlacePage/MWMPlacePageProtocol.h index 461bce5113..1b3ab739ec 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageProtocol.h +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageProtocol.h @@ -47,7 +47,7 @@ struct HotelFacility; @protocol MWMPlacePageProtocol - (void)show:(place_page::Info const &)info; -- (void)close; +- (void)dismiss; - (void)mwm_refreshUI; @end diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.h b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.h index 7229253889..eca44f7097 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.h +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMPlacePageLayout.h @@ -6,8 +6,8 @@ enum class NodeStatus; @protocol MWMPlacePageLayoutDelegate - (void)onPlacePageTopBoundChanged:(CGFloat)bound; -- (void)shouldDestroyLayout; -- (void)shouldClose; +- (void)destroyLayout; +- (void)closePlacePage; - (BOOL)isExpandedOnShow; - (void)onExpanded; diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMiPadPlacePageLayoutImpl.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMiPadPlacePageLayoutImpl.mm index 9e092da811..99a837db46 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMiPadPlacePageLayoutImpl.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMiPadPlacePageLayoutImpl.mm @@ -82,7 +82,7 @@ CGFloat const kBottomOffset = 36; ^{ self.placePageView = nil; self.actionBar = nil; - [self.delegate shouldDestroyLayout]; + [self.delegate destroyLayout]; }); } @@ -148,7 +148,7 @@ CGFloat const kBottomOffset = 36; CGFloat constexpr designAlpha = 0.8; if (alpha < designAlpha) { - [self.delegate shouldClose]; + [self.delegate closePlacePage]; } else { diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMiPhonePlacePageLayoutImpl.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMiPhonePlacePageLayoutImpl.mm index cc1fe1966b..d0d9fe4004 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMiPhonePlacePageLayoutImpl.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/MWMiPhonePlacePageLayoutImpl.mm @@ -98,7 +98,7 @@ CGFloat const kMinOffset = 1; [delegate onPlacePageTopBoundChanged:0]; self.actionBar = nil; self.scrollView = nil; - [delegate shouldDestroyLayout]; + [delegate destroyLayout]; }); } @@ -195,7 +195,7 @@ CGFloat const kMinOffset = 1; if (offset.y <= 0) { [delegate onPlacePageTopBoundChanged:0]; - [delegate shouldClose]; + [delegate closePlacePage]; return; }