diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.h b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.h index 164502b04d..85b5d5b087 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.h @@ -19,6 +19,8 @@ - (instancetype)initWithParentController:(MapViewController *)controller delegate:(id)delegate; +- (void)onEnterForeground; + - (void)setStreetName:(NSString *)streetName; - (void)setPlanning; - (void)setGo; diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.mm index 170cafde5f..436639c768 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.mm @@ -103,6 +103,11 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) GetFramework().GetLocationState()->RemoveStateModeListener(self.locationListenerSlot); } +- (void)onEnterForeground +{ + [self onLocationStateModeChanged:GetFramework().GetLocationState()->GetMode()]; +} + #pragma mark - Layout - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h index bb1f0b2a20..695e7541d1 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.h @@ -17,6 +17,8 @@ - (instancetype)init __attribute__((unavailable("init is not available"))); - (instancetype)initWithParentController:(MapViewController *)controller; +- (void)onEnterForeground; + #pragma mark - Layout - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm index 12034a381e..cb90131177 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm @@ -59,6 +59,11 @@ extern NSString * const kAlohalyticsTapEventKey; return self; } +- (void)onEnterForeground +{ + [self.menuController onEnterForeground]; +} + #pragma mark - Layout - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index f240d10d50..9a33573818 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -493,7 +493,10 @@ typedef NS_ENUM(NSUInteger, UserTouchesAction) GetFramework().EnterForeground(); if (self.isViewLoaded && self.view.window) + { [self invalidate]; // only invalidate when map is displayed on the screen + [self.controlsManager onEnterForeground]; + } } - (void)viewWillAppear:(BOOL)animated