From fa21937ca6a7b5e9803304c2b24296c871b32c0f Mon Sep 17 00:00:00 2001 From: Arsentiy Milchakov Date: Mon, 7 Sep 2020 15:19:51 +0300 Subject: [PATCH] [ios][taxi] yango taxi is added --- .../CoreApi/PlacePageData/PlacePageData.h | 1 + .../CoreApi/PlacePageData/PlacePageData.mm | 2 + .../MWMRoutePreviewTaxiCellType.h | 1 + .../RoutePreview/MWMTaxiPreviewDataSource.mm | 7 + .../RoutePreview/RoutePreviewTaxiCell.swift | 5 +- .../Common/Statistics/StatisticsStrings.h | 1 + iphone/Maps/Core/Routing/MWMRouter.mm | 1 + .../ic_taxi_logo_yango.imageset/Contents.json | 12 ++ .../ic_taxi_logo_yango.pdf | 194 ++++++++++++++++++ .../Components/TaxiViewController.swift | 3 + .../PlacePageManager/MWMPlacePageManager.mm | 1 + .../partners_api.xcodeproj/project.pbxproj | 8 + 12 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 iphone/Maps/Images.xcassets/ic_taxi_logo_yango.imageset/Contents.json create mode 100644 iphone/Maps/Images.xcassets/ic_taxi_logo_yango.imageset/ic_taxi_logo_yango.pdf diff --git a/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.h b/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.h index a01d741330..7adfddfbdd 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.h +++ b/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.h @@ -32,6 +32,7 @@ typedef NS_ENUM(NSInteger, PlacePageTaxiProvider) { PlacePageTaxiProviderMaxim, PlacePageTaxiProviderRutaxi, PlacePageTaxiProviderFreenow, + PlacePageTaxiProviderYango, }; typedef NS_ENUM(NSInteger, PlacePageRoadType) { diff --git a/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm b/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm index 726af80466..0dd12ae90c 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm +++ b/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm @@ -49,6 +49,8 @@ static PlacePageTaxiProvider convertTaxiProvider(taxi::Provider::Type providerTy return PlacePageTaxiProviderRutaxi; case taxi::Provider::Freenow: return PlacePageTaxiProviderFreenow; + case taxi::Provider::Yango: + return PlacePageTaxiProviderYango; case taxi::Provider::Count: return PlacePageTaxiProviderNone; } diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMRoutePreviewTaxiCellType.h b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMRoutePreviewTaxiCellType.h index ce6e733881..5e80ff5085 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMRoutePreviewTaxiCellType.h +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMRoutePreviewTaxiCellType.h @@ -5,4 +5,5 @@ typedef NS_ENUM(NSInteger, MWMRoutePreviewTaxiCellType) { MWMRoutePreviewTaxiCellTypeMaxim, MWMRoutePreviewTaxiCellTypeVezet, MWMRoutePreviewTaxiCellTypeFreenow, + MWMRoutePreviewTaxiCellTypeYango, }; diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.mm index cef12a6042..99c5bce3de 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/MWMTaxiPreviewDataSource.mm @@ -141,6 +141,10 @@ using namespace taxi; self.type = MWMRoutePreviewTaxiCellTypeFreenow; providerName = kStatFreenow; break; + case taxi::Provider::Type::Yango: + self.type = MWMRoutePreviewTaxiCellTypeYango; + providerName = kStatYango; + break; case taxi::Provider::Type::Count: LOG(LERROR, ("Incorrect taxi provider")); break; @@ -177,6 +181,7 @@ using namespace taxi; case taxi::Provider::Type::Maxim: provider = kStatMaxim; break; case taxi::Provider::Type::Rutaxi: provider = kStatVezet; break; case taxi::Provider::Type::Freenow: provider = kStatFreenow; break; + case taxi::Provider::Type::Yango: provider = kStatYango; break; case taxi::Provider::Count: LOG(LERROR, ("Incorrect taxi provider")); break; } NSString * errorValue = nil; @@ -210,6 +215,7 @@ using namespace taxi; case MWMRoutePreviewTaxiCellTypeMaxim: url = [NSURL URLWithString:@"maximzakaz://"]; break; case MWMRoutePreviewTaxiCellTypeVezet: url = [NSURL URLWithString:@"vzt://"]; break; case MWMRoutePreviewTaxiCellTypeFreenow: url = [NSURL URLWithString:@"mytaxi://"]; break; + case MWMRoutePreviewTaxiCellTypeYango: url = [NSURL URLWithString:@"yandexyango://"]; break; } return [UIApplication.sharedApplication canOpenURL:url]; } @@ -233,6 +239,7 @@ using namespace taxi; case MWMRoutePreviewTaxiCellTypeMaxim: type = Provider::Type::Maxim; break; case MWMRoutePreviewTaxiCellTypeVezet: type = Provider::Type::Rutaxi; break; case MWMRoutePreviewTaxiCellTypeFreenow: type = Provider::Type::Freenow; break; + case MWMRoutePreviewTaxiCellTypeYango: type = Provider::Type::Yango; break; } auto links = engine->GetRideRequestLinks(type, productId, m_from, m_to); diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewTaxiCell.swift b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewTaxiCell.swift index 5dfa8d84a6..b82956809a 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewTaxiCell.swift +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/RoutePreview/RoutePreviewTaxiCell.swift @@ -14,6 +14,7 @@ final class RoutePreviewTaxiCell: UICollectionViewCell { case .maxim: return #imageLiteral(resourceName: "ic_taxi_logo_maksim") case .vezet: return #imageLiteral(resourceName: "ic_taxi_logo_vezet") case .freenow: return #imageLiteral(resourceName: "ic_logo_freenow") + case .yango: return #imageLiteral(resourceName: "ic_taxi_logo_yango") } } @@ -25,6 +26,7 @@ final class RoutePreviewTaxiCell: UICollectionViewCell { case .maxim: return L("maxim_taxi_title") case .vezet: return L("vezet_taxi") case .freenow: return title + case .yango: return L("yango_taxi_title") } } @@ -34,7 +36,8 @@ final class RoutePreviewTaxiCell: UICollectionViewCell { case .uber: return price case .yandex: fallthrough case .maxim: fallthrough - case .vezet: + case .vezet: fallthrough + case .yango: let formatter = NumberFormatter() formatter.numberStyle = .currency formatter.currencyCode = currency diff --git a/iphone/Maps/Common/Statistics/StatisticsStrings.h b/iphone/Maps/Common/Statistics/StatisticsStrings.h index c9dd80a028..265987e51a 100644 --- a/iphone/Maps/Common/Statistics/StatisticsStrings.h +++ b/iphone/Maps/Common/Statistics/StatisticsStrings.h @@ -586,6 +586,7 @@ static NSString *const kStatWhatsNew = @"WhatsNew_action"; static NSString *const kStatWifi = @"wifi"; static NSString *const kStatWikipedia = @"wikipedia"; static NSString *const kStatYandex = @"Yandex"; +static NSString *const kStatYango = @"Yango"; static NSString *const kStatYes = @"Yes"; static NSString *const kStatZoom = @"Zoom"; static NSString *const kStatId = @"id"; diff --git a/iphone/Maps/Core/Routing/MWMRouter.mm b/iphone/Maps/Core/Routing/MWMRouter.mm index 37c43886fc..25422f745c 100644 --- a/iphone/Maps/Core/Routing/MWMRouter.mm +++ b/iphone/Maps/Core/Routing/MWMRouter.mm @@ -125,6 +125,7 @@ void logPointEvent(MWMRoutePoint * point, NSString * eventType) case MWMRoutePreviewTaxiCellTypeMaxim: provider = kStatMaxim; break; case MWMRoutePreviewTaxiCellTypeVezet: provider = kStatVezet; break; case MWMRoutePreviewTaxiCellTypeFreenow: provider = kStatFreenow; break; + case MWMRoutePreviewTaxiCellTypeYango: provider = kStatYango; break; } [Statistics logEvent:eventName diff --git a/iphone/Maps/Images.xcassets/ic_taxi_logo_yango.imageset/Contents.json b/iphone/Maps/Images.xcassets/ic_taxi_logo_yango.imageset/Contents.json new file mode 100644 index 0000000000..18fb679a81 --- /dev/null +++ b/iphone/Maps/Images.xcassets/ic_taxi_logo_yango.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "ic_taxi_logo_yango.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Images.xcassets/ic_taxi_logo_yango.imageset/ic_taxi_logo_yango.pdf b/iphone/Maps/Images.xcassets/ic_taxi_logo_yango.imageset/ic_taxi_logo_yango.pdf new file mode 100644 index 0000000000..62adbbb6e8 --- /dev/null +++ b/iphone/Maps/Images.xcassets/ic_taxi_logo_yango.imageset/ic_taxi_logo_yango.pdf @@ -0,0 +1,194 @@ +%PDF-1.7 + +1 0 obj + << /Length 2 0 R + /FunctionType 4 + /Domain [ 0.000000 1.000000 ] + /Range [ 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 ] + >> +stream +{ 0.996078 exch 0.478431 exch 0.266667 exch dup 0.000000 gt { exch pop exch pop exch pop dup 0.000000 sub -0.047059 mul 0.996078 add exch dup 0.000000 sub -0.129412 mul 0.478431 add exch dup 0.000000 sub -0.023529 mul 0.266667 add exch } if dup 1.000000 gt { exch pop exch pop exch pop 0.949020 exch 0.349020 exch 0.243137 exch } if pop } +endstream +endobj + +2 0 obj + 339 +endobj + +3 0 obj + << /BBox [ 0.000000 0.000000 24.000000 24.000000 ] + /Resources << /Pattern << /P1 << /Matrix [ 0.000000 -23.999998 23.999998 0.000000 -23.999998 24.000000 ] + /Shading << /Coords [ 0.000000 0.000000 1.000000 0.000000 ] + /Extend [ true true ] + /Domain [ 0.000000 1.000000 ] + /ShadingType 2 + /ColorSpace /DeviceRGB + /Function 1 0 R + >> + /PatternType 2 + /Type /Pattern + >> >> >> + /Subtype /Form + /Length 4 0 R + /Group << /Type /Group + /S /Transparency + >> + /Type /XObject + >> +stream +/DeviceRGB CS +/DeviceRGB cs +q +1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm +/Pattern cs +/P1 scn +0.000000 24.000000 m +24.000000 24.000000 l +24.000000 0.000000 l +0.000000 0.000000 l +0.000000 24.000000 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 -6.156250 2.923828 cm +1.000000 1.000000 1.000000 scn +9.079309 24.796875 m +18.155548 9.076275 l +2.435009 -0.000025 l +-2.577672 8.682274 0.397069 19.784195 9.079309 24.796875 c +h +f* +n +Q +q +1.000000 0.000000 -0.000000 1.000000 -3.718750 -8.734375 cm +0.180392 0.160784 0.149020 scn +24.796900 5.012898 m +16.114601 0.000198 5.012690 2.974899 0.000000 11.657100 c +15.720600 20.733398 l +24.796900 5.012898 l +h +f* +n +Q + +endstream +endobj + +4 0 obj + 668 +endobj + +5 0 obj + << /BBox [ 0.000000 0.000000 24.000000 24.000000 ] + /Resources << >> + /Subtype /Form + /Length 6 0 R + /Group << /Type /Group + /S /Transparency + >> + /Type /XObject + >> +stream +/DeviceRGB CS +/DeviceRGB cs +q +1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm +0.000000 0.000000 0.000000 scn +0.000000 19.000000 m +0.000000 21.761425 2.238576 24.000000 5.000000 24.000000 c +19.000000 24.000000 l +21.761425 24.000000 24.000000 21.761423 24.000000 19.000000 c +24.000000 5.000000 l +24.000000 2.238575 21.761423 0.000000 19.000000 0.000000 c +5.000000 0.000000 l +2.238576 0.000000 0.000000 2.238577 0.000000 5.000000 c +0.000000 19.000000 l +h +f +n +Q + +endstream +endobj + +6 0 obj + 468 +endobj + +7 0 obj + << /XObject << /X1 3 0 R >> + /ExtGState << /E1 << /SMask << /Type /Mask + /G 5 0 R + /S /Alpha + >> + /Type /ExtGState + >> >> + >> +endobj + +8 0 obj + << /Length 9 0 R >> +stream +/DeviceRGB CS +/DeviceRGB cs +q +/E1 gs +/X1 Do +Q + +endstream +endobj + +9 0 obj + 46 +endobj + +10 0 obj + << /Annots [] + /Type /Page + /MediaBox [ 0.000000 0.000000 24.000000 24.000000 ] + /Resources 7 0 R + /Contents 8 0 R + /Parent 11 0 R + >> +endobj + +11 0 obj + << /Kids [ 10 0 R ] + /Count 1 + /Type /Pages + >> +endobj + +12 0 obj + << /Type /Catalog + /Pages 11 0 R + >> +endobj + +xref +0 13 +0000000000 65535 f +0000000010 00000 n +0000000533 00000 n +0000000555 00000 n +0000002213 00000 n +0000002235 00000 n +0000002951 00000 n +0000002973 00000 n +0000003271 00000 n +0000003373 00000 n +0000003394 00000 n +0000003569 00000 n +0000003645 00000 n +trailer +<< /ID [ (some) (id) ] + /Root 12 0 R + /Size 13 +>> +startxref +3706 +%%EOF \ No newline at end of file diff --git a/iphone/Maps/UI/PlacePage/Components/TaxiViewController.swift b/iphone/Maps/UI/PlacePage/Components/TaxiViewController.swift index 426055f25d..a743005009 100644 --- a/iphone/Maps/UI/PlacePage/Components/TaxiViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/TaxiViewController.swift @@ -30,6 +30,9 @@ class TaxiViewController: UIViewController { case .freenow: taxiImageView.image = UIImage(named: "ic_logo_freenow") taxiNameLabel.text = L("freenow_taxi_title") + case .yango: + taxiImageView.image = UIImage(named: "ic_taxi_logo_yango") + taxiNameLabel.text = L("yango_taxi_title") @unknown default: fatalError() } diff --git a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm index 63fe48604f..1ca350e51f 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageManager/MWMPlacePageManager.mm @@ -137,6 +137,7 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type) case PlacePageTaxiProviderMaxim: providerString = kStatMaxim; break; case PlacePageTaxiProviderRutaxi: providerString = kStatVezet; break; case PlacePageTaxiProviderFreenow: providerString = kStatFreenow; break; + case PlacePageTaxiProviderYango: providerString = kStatYango; break; } [Statistics logEvent:kStatPlacePageTaxiClick diff --git a/xcode/partners_api/partners_api.xcodeproj/project.pbxproj b/xcode/partners_api/partners_api.xcodeproj/project.pbxproj index f9eb264188..4a5b93d3d0 100644 --- a/xcode/partners_api/partners_api.xcodeproj/project.pbxproj +++ b/xcode/partners_api/partners_api.xcodeproj/project.pbxproj @@ -39,6 +39,8 @@ 3D4E997C1FB439260025B48C /* booking_availability_params.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3D4E997A1FB439260025B48C /* booking_availability_params.hpp */; }; 3D4E997D1FB439260025B48C /* booking_availability_params.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D4E997B1FB439260025B48C /* booking_availability_params.cpp */; }; 3D4E997F1FB439300025B48C /* utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D4E997E1FB439300025B48C /* utils.cpp */; }; + 3D8DAE7525026B550000513A /* yango_api.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3D8DAE7325026B540000513A /* yango_api.hpp */; }; + 3D8DAE7625026B550000513A /* yango_api.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D8DAE7425026B550000513A /* yango_api.cpp */; }; 3DA5713420B57358007BDE27 /* booking_params_base.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3DA5713320B57358007BDE27 /* booking_params_base.hpp */; }; 3DBD7B9824112DE100ED9FE8 /* freenow_api.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3DBD7B9624112DE000ED9FE8 /* freenow_api.cpp */; }; 3DBD7B9924112DE100ED9FE8 /* freenow_api.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3DBD7B9724112DE100ED9FE8 /* freenow_api.hpp */; }; @@ -160,6 +162,8 @@ 3D4E997A1FB439260025B48C /* booking_availability_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = booking_availability_params.hpp; sourceTree = ""; }; 3D4E997B1FB439260025B48C /* booking_availability_params.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = booking_availability_params.cpp; sourceTree = ""; }; 3D4E997E1FB439300025B48C /* utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = utils.cpp; sourceTree = ""; }; + 3D8DAE7325026B540000513A /* yango_api.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = yango_api.hpp; sourceTree = ""; }; + 3D8DAE7425026B550000513A /* yango_api.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = yango_api.cpp; sourceTree = ""; }; 3DA5713320B57358007BDE27 /* booking_params_base.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = booking_params_base.hpp; sourceTree = ""; }; 3DBC1C501E4B14810016897F /* facebook_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = facebook_tests.cpp; sourceTree = ""; }; 3DBD7B9624112DE000ED9FE8 /* freenow_api.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = freenow_api.cpp; sourceTree = ""; }; @@ -344,6 +348,8 @@ F6B5363B1DA520B20067EEA5 /* partners_api */ = { isa = PBXGroup; children = ( + 3D8DAE7425026B550000513A /* yango_api.cpp */, + 3D8DAE7325026B540000513A /* yango_api.hpp */, 3DCAC69324D1CFE800518E8B /* booking_ordering_params.cpp */, 3DCAC69224D1CFE800518E8B /* booking_ordering_params.hpp */, 3D035CA1245195E600C21B57 /* guides_on_map_api.cpp */, @@ -487,6 +493,7 @@ 3D15ACE7214AA1B000F725D5 /* rutaxi_api.hpp in Headers */, 45C380782094C5B400C18D81 /* partners.hpp in Headers */, 3DBD7B9924112DE100ED9FE8 /* freenow_api.hpp in Headers */, + 3D8DAE7525026B550000513A /* yango_api.hpp in Headers */, 3D15ACE6214AA1B000F725D5 /* taxi_delegate.hpp in Headers */, 3DFEBF9A1EFBFC1500317D5C /* taxi_base.hpp in Headers */, 3DFEBF9F1EFBFC1500317D5C /* yandex_api.hpp in Headers */, @@ -615,6 +622,7 @@ 3D035CA5245195EF00C21B57 /* guides_on_map_tests.cpp in Sources */, 3DBD7C0824251BF000ED9FE8 /* skyeng_ads.cpp in Sources */, 3DBD7BFF24251BF000ED9FE8 /* bookmark_catalog_ads.cpp in Sources */, + 3D8DAE7625026B550000513A /* yango_api.cpp in Sources */, 3D4E997F1FB439300025B48C /* utils.cpp in Sources */, 3D15ACE8214AA1B000F725D5 /* rutaxi_api.cpp in Sources */, 3DBD7B9824112DE100ED9FE8 /* freenow_api.cpp in Sources */,