[MAPSME-6918] [ios] Added taxi maxim support.

This commit is contained in:
Ilya Grechuhin 2018-02-28 14:52:19 +03:00 committed by Roman Kuznetsov
parent 815412aca8
commit ca36fd901f
12 changed files with 36 additions and 3 deletions

View file

@ -1,5 +1,6 @@
typedef NS_ENUM(NSInteger, MWMRoutePreviewTaxiCellType) {
MWMRoutePreviewTaxiCellTypeTaxi,
MWMRoutePreviewTaxiCellTypeUber,
MWMRoutePreviewTaxiCellTypeYandex
MWMRoutePreviewTaxiCellTypeYandex,
MWMRoutePreviewTaxiCellTypeMaxim
};

View file

@ -129,6 +129,10 @@ using namespace taxi;
self.type = MWMRoutePreviewTaxiCellTypeYandex;
providerName = kStatYandex;
break;
case taxi::Provider::Type::Maxim:
self.type = MWMRoutePreviewTaxiCellTypeMaxim;
providerName = kStatMaxim;
break;
}
[Statistics logEvent:kStatRoutingBuildTaxi withParameters:@{@"provider": providerName}];
auto cv = self.collectionView;
@ -159,6 +163,7 @@ using namespace taxi;
{
case taxi::Provider::Type::Uber: provider = kStatUber; break;
case taxi::Provider::Type::Yandex: provider = kStatYandex; break;
case taxi::Provider::Type::Maxim: provider = kStatMaxim; break;
}
NSString * errorValue = nil;
switch (errorCode)
@ -189,6 +194,7 @@ using namespace taxi;
case MWMRoutePreviewTaxiCellTypeTaxi: return NO;
case MWMRoutePreviewTaxiCellTypeUber: url = [NSURL URLWithString:@"uber://"]; break;
case MWMRoutePreviewTaxiCellTypeYandex: url = [NSURL URLWithString:@"yandextaxi://"]; break;
case MWMRoutePreviewTaxiCellTypeMaxim: url = [NSURL URLWithString:@"maximzakaz://"]; break;
}
return [UIApplication.sharedApplication canOpenURL:url];
}
@ -210,6 +216,7 @@ using namespace taxi;
case MWMRoutePreviewTaxiCellTypeTaxi: return;
case MWMRoutePreviewTaxiCellTypeUber: type = Provider::Type::Uber; break;
case MWMRoutePreviewTaxiCellTypeYandex: type = Provider::Type::Yandex; break;
case MWMRoutePreviewTaxiCellTypeMaxim: type = Provider::Type::Maxim; break;
}
auto links = engine->GetRideRequestLinks(type, productId, m_from, m_to);

View file

@ -22,6 +22,7 @@ final class RoutePreviewTaxiCell: UICollectionViewCell {
case .taxi: return #imageLiteral(resourceName: "icTaxiTaxi")
case .uber: return #imageLiteral(resourceName: "icTaxiUber")
case .yandex: return #imageLiteral(resourceName: "ic_taxi_logo_yandex")
case .maxim: return #imageLiteral(resourceName: "ic_taxi_logo_maksim")
}
}
@ -30,6 +31,7 @@ final class RoutePreviewTaxiCell: UICollectionViewCell {
case .taxi: fallthrough
case .uber: return title
case .yandex: return L("yandex_taxi_title")
case .maxim: return L("maxim_taxi_title")
}
}
@ -37,7 +39,8 @@ final class RoutePreviewTaxiCell: UICollectionViewCell {
switch type {
case .taxi: fallthrough
case .uber: return price
case .yandex:
case .yandex: fallthrough
case .maxim:
let formatter = NumberFormatter()
formatter.numberStyle = .currency
formatter.currencyCode = currency

View file

@ -173,6 +173,7 @@ static NSString * const kStatMapSearch = @"Map search";
static NSString * const kStatMapViewStyle = @"Map view style";
static NSString * const kStatMapViewStyleSettings = @"Map view style settings";
static NSString * const kStatMapsme = @"maps.me";
static NSString * const kStatMaxim = @"Maxim";
static NSString * const kStatMenu = @"Menu";
static NSString * const kStatMigrationBig2SmallMWM = @"Big mwms to small mwms migration counter";
static NSString * const kStatMiles = @"Miles";

View file

@ -122,6 +122,7 @@ void logPointEvent(MWMRoutePoint * point, NSString * eventType)
case MWMRoutePreviewTaxiCellTypeTaxi: provider = kStatUnknown; break;
case MWMRoutePreviewTaxiCellTypeUber: provider = kStatUber; break;
case MWMRoutePreviewTaxiCellTypeYandex: provider = kStatYandex; break;
case MWMRoutePreviewTaxiCellTypeMaxim: provider = kStatMaxim; break;
}
[Statistics logEvent:eventName

View file

@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_taxi_logo_maksim.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View file

@ -97,6 +97,7 @@ NSString * const kUserDefaultsLatLonAsDMSKey = @"UserDefaultsLatLonAsDMS";
{
case taxi::Provider::Uber: provider = kStatUber; break;
case taxi::Provider::Yandex: provider = kStatYandex; break;
case taxi::Provider::Maxim: provider = kStatMaxim; break;
}
[Statistics logEvent:kStatPlacepageTaxiShow withParameters:@{ @"provider" : provider }];
}

View file

@ -347,6 +347,7 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName)
case MWMPlacePageTaxiProviderTaxi: providerString = kStatUnknown; break;
case MWMPlacePageTaxiProviderUber: providerString = kStatUber; break;
case MWMPlacePageTaxiProviderYandex: providerString = kStatYandex; break;
case MWMPlacePageTaxiProviderMaxim: providerString = kStatMaxim; break;
}
[Statistics logEvent:kStatPlacePageTaxiClick
withParameters:@{kStatProvider : providerString, kStatTags : data.statisticsTags}];

View file

@ -1,5 +1,6 @@
typedef NS_ENUM(NSInteger, MWMPlacePageTaxiProvider) {
MWMPlacePageTaxiProviderTaxi,
MWMPlacePageTaxiProviderUber,
MWMPlacePageTaxiProviderYandex
MWMPlacePageTaxiProviderYandex,
MWMPlacePageTaxiProviderMaxim
};

View file

@ -37,6 +37,9 @@ final class PlacePageTaxiCell: MWMTableViewCell {
case .yandex:
icon.image = #imageLiteral(resourceName: "ic_taxi_logo_yandex")
title.text = L("yandex_taxi_title")
case .maxim:
icon.image = #imageLiteral(resourceName: "ic_taxi_logo_maksim")
title.text = L("maxim_taxi_title")
}
}

View file

@ -376,6 +376,7 @@ map<MetainfoRows, Class> const kMetaInfoCells = {
{
case taxi::Provider::Uber: type = MWMPlacePageTaxiProviderUber; break;
case taxi::Provider::Yandex: type = MWMPlacePageTaxiProviderYandex; break;
case taxi::Provider::Maxim: type = MWMPlacePageTaxiProviderMaxim; break;
}
[c configWithType:type delegate:delegate];
self.taxiCell = c;
@ -595,6 +596,7 @@ map<MetainfoRows, Class> const kMetaInfoCells = {
{
case taxi::Provider::Uber: provider = kStatUber; break;
case taxi::Provider::Yandex: provider = kStatYandex; break;
case taxi::Provider::Maxim: provider = kStatMaxim; break;
}
[Statistics logEvent:kStatPlacepageTaxiShow
withParameters:@{kStatProvider: provider, kStatPlacement: kStatPlacePage}];