diff --git a/iphone/Maps/Classes/CarPlay/CarPlayService.swift b/iphone/Maps/Classes/CarPlay/CarPlayService.swift index c39ee3957..c7e9059b8 100644 --- a/iphone/Maps/Classes/CarPlay/CarPlayService.swift +++ b/iphone/Maps/Classes/CarPlay/CarPlayService.swift @@ -239,7 +239,7 @@ final class CarPlayService: NSObject { MapTemplateBuilder.configureBaseUI(mapTemplate: mapTemplate) if currentPositionMode == .pendingPosition { mapTemplate.leadingNavigationBarButtons = [] - } else if currentPositionMode == .follow || currentPositionMode == .followAndRotate { + } else if currentPositionMode == .follow || currentPositionMode == .followAndRotateCompass || currentPositionMode == .followAndRotateRoute { MapTemplateBuilder.setupDestinationButton(mapTemplate: mapTemplate) } else { MapTemplateBuilder.setupRecenterButton(mapTemplate: mapTemplate) @@ -629,7 +629,7 @@ extension CarPlayService: LocationModeListener { return } switch mode { - case .follow, .followAndRotate: + case .follow, .followAndRotateCompass, .followAndRotateRoute: if !rootMapTemplate.isPanningInterfaceVisible { MapTemplateBuilder.setupDestinationButton(mapTemplate: rootMapTemplate) } diff --git a/iphone/Maps/Classes/CarPlay/Template Builders/MapTemplateBuilder.swift b/iphone/Maps/Classes/CarPlay/Template Builders/MapTemplateBuilder.swift index f9cf3694f..c9d978d8e 100644 --- a/iphone/Maps/Classes/CarPlay/Template Builders/MapTemplateBuilder.swift +++ b/iphone/Maps/Classes/CarPlay/Template Builders/MapTemplateBuilder.swift @@ -28,7 +28,7 @@ final class MapTemplateBuilder { configureBaseUI(mapTemplate: mapTemplate) if positionMode == .pendingPosition { mapTemplate.leadingNavigationBarButtons = [] - } else if positionMode == .follow || positionMode == .followAndRotate { + } else if positionMode == .follow || positionMode == .followAndRotateCompass || positionMode == .followAndRotateRoute { setupDestinationButton(mapTemplate: mapTemplate) } else { setupRecenterButton(mapTemplate: mapTemplate) diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/SideButtons/MWMSideButtons.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/SideButtons/MWMSideButtons.mm index 9ebcd49e7..d249868cc 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/SideButtons/MWMSideButtons.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/SideButtons/MWMSideButtons.mm @@ -91,7 +91,8 @@ NSString * const kUDDidShowLongTapToShowSideButtonsToast = @"kUDDidShowLongTapTo case MWMMyPositionModeNotFollow: case MWMMyPositionModeNotFollowNoPosition: [locBtn setStyleNameAndApply: @"ButtonGetPosition"]; break; case MWMMyPositionModeFollow: [locBtn setStyleNameAndApply: @"ButtonFollow"]; break; - case MWMMyPositionModeFollowAndRotate: [locBtn setStyleNameAndApply: @"ButtonFollowAndRotate"]; break; + case MWMMyPositionModeFollowAndRotateCompass: [locBtn setStyleNameAndApply: @"ButtonFollowAndRotateCompass"]; break; + case MWMMyPositionModeFollowAndRotateRoute: [locBtn setStyleNameAndApply: @"ButtonFollowAndRotateRoute"]; break; } } diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index b84aba98f..31413b7bd 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -632,7 +632,8 @@ NSString *const kAboutSegue = @"Map2About"; case MWMMyPositionModeNotFollow: break; case MWMMyPositionModeFollow: - case MWMMyPositionModeFollowAndRotate: + case MWMMyPositionModeFollowAndRotateCompass: + case MWMMyPositionModeFollowAndRotateRoute: self.disableStandbyOnLocationStateMode = YES; break; } diff --git a/iphone/Maps/Core/Location/MWMLocationHelpers.h b/iphone/Maps/Core/Location/MWMLocationHelpers.h index 1d9ef7c91..b608a13a3 100644 --- a/iphone/Maps/Core/Location/MWMLocationHelpers.h +++ b/iphone/Maps/Core/Location/MWMLocationHelpers.h @@ -32,7 +32,8 @@ static inline MWMMyPositionMode mwmMyPositionMode(location::EMyPositionMode mode case location::EMyPositionMode::NotFollowNoPosition: return MWMMyPositionModeNotFollowNoPosition; case location::EMyPositionMode::NotFollow: return MWMMyPositionModeNotFollow; case location::EMyPositionMode::Follow: return MWMMyPositionModeFollow; - case location::EMyPositionMode::FollowAndRotate: return MWMMyPositionModeFollowAndRotate; + case location::EMyPositionMode::FollowAndRotateCompass: return MWMMyPositionModeFollowAndRotateCompass; + case location::EMyPositionMode::FollowAndRotateRoute: return MWMMyPositionModeFollowAndRotateRoute; } } } // namespace location_helpers diff --git a/iphone/Maps/Core/Location/MWMLocationManager.mm b/iphone/Maps/Core/Location/MWMLocationManager.mm index 01600a799..0dddfdcb4 100644 --- a/iphone/Maps/Core/Location/MWMLocationManager.mm +++ b/iphone/Maps/Core/Location/MWMLocationManager.mm @@ -50,7 +50,8 @@ std::string DebugPrint(MWMMyPositionMode mode) { case MWMMyPositionModeNotFollowNoPosition: return "MWMMyPositionModeNotFollowNoPosition"; case MWMMyPositionModeNotFollow: return "MWMMyPositionModeNotFollow"; case MWMMyPositionModeFollow: return "MWMMyPositionModeFollow"; - case MWMMyPositionModeFollowAndRotate: return "MWMMyPositionModeFollowAndRotate"; + case MWMMyPositionModeFollowAndRotateCompass: return "MWMMyPositionModeFollowAndRotateCompass"; + case MWMMyPositionModeFollowAndRotateRoute: return "MWMMyPositionModeFollowAndRotateRoute"; } CHECK(false, ("Unsupported value", static_cast(mode))); } @@ -367,7 +368,8 @@ void setShowLocationAlert(BOOL needShow) { case MWMMyPositionModeNotFollowNoPosition: case MWMMyPositionModeNotFollow: manager.geoMode = GeoMode::NotInPosition; break; case MWMMyPositionModeFollow: manager.geoMode = GeoMode::InPosition; break; - case MWMMyPositionModeFollowAndRotate: manager.geoMode = GeoMode::FollowAndRotate; break; + case MWMMyPositionModeFollowAndRotateCompass: + case MWMMyPositionModeFollowAndRotateRoute: manager.geoMode = GeoMode::FollowAndRotate; break; } } } diff --git a/iphone/Maps/Core/Location/MWMLocationPredictor.mm b/iphone/Maps/Core/Location/MWMLocationPredictor.mm index bf4c9e979..4821e156f 100644 --- a/iphone/Maps/Core/Location/MWMLocationPredictor.mm +++ b/iphone/Maps/Core/Location/MWMLocationPredictor.mm @@ -30,7 +30,7 @@ NSUInteger constexpr kMaxPredictionCount = 20; - (void)setMyPositionMode:(MWMMyPositionMode)mode { - self.isLastPositionModeValid = (mode == MWMMyPositionModeFollowAndRotate); + self.isLastPositionModeValid = (mode == MWMMyPositionModeFollowAndRotateCompass); [self restart]; } diff --git a/iphone/Maps/Core/Location/MWMMyPositionMode.h b/iphone/Maps/Core/Location/MWMMyPositionMode.h index 54171849c..b5ec4b035 100644 --- a/iphone/Maps/Core/Location/MWMMyPositionMode.h +++ b/iphone/Maps/Core/Location/MWMMyPositionMode.h @@ -3,5 +3,6 @@ typedef NS_CLOSED_ENUM(NSUInteger, MWMMyPositionMode) { MWMMyPositionModeNotFollowNoPosition, MWMMyPositionModeNotFollow, MWMMyPositionModeFollow, - MWMMyPositionModeFollowAndRotate + MWMMyPositionModeFollowAndRotateCompass, + MWMMyPositionModeFollowAndRotateRoute }; diff --git a/iphone/Maps/Core/Theme/MapStyleSheet.swift b/iphone/Maps/Core/Theme/MapStyleSheet.swift index 1bb4b98bc..1f89c3966 100644 --- a/iphone/Maps/Core/Theme/MapStyleSheet.swift +++ b/iphone/Maps/Core/Theme/MapStyleSheet.swift @@ -7,7 +7,8 @@ enum MapStyleSheet: String, CaseIterable { case mapButtonPending = "ButtonPending" case mapButtonGetPosition = "ButtonGetPosition" case mapButtonFollow = "ButtonFollow" - case mapButtonFollowAndRotate = "ButtonFollowAndRotate" + case mapButtonFollowAndRotateCompass = "ButtonFollowAndRotateCompass" + case mapButtonFollowAndRotateRoute = "ButtonFollowAndRotateRoute" case mapButtonMapBookmarks = "ButtonMapBookmarks" case mapPromoDiscoveryButton = "PromoDiscroveryButton" case mapButtonBookmarksBack = "ButtonBookmarksBack" @@ -67,10 +68,14 @@ extension MapStyleSheet: IStyleSheet { return .add { s in s.mwmImage = "btn_follow" } - case .mapButtonFollowAndRotate: + case .mapButtonFollowAndRotateCompass: return .add { s in s.mwmImage = "btn_follow_and_rotate" } + case .mapButtonFollowAndRotateRoute: + return .add { s in + s.mwmImage = "btn_follow_route" + } case .mapButtonMapBookmarks: return .add { s in s.mwmImage = "ic_routing_bookmark" diff --git a/iphone/Maps/Images.xcassets/Location/Contents.json b/iphone/Maps/Images.xcassets/Location/Contents.json index da4a164c9..73c00596a 100644 --- a/iphone/Maps/Images.xcassets/Location/Contents.json +++ b/iphone/Maps/Images.xcassets/Location/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/Location/btn_follow_route_dark.imageset/Contents.json b/iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/Contents.json new file mode 100644 index 000000000..757ebad60 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "btn_follow_route_dark.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/btn_follow_route_dark.png b/iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/btn_follow_route_dark.png new file mode 100644 index 000000000..0180fb5bf Binary files /dev/null and b/iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/btn_follow_route_dark.png differ diff --git a/iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_dark.imageset/Contents.json b/iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_dark.imageset/Contents.json new file mode 100644 index 000000000..b7f6ffa50 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_dark.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "btn_follow_route_highlighted_dark.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_dark.imageset/btn_follow_route_highlighted_dark.png b/iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_dark.imageset/btn_follow_route_highlighted_dark.png new file mode 100644 index 000000000..b2e704475 Binary files /dev/null and b/iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_dark.imageset/btn_follow_route_highlighted_dark.png differ diff --git a/iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_light.imageset/Contents.json b/iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_light.imageset/Contents.json new file mode 100644 index 000000000..86998adb2 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_light.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "btn_follow_route_highlighted_light.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_light.imageset/btn_follow_route_highlighted_light.png b/iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_light.imageset/btn_follow_route_highlighted_light.png new file mode 100644 index 000000000..49137d0e5 Binary files /dev/null and b/iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_light.imageset/btn_follow_route_highlighted_light.png differ diff --git a/iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/Contents.json b/iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/Contents.json new file mode 100644 index 000000000..29f0bd7cc --- /dev/null +++ b/iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "btn_follow_route_light.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/btn_follow_route_light.png b/iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/btn_follow_route_light.png new file mode 100644 index 000000000..833063175 Binary files /dev/null and b/iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/btn_follow_route_light.png differ