From 3d483834f98098318b93d3f0c0d2c43d3cf916c2 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Thu, 10 Nov 2016 10:08:24 +0300 Subject: [ios] Fixed location alert display logic. --- .../Classes/CustomAlert/AlertController/MWMAlertViewController.mm | 7 ++++++- iphone/Maps/Classes/Location/MWMLocationManager.mm | 3 ++- iphone/Maps/Classes/MapViewController.h | 2 ++ iphone/Maps/Classes/MapViewController.mm | 3 +-- 4 files changed, 11 insertions(+), 4 deletions(-) (limited to 'iphone') diff --git a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm index c9638674cb..37bea44e92 100644 --- a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm +++ b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm @@ -3,6 +3,7 @@ #import "MWMController.h" #import "MWMDownloadTransitMapAlert.h" #import "MWMLocationAlert.h" +#import "MapViewController.h" #import "MapsAppDelegate.h" static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController"; @@ -47,7 +48,11 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController #pragma mark - Actions - (void)presentRateAlert { [self displayAlert:MWMAlert.rateAlert]; } -- (void)presentLocationAlert { [self displayAlert:[MWMAlert locationAlert]]; } +- (void)presentLocationAlert +{ + if (![MapViewController controller].pageViewController) + [self displayAlert:[MWMAlert locationAlert]]; +} - (void)presentPoint2PointAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild { diff --git a/iphone/Maps/Classes/Location/MWMLocationManager.mm b/iphone/Maps/Classes/Location/MWMLocationManager.mm index 1a9badb41c..1664abf3fb 100644 --- a/iphone/Maps/Classes/Location/MWMLocationManager.mm +++ b/iphone/Maps/Classes/Location/MWMLocationManager.mm @@ -294,7 +294,6 @@ void setPermissionRequested() if (self.lastLocationInfo == locationInfo) return; self.lastLocationInfo = locationInfo; - self.lastLocationStatus = location::TLocationError::ENoError; [self.predictor reset:gpsInfo]; } @@ -453,6 +452,8 @@ void setPermissionRequested() // So we filter out such events completely. if (location.horizontalAccuracy < 0.) return; + + self.lastLocationStatus = location::TLocationError::ENoError; [self processLocationUpdate:location]; [[Statistics instance] logLocation:location]; } diff --git a/iphone/Maps/Classes/MapViewController.h b/iphone/Maps/Classes/MapViewController.h index aaa01fb826..fb9a5ce144 100644 --- a/iphone/Maps/Classes/MapViewController.h +++ b/iphone/Maps/Classes/MapViewController.h @@ -1,4 +1,5 @@ #import "MWMMapDownloaderTypes.h" +#import "MWMPageController.h" #import "MWMViewController.h" #include "geometry/point2d.hpp" @@ -38,5 +39,6 @@ struct AddressInfo; @property(nonatomic, readonly) MWMMapViewControlsManager * controlsManager; @property(nonatomic) MWMAPIBar * apiBar; +@property(nonatomic) MWMPageController * pageViewController; @end diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index ef91871ee1..69ed7669f0 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -18,7 +18,6 @@ #import "MWMMapDownloadDialog.h" #import "MWMMapDownloaderViewController.h" #import "MWMMapViewControlsManager.h" -#import "MWMPageController.h" #import "MWMPlacePageData.h" #import "MWMPlacePageEntity.h" #import "MWMPlacePageProtocol.h" @@ -110,7 +109,7 @@ BOOL gIsFirstMyPositionMode = YES; @property(nonatomic) BOOL disableStandbyOnLocationStateMode; @property(nonatomic) UserTouchesAction userTouchesAction; -@property(nonatomic) MWMPageController * pageViewController; + @property(nonatomic) MWMMapDownloadDialog * downloadDialog; @property(nonatomic) BOOL skipForceTouch; -- cgit v1.2.3