[ios] Fixed location alert display logic.

This commit is contained in:
Ilya Grechuhin 2016-11-10 10:08:24 +03:00
parent d474805ed7
commit 3d483834f9
4 changed files with 11 additions and 4 deletions

View file

@ -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
{

View file

@ -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];
}

View file

@ -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

View file

@ -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;