mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-29 17:23:47 +00:00
[ios] Handle distinct FollowAndRotateRoute and FollowAndRotateCompass modes
Signed-off-by: Leonardo Bishop <me@leonardobishop.net>
This commit is contained in:
committed by
Konstantin Pastbin
parent
ee4675b388
commit
d448369c04
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -632,7 +632,8 @@ NSString *const kAboutSegue = @"Map2About";
|
||||
case MWMMyPositionModeNotFollow:
|
||||
break;
|
||||
case MWMMyPositionModeFollow:
|
||||
case MWMMyPositionModeFollowAndRotate:
|
||||
case MWMMyPositionModeFollowAndRotateCompass:
|
||||
case MWMMyPositionModeFollowAndRotateRoute:
|
||||
self.disableStandbyOnLocationStateMode = YES;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<int>(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ NSUInteger constexpr kMaxPredictionCount = 20;
|
||||
|
||||
- (void)setMyPositionMode:(MWMMyPositionMode)mode
|
||||
{
|
||||
self.isLastPositionModeValid = (mode == MWMMyPositionModeFollowAndRotate);
|
||||
self.isLastPositionModeValid = (mode == MWMMyPositionModeFollowAndRotateCompass);
|
||||
[self restart];
|
||||
}
|
||||
|
||||
|
||||
@@ -3,5 +3,6 @@ typedef NS_CLOSED_ENUM(NSUInteger, MWMMyPositionMode) {
|
||||
MWMMyPositionModeNotFollowNoPosition,
|
||||
MWMMyPositionModeNotFollow,
|
||||
MWMMyPositionModeFollow,
|
||||
MWMMyPositionModeFollowAndRotate
|
||||
MWMMyPositionModeFollowAndRotateCompass,
|
||||
MWMMyPositionModeFollowAndRotateRoute
|
||||
};
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/Contents.json
vendored
Normal file
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/Contents.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
BIN
iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/btn_follow_route_dark.png
vendored
Normal file
BIN
iphone/Maps/Images.xcassets/Location/btn_follow_route_dark.imageset/btn_follow_route_dark.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_dark.imageset/Contents.json
vendored
Normal file
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_dark.imageset/Contents.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_light.imageset/Contents.json
vendored
Normal file
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_highlighted_light.imageset/Contents.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/Contents.json
vendored
Normal file
21
iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/Contents.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
BIN
iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/btn_follow_route_light.png
vendored
Normal file
BIN
iphone/Maps/Images.xcassets/Location/btn_follow_route_light.imageset/btn_follow_route_light.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user