forked from organicmaps/organicmaps
Merge pull request #4077 from igrechuhin/beta
[ios] Removed bicycle disclaimer alert.
This commit is contained in:
commit
15ef512bf2
10 changed files with 11 additions and 51 deletions
|
@ -21,7 +21,6 @@
|
|||
- (void)presentFacebookAlert;
|
||||
- (void)presentPoint2PointAlertWithOkBlock:(nonnull TMWMVoidBlock)okBlock needToRebuild:(BOOL)needToRebuild;
|
||||
- (void)presentRoutingDisclaimerAlert;
|
||||
- (void)presentBicycleRoutingDisclaimerAlert;
|
||||
- (void)presentDisabledLocationAlert;
|
||||
- (void)presentLocationAlert;
|
||||
- (void)presentLocationServiceNotSupportedAlert;
|
||||
|
|
|
@ -115,11 +115,6 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController
|
|||
.interfaceOrientation]];
|
||||
}
|
||||
|
||||
- (void)presentBicycleRoutingDisclaimerAlert
|
||||
{
|
||||
[self displayAlert:[MWMAlert routingBicycleDisclaimerAlert]];
|
||||
}
|
||||
|
||||
- (void)presentDisabledLocationAlert { [self displayAlert:MWMAlert.disabledLocationAlert]; }
|
||||
- (void)presentAlert:(routing::IRouter::ResultCode)type
|
||||
{
|
||||
|
|
|
@ -19,7 +19,6 @@ using TMWMDownloadBlock = void (^)(storage::TCountriesVec const &, TMWMVoidBlock
|
|||
+ (MWMAlert *)facebookAlert;
|
||||
+ (MWMAlert *)locationAlert;
|
||||
+ (MWMAlert *)routingDisclaimerAlertWithInitialOrientation:(UIInterfaceOrientation)orientation;
|
||||
+ (MWMAlert *)routingBicycleDisclaimerAlert;
|
||||
+ (MWMAlert *)disabledLocationAlert;
|
||||
+ (MWMAlert *)noWiFiAlertWithOkBlock:(TMWMVoidBlock)okBlock;
|
||||
+ (MWMAlert *)noConnectionAlert;
|
||||
|
|
|
@ -38,11 +38,6 @@
|
|||
return [MWMRoutingDisclaimerAlert alertWithInitialOrientation:orientation];
|
||||
}
|
||||
|
||||
+ (MWMAlert *)routingBicycleDisclaimerAlert
|
||||
{
|
||||
return [MWMDefaultAlert routingBicycleDisclaimerAlert];
|
||||
}
|
||||
|
||||
+ (MWMAlert *)disabledLocationAlert
|
||||
{
|
||||
return [MWMDefaultAlert disabledLocationAlert];
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
+ (instancetype)downloaderInternalErrorAlertWithOkBlock:(TMWMVoidBlock)okBlock cancelBlock:(TMWMVoidBlock)cancelBlock;
|
||||
+ (instancetype)downloaderNeedUpdateAlertWithOkBlock:(TMWMVoidBlock)okBlock;
|
||||
+ (instancetype)routingMigrationAlertWithOkBlock:(TMWMVoidBlock)okBlock;
|
||||
+ (instancetype)routingBicycleDisclaimerAlert;
|
||||
+ (instancetype)resetChangesAlertWithBlock:(TMWMVoidBlock)block;
|
||||
+ (instancetype)deleteFeatureAlertWithBlock:(TMWMVoidBlock)block;
|
||||
+ (instancetype)personalInfoWarningAlertWithBlock:(TMWMVoidBlock)block;
|
||||
|
|
|
@ -340,17 +340,6 @@ static NSString * const kDefaultAlertNibName = @"MWMDefaultAlert";
|
|||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)routingBicycleDisclaimerAlert
|
||||
{
|
||||
kStatisticsEvent = @"Routing Bicycle Disclaimer Alert";
|
||||
MWMDefaultAlert * alert = [self defaultAlertWithTitle:@"whatsnew_cycle_navigation_header"
|
||||
message:@"whatsnew_cycle_navigation_message"
|
||||
rightButtonTitle:@"ok"
|
||||
leftButtonTitle:nil
|
||||
rightButtonAction:nil];
|
||||
return alert;
|
||||
}
|
||||
|
||||
+ (instancetype)resetChangesAlertWithBlock:(TMWMVoidBlock)block
|
||||
{
|
||||
kStatisticsEvent = @"Reset changes alert";
|
||||
|
|
|
@ -242,6 +242,16 @@ bool isMarkerPoint(MWMRoutePoint const & point) { return point.IsValid() && !poi
|
|||
[[MWMNavigationDashboardManager manager] updateFollowingInfo:info];
|
||||
}
|
||||
|
||||
- (void)showDisclaimer
|
||||
{
|
||||
bool isDisclaimerApproved = false;
|
||||
UNUSED_VALUE(settings::Get("IsDisclaimerApproved", isDisclaimerApproved));
|
||||
if (isDisclaimerApproved)
|
||||
return;
|
||||
[[MWMAlertViewController activeAlertController] presentRoutingDisclaimerAlert];
|
||||
settings::Set("IsDisclaimerApproved", true);
|
||||
}
|
||||
|
||||
#pragma mark - MWMLocationObserver
|
||||
|
||||
- (void)onLocationUpdate:(location::GpsInfo const &)info
|
||||
|
@ -284,33 +294,7 @@ bool isMarkerPoint(MWMRoutePoint const & point) { return point.IsValid() && !poi
|
|||
else
|
||||
[[MWMMapViewControlsManager manager] onRouteReady];
|
||||
[self updateFollowingInfo];
|
||||
switch ([self type])
|
||||
{
|
||||
case RouterType::Vehicle:
|
||||
case RouterType::Pedestrian:
|
||||
{
|
||||
bool isDisclaimerApproved = false;
|
||||
(void)settings::Get("IsDisclaimerApproved", isDisclaimerApproved);
|
||||
if (!isDisclaimerApproved)
|
||||
{
|
||||
[[MWMAlertViewController activeAlertController] presentRoutingDisclaimerAlert];
|
||||
settings::Set("IsDisclaimerApproved", true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RouterType::Bicycle:
|
||||
{
|
||||
NSString * bicycleDisclaimer = @"IsBicycleDisclaimerApproved";
|
||||
NSUserDefaults * ud = [NSUserDefaults standardUserDefaults];
|
||||
if (![ud boolForKey:bicycleDisclaimer])
|
||||
{
|
||||
[[MWMAlertViewController activeAlertController] presentBicycleRoutingDisclaimerAlert];
|
||||
[ud setBool:YES forKey:bicycleDisclaimer];
|
||||
[ud synchronize];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
[self showDisclaimer];
|
||||
[[MWMNavigationDashboardManager manager] setRouteBuilderProgress:100];
|
||||
[MWMMapViewControlsManager manager].searchHidden = YES;
|
||||
break;
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 693 B After Width: | Height: | Size: 652 B |
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.2 KiB |
Loading…
Add table
Reference in a new issue