diff --git a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h index 5fb84da1fb..cae78cc886 100644 --- a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h +++ b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.h @@ -14,6 +14,7 @@ - (void)presentRoutingDisclaimerAlertWithOkBlock:(nonnull nonnull MWMVoidBlock)block; - (void)presentDisabledLocationAlert; - (void)presentLocationAlertWithCancelBlock:(MWMVoidBlock _Nonnull )cancelBlock; +- (void)presentLocationServicesDisabledAlert; - (void)presentLocationServiceNotSupportedAlert; - (void)presentLocationNotFoundAlertWithOkBlock:(nonnull MWMVoidBlock)okBlock; - (void)presentNoConnectionAlert; diff --git a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm index 2ec8701c91..0e58d21e69 100644 --- a/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm +++ b/iphone/Maps/Classes/CustomAlert/AlertController/MWMAlertViewController.mm @@ -115,6 +115,11 @@ static NSString *const kAlertControllerNibIdentifier = @"MWMAlertViewController" - (void)presentDisabledLocationAlert { [self displayAlert:[MWMAlert disabledLocationAlert]]; } + +- (void)presentLocationServicesDisabledAlert; { + [self displayAlert:[MWMAlert locationServicesDisabledAlert]]; +} + - (void)presentAlert:(routing::RouterResultCode)type { [self displayAlert:[MWMAlert alert:type]]; } diff --git a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h index a804fdd17c..a4083b48eb 100644 --- a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h +++ b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.h @@ -7,6 +7,7 @@ + (MWMAlert *)locationAlertWithCancelBlock:(MWMVoidBlock)cancelBlock; + (MWMAlert *)routingDisclaimerAlertWithOkBlock:(MWMVoidBlock)block; + (MWMAlert *)disabledLocationAlert; ++ (MWMAlert *)locationServicesDisabledAlert; + (MWMAlert *)noWiFiAlertWithOkBlock:(MWMVoidBlock)okBlock andCancelBlock:(MWMVoidBlock)cancelBlock; + (MWMAlert *)noConnectionAlert; + (MWMAlert *)searchQuickFilterNoConnectionAlert; diff --git a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm index 5ed275adb5..e47a9b42e6 100644 --- a/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/BaseAlert/MWMAlert.mm @@ -31,6 +31,11 @@ + (MWMAlert *)disabledLocationAlert { return [MWMDefaultAlert disabledLocationAlert]; } + ++ (MWMAlert *)locationServicesDisabledAlert { + return [LocationServicesDisabledAlert alert]; +} + + (MWMAlert *)noWiFiAlertWithOkBlock:(MWMVoidBlock)okBlock andCancelBlock:(MWMVoidBlock)cancelBlock { return [MWMDefaultAlert noWiFiAlertWithOkBlock:okBlock andCancelBlock:cancelBlock]; } diff --git a/iphone/Maps/Classes/CustomAlert/LocationAlert/LocationServicesDisabledAlert.swift b/iphone/Maps/Classes/CustomAlert/LocationAlert/LocationServicesDisabledAlert.swift new file mode 100644 index 0000000000..a99d5862e6 --- /dev/null +++ b/iphone/Maps/Classes/CustomAlert/LocationAlert/LocationServicesDisabledAlert.swift @@ -0,0 +1,18 @@ +import UIKit + +final class LocationServicesDisabledAlert: MWMAlert { + + @objc + class func alert() -> LocationServicesDisabledAlert? { + guard let alert = Bundle.main.loadNibNamed("LocationServicesDisabledAlert", owner: nil)?.first as? LocationServicesDisabledAlert else { + assertionFailure("Error: LocationServicesDisabledAlert failed lo load from nib.") + return nil + } + alert.setNeedsCloseAfterEnterBackground() + return alert + } + + @IBAction func okButtonDidTap(_ sender: Any) { + close(nil) + } +} diff --git a/iphone/Maps/Classes/CustomAlert/LocationAlert/LocationServicesDisabledAlert.xib b/iphone/Maps/Classes/CustomAlert/LocationAlert/LocationServicesDisabledAlert.xib new file mode 100644 index 0000000000..80bc09ec8d --- /dev/null +++ b/iphone/Maps/Classes/CustomAlert/LocationAlert/LocationServicesDisabledAlert.xib @@ -0,0 +1,268 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iphone/Maps/Core/Location/MWMLocationManager.mm b/iphone/Maps/Core/Location/MWMLocationManager.mm index d95b593bfc..b18e9ed5fc 100644 --- a/iphone/Maps/Core/Location/MWMLocationManager.mm +++ b/iphone/Maps/Core/Location/MWMLocationManager.mm @@ -289,6 +289,12 @@ void setShowLocationAlert(BOOL needShow) { }]; } break; + case MWMLocationStatusGPSIsOff: + if (needShowLocationAlert()) { + [[MWMAlertViewController activeAlertController] presentLocationServicesDisabledAlert]; + setShowLocationAlert(NO); + } + break; } } diff --git a/iphone/Maps/Images.xcassets/NewDialog/Contents.json b/iphone/Maps/Images.xcassets/NewDialog/Contents.json index da4a164c91..73c00596a7 100644 --- a/iphone/Maps/Images.xcassets/NewDialog/Contents.json +++ b/iphone/Maps/Images.xcassets/NewDialog/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/iphone/Maps/Images.xcassets/NewDialog/ic_privacy.imageset/Contents.json b/iphone/Maps/Images.xcassets/NewDialog/ic_privacy.imageset/Contents.json new file mode 100644 index 0000000000..eb1b6de5de --- /dev/null +++ b/iphone/Maps/Images.xcassets/NewDialog/ic_privacy.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "ic_privacy.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "original" + } +} diff --git a/iphone/Maps/Images.xcassets/NewDialog/ic_privacy.imageset/ic_privacy.pdf b/iphone/Maps/Images.xcassets/NewDialog/ic_privacy.imageset/ic_privacy.pdf new file mode 100644 index 0000000000..0b1e1a60cc --- /dev/null +++ b/iphone/Maps/Images.xcassets/NewDialog/ic_privacy.imageset/ic_privacy.pdf @@ -0,0 +1,121 @@ +%PDF-1.7 + +1 0 obj + << >> +endobj + +2 0 obj + << /Length 3 0 R >> +stream +/DeviceRGB CS +/DeviceRGB cs +q +1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm +1.000000 1.000000 1.000000 scn +0.000000 14.000000 m +0.000000 15.656855 1.343146 17.000000 3.000000 17.000000 c +14.000000 17.000000 l +15.656855 17.000000 17.000000 15.656855 17.000000 14.000000 c +17.000000 3.000000 l +17.000000 1.343145 15.656854 0.000000 14.000000 0.000000 c +3.000000 0.000000 l +1.343146 0.000000 0.000000 1.343146 0.000000 3.000000 c +0.000000 14.000000 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm +0.000000 0.478431 1.000000 scn +2.986610 0.000000 m +14.013391 0.000000 l +15.980183 0.000000 17.000000 1.019817 17.000000 2.959292 c +17.000000 14.040707 l +17.000000 15.989287 15.980183 17.000000 14.013391 17.000000 c +2.986610 17.000000 l +1.019818 17.000000 0.000000 15.989287 0.000000 14.040707 c +0.000000 2.959292 l +0.000000 1.010712 1.019818 0.000000 2.986610 0.000000 c +h +4.662024 6.747188 m +4.662024 11.782539 l +4.662024 12.128548 4.935190 12.401714 5.290306 12.401714 c +5.618104 12.401714 5.891270 12.128548 5.891270 11.782539 c +5.891270 8.632030 l +6.027852 8.713980 6.155330 8.795929 6.310123 8.859668 c +6.310123 13.439743 l +6.310123 13.776647 6.592394 14.040707 6.920193 14.040707 c +7.266202 14.040707 7.539368 13.776647 7.539368 13.439743 c +7.539368 9.232994 l +7.685056 9.260311 7.830745 9.278522 7.976433 9.296732 c +7.976433 13.876808 l +7.976433 14.213712 8.249599 14.495983 8.595608 14.495983 c +8.932512 14.495983 9.205678 14.213712 9.205678 13.876808 c +9.205678 9.232994 l +9.351366 9.196571 9.497054 9.151045 9.624532 9.114622 c +9.624532 13.130156 l +9.624532 13.457954 9.897697 13.740225 10.234601 13.740225 c +10.571506 13.740225 10.844671 13.457954 10.844671 13.130156 c +10.844671 7.557579 l +10.844671 7.402785 10.908409 7.339046 11.008570 7.339046 c +11.081414 7.339046 11.154259 7.393680 11.217997 7.548473 c +11.964649 9.132833 l +12.192287 9.615425 12.410820 9.824852 12.775041 9.806642 c +13.093734 9.797536 13.312266 9.560793 13.303161 9.251205 c +13.284949 8.978040 13.075522 8.377075 12.920729 7.885378 c +12.611141 6.883771 12.274237 5.809319 11.791645 4.998928 c +11.044992 3.587573 9.952331 2.968398 8.386181 2.968398 c +6.219068 2.968398 4.662024 4.407070 4.662024 6.747188 c +h +f +n +Q + +endstream +endobj + +3 0 obj + 2226 +endobj + +4 0 obj + << /Annots [] + /Type /Page + /MediaBox [ 0.000000 0.000000 17.000000 17.000000 ] + /Resources 1 0 R + /Contents 2 0 R + /Parent 5 0 R + >> +endobj + +5 0 obj + << /Kids [ 4 0 R ] + /Count 1 + /Type /Pages + >> +endobj + +6 0 obj + << /Pages 5 0 R + /Type /Catalog + >> +endobj + +xref +0 7 +0000000000 65535 f +0000000010 00000 n +0000000034 00000 n +0000002316 00000 n +0000002339 00000 n +0000002512 00000 n +0000002586 00000 n +trailer +<< /ID [ (some) (id) ] + /Root 6 0 R + /Size 7 +>> +startxref +2645 +%%EOF \ No newline at end of file diff --git a/iphone/Maps/Images.xcassets/NewDialog/ic_swither.imageset/Contents.json b/iphone/Maps/Images.xcassets/NewDialog/ic_swither.imageset/Contents.json new file mode 100644 index 0000000000..74c1049f03 --- /dev/null +++ b/iphone/Maps/Images.xcassets/NewDialog/ic_swither.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "instruction_switch.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Images.xcassets/NewDialog/ic_swither.imageset/instruction_switch.svg b/iphone/Maps/Images.xcassets/NewDialog/ic_swither.imageset/instruction_switch.svg new file mode 100644 index 0000000000..b24a6a4c07 --- /dev/null +++ b/iphone/Maps/Images.xcassets/NewDialog/ic_swither.imageset/instruction_switch.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index e1914ff9a2..2b4dbc4a9a 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -465,6 +465,8 @@ CDCA278622451F5000167D87 /* RouteInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDCA278522451F5000167D87 /* RouteInfo.swift */; }; CDCA278E2248F34C00167D87 /* MWMRoutingManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA278B2248F34C00167D87 /* MWMRoutingManager.mm */; }; ED3EAC202B03C88100220A4A /* BottomTabBarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED3EAC1F2B03C88100220A4A /* BottomTabBarButton.swift */; }; + EDBD68072B625724005DD151 /* LocationServicesDisabledAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = EDBD68062B625724005DD151 /* LocationServicesDisabledAlert.xib */; }; + EDBD680B2B62572E005DD151 /* LocationServicesDisabledAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDBD680A2B62572E005DD151 /* LocationServicesDisabledAlert.swift */; }; F607C1881C032A8800B53A87 /* resources-hdpi_clear in Resources */ = {isa = PBXBuildFile; fileRef = F607C1831C032A8800B53A87 /* resources-hdpi_clear */; }; F607C18A1C032A8800B53A87 /* resources-hdpi_dark in Resources */ = {isa = PBXBuildFile; fileRef = F607C1841C032A8800B53A87 /* resources-hdpi_dark */; }; F623DA6C1C9C2731006A3436 /* opening_hours_how_to_edit.html in Resources */ = {isa = PBXBuildFile; fileRef = F623DA6A1C9C2731006A3436 /* opening_hours_how_to_edit.html */; }; @@ -1332,6 +1334,8 @@ ED3EAC1F2B03C88100220A4A /* BottomTabBarButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomTabBarButton.swift; sourceTree = ""; }; ED48BBB817C2B1E2003E7E92 /* CircleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleView.h; sourceTree = ""; }; ED48BBB917C2B1E2003E7E92 /* CircleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CircleView.m; sourceTree = ""; }; + EDBD68062B625724005DD151 /* LocationServicesDisabledAlert.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LocationServicesDisabledAlert.xib; sourceTree = ""; }; + EDBD680A2B62572E005DD151 /* LocationServicesDisabledAlert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationServicesDisabledAlert.swift; sourceTree = ""; }; EE026F0511D6AC0D00645242 /* classificator.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = classificator.txt; path = ../../data/classificator.txt; sourceTree = SOURCE_ROOT; }; EE164810135CEE49003B8A3E /* 06_code2000.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = 06_code2000.ttf; path = ../../data/06_code2000.ttf; sourceTree = SOURCE_ROOT; }; EE583CBA12F773F00042CBE3 /* unicode_blocks.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = unicode_blocks.txt; path = ../../data/unicode_blocks.txt; sourceTree = ""; }; @@ -1719,7 +1723,6 @@ F607C18B1C047FCA00B53A87 /* Segue */, 340837101B7243B500B5C185 /* Share */, F6588E291B15C25C00EE1E58 /* TextView */, - 34FE4C421BCC013500066718 /* Widgets */, FA8E808825F412E2002A1434 /* FirstSession.mm */, FA8E808A25F41337002A1434 /* FirstSession.h */, ); @@ -3050,6 +3053,7 @@ F6588E291B15C25C00EE1E58 /* TextView */ = { isa = PBXGroup; children = ( + 34FE4C421BCC013500066718 /* Widgets */, F6588E2A1B15C26700EE1E58 /* MWMTextView.h */, F6588E2B1B15C26700EE1E58 /* MWMTextView.m */, ); @@ -3072,6 +3076,8 @@ F6BBF2C41B4FFB72000CF8E2 /* MWMLocationAlert.h */, F6BBF2C51B4FFB72000CF8E2 /* MWMLocationAlert.m */, F6BBF2C71B4FFB8C000CF8E2 /* MWMLocationAlert.xib */, + EDBD680A2B62572E005DD151 /* LocationServicesDisabledAlert.swift */, + EDBD68062B625724005DD151 /* LocationServicesDisabledAlert.xib */, ); path = LocationAlert; sourceTree = ""; @@ -3765,6 +3771,7 @@ 34F73F9F1E082FF800AC1FD6 /* Localizable.strings in Resources */, 340E1EF21E2F614400CE49BF /* Main.storyboard in Resources */, F6E2FE521E097BA00083EBEC /* MWMActionBarButton.xib in Resources */, + EDBD68072B625724005DD151 /* LocationServicesDisabledAlert.xib in Resources */, 993DF0CA23F6BD0600AC231A /* ElevationDetailsViewController.xib in Resources */, F623DA6F1C9C2E62006A3436 /* MWMAddPlaceNavigationBar.xib in Resources */, 6741A9991BF340DE002C974C /* MWMAlertViewController.xib in Resources */, @@ -4188,6 +4195,7 @@ F6E2FE131E097BA00083EBEC /* MWMOpeningHoursTimeSelectorTableViewCell.mm in Sources */, F626D52F1C3E83F800C17D15 /* MWMTableViewCell.m in Sources */, 34AB66591FC5AA330078E451 /* TransportTransitFlowLayout.swift in Sources */, + EDBD680B2B62572E005DD151 /* LocationServicesDisabledAlert.swift in Sources */, 3486B5191E27AD3B0069C126 /* MWMFrameworkListener.mm in Sources */, 3404756B1E081A4600C92850 /* MWMSearch+CoreSpotlight.mm in Sources */, CD9AD96C2281B56900EC174A /* CPViewPortState.swift in Sources */,