diff --git a/iphone/CoreApi/CoreApi.xcodeproj/project.pbxproj b/iphone/CoreApi/CoreApi.xcodeproj/project.pbxproj index 55d0470e14..009bf9ec03 100644 --- a/iphone/CoreApi/CoreApi.xcodeproj/project.pbxproj +++ b/iphone/CoreApi/CoreApi.xcodeproj/project.pbxproj @@ -19,6 +19,7 @@ 471AB99123AB931000F56D49 /* MWMMapSearchResult+Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 471AB98F23AB931000F56D49 /* MWMMapSearchResult+Core.h */; }; 475784C22344B422008291A4 /* Framework.h in Headers */ = {isa = PBXBuildFile; fileRef = 475784C02344B421008291A4 /* Framework.h */; settings = {ATTRIBUTES = (Public, ); }; }; 475784C32344B422008291A4 /* Framework.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 475784C12344B422008291A4 /* Framework.cpp */; }; + 47938905239A932D006ECACC /* UgcSummaryRatingType.h in Headers */ = {isa = PBXBuildFile; fileRef = 47938904239A92F8006ECACC /* UgcSummaryRatingType.h */; settings = {ATTRIBUTES = (Public, ); }; }; 47942D6B237CC3D600DEFAE3 /* PlacePageData.h in Headers */ = {isa = PBXBuildFile; fileRef = 47942D51237CC3B500DEFAE3 /* PlacePageData.h */; settings = {ATTRIBUTES = (Public, ); }; }; 47942D6C237CC3DE00DEFAE3 /* PlacePageData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 47942D52237CC3B500DEFAE3 /* PlacePageData.mm */; }; 47942D6D237CC3E300DEFAE3 /* PlacePagePreviewData.h in Headers */ = {isa = PBXBuildFile; fileRef = 47942D53237CC3B500DEFAE3 /* PlacePagePreviewData.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -97,6 +98,9 @@ 47F4F1F923A3336C0022FD56 /* MWMMapNodeAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 47F4F1F723A3336B0022FD56 /* MWMMapNodeAttributes.h */; settings = {ATTRIBUTES = (Public, ); }; }; 47F4F1FA23A3336C0022FD56 /* MWMMapNodeAttributes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 47F4F1F823A3336C0022FD56 /* MWMMapNodeAttributes.mm */; }; 47F4F1FD23A3D1AC0022FD56 /* MWMMapNodeAttributes+Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 47F4F1FB23A3D1AC0022FD56 /* MWMMapNodeAttributes+Core.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 47F701EF238C86F000D18E95 /* PlacePageButtonsData.h in Headers */ = {isa = PBXBuildFile; fileRef = 47F701ED238C86F000D18E95 /* PlacePageButtonsData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 47F701F0238C86F000D18E95 /* PlacePageButtonsData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 47F701EE238C86F000D18E95 /* PlacePageButtonsData.mm */; }; + 47F701F3238C877C00D18E95 /* PlacePageButtonsData+Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 47F701F1238C877C00D18E95 /* PlacePageButtonsData+Core.h */; }; 99103843237EDFA200893C9F /* DeepLinkData.h in Headers */ = {isa = PBXBuildFile; fileRef = 99103841237EDFA200893C9F /* DeepLinkData.h */; settings = {ATTRIBUTES = (Public, ); }; }; 99103844237EDFA200893C9F /* DeepLinkData.m in Sources */ = {isa = PBXBuildFile; fileRef = 99103842237EDFA200893C9F /* DeepLinkData.m */; }; 993F54F2237C5D1100545511 /* PromoDiscoveryCampaignAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 993F54EE237C5D1000545511 /* PromoDiscoveryCampaignAdapter.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -112,9 +116,6 @@ 9957FAE9237AE5B000855F48 /* Logger.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9957FAE7237AE5B000855F48 /* Logger.mm */; }; 999D3A64237B097C00C5F7A8 /* DeepLinkSubscriptionData.h in Headers */ = {isa = PBXBuildFile; fileRef = 999D3A62237B097C00C5F7A8 /* DeepLinkSubscriptionData.h */; settings = {ATTRIBUTES = (Public, ); }; }; 999D3A65237B097C00C5F7A8 /* DeepLinkSubscriptionData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 999D3A63237B097C00C5F7A8 /* DeepLinkSubscriptionData.mm */; }; - 47F701EF238C86F000D18E95 /* PlacePageButtonsData.h in Headers */ = {isa = PBXBuildFile; fileRef = 47F701ED238C86F000D18E95 /* PlacePageButtonsData.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 47F701F0238C86F000D18E95 /* PlacePageButtonsData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 47F701EE238C86F000D18E95 /* PlacePageButtonsData.mm */; }; - 47F701F3238C877C00D18E95 /* PlacePageButtonsData+Core.h in Headers */ = {isa = PBXBuildFile; fileRef = 47F701F1238C877C00D18E95 /* PlacePageButtonsData+Core.h */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -134,6 +135,7 @@ 471AB98F23AB931000F56D49 /* MWMMapSearchResult+Core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MWMMapSearchResult+Core.h"; sourceTree = ""; }; 475784C02344B421008291A4 /* Framework.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Framework.h; sourceTree = ""; }; 475784C12344B422008291A4 /* Framework.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Framework.cpp; sourceTree = ""; }; + 47938904239A92F8006ECACC /* UgcSummaryRatingType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UgcSummaryRatingType.h; sourceTree = ""; }; 47942D51237CC3B500DEFAE3 /* PlacePageData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlacePageData.h; sourceTree = ""; }; 47942D52237CC3B500DEFAE3 /* PlacePageData.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PlacePageData.mm; sourceTree = ""; }; 47942D53237CC3B500DEFAE3 /* PlacePagePreviewData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlacePagePreviewData.h; sourceTree = ""; }; @@ -217,6 +219,8 @@ 47F701ED238C86F000D18E95 /* PlacePageButtonsData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlacePageButtonsData.h; sourceTree = ""; }; 47F701EE238C86F000D18E95 /* PlacePageButtonsData.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PlacePageButtonsData.mm; sourceTree = ""; }; 47F701F1238C877C00D18E95 /* PlacePageButtonsData+Core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PlacePageButtonsData+Core.h"; sourceTree = ""; }; + 99103841237EDFA200893C9F /* DeepLinkData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DeepLinkData.h; sourceTree = ""; }; + 99103842237EDFA200893C9F /* DeepLinkData.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DeepLinkData.m; sourceTree = ""; }; 991CE2E82375AF19009EB02A /* PromoAfterBookingCampaignAdapter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PromoAfterBookingCampaignAdapter.mm; sourceTree = ""; }; 991CE2E92375AF19009EB02A /* PromoAfterBookingCampaignAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PromoAfterBookingCampaignAdapter.h; sourceTree = ""; }; 991CE2EC2375AF25009EB02A /* PromoDiscoveryCampaignAdapter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PromoDiscoveryCampaignAdapter.h; sourceTree = ""; }; @@ -377,6 +381,7 @@ 47942D68237CC3B500DEFAE3 /* UgcData.mm */, 47942DAC2382ABE100DEFAE3 /* UgcSummaryRating.h */, 47942DAD2382ABE100DEFAE3 /* UgcSummaryRating.mm */, + 47938904239A92F8006ECACC /* UgcSummaryRatingType.h */, ); path = UGC; sourceTree = ""; @@ -629,10 +634,9 @@ 47C637D72354AEBE00E12DE0 /* MWMTrafficManager.h in Headers */, 993F54F2237C5D1100545511 /* PromoDiscoveryCampaignAdapter.h in Headers */, 99447849238559F2004DAEE5 /* DeeplinkParsingResult.h in Headers */, - 991CE2EB2375AF19009EB02A /* PromoAfterBookingCampaignAdapter.h in Headers */, - 991CE2EF2375AF4E009EB02A /* PromoDiscoveryCampaignAdapter.h in Headers */, 47942D9C237D927800DEFAE3 /* PlacePageBookmarkData.h in Headers */, 47942D75237CC41A00DEFAE3 /* HotelBookingData+Core.h in Headers */, + 47938905239A932D006ECACC /* UgcSummaryRatingType.h in Headers */, 47942D72237CC40B00DEFAE3 /* OpeningHours.h in Headers */, 47C637D72354AEBE00E12DE0 /* MWMTrafficManager.h in Headers */, 47942D6B237CC3D600DEFAE3 /* PlacePageData.h in Headers */, @@ -731,7 +735,6 @@ 47C637DC2354B79B00E12DE0 /* MWMSearchFrameworkHelper.mm in Sources */, 993F54F4237C5D1100545511 /* PromoDiscoveryCampaignAdapter.mm in Sources */, 479F7062234FBC4700011E2E /* MWMCarPlayBookmarkObject.mm in Sources */, - 991CE2EA2375AF19009EB02A /* PromoAfterBookingCampaignAdapter.mm in Sources */, 47942D95237D673E00DEFAE3 /* CatalogPromoItem.mm in Sources */, 47942D6C237CC3DE00DEFAE3 /* PlacePageData.mm in Sources */, 47942DAF2382ABE100DEFAE3 /* UgcSummaryRating.mm in Sources */, diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h index acb3f26c57..b25668c579 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h @@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly, nullable) NSString *address; @property(nonatomic, readonly, nullable) NSString *rawCoordinates; @property(nonatomic, readonly, nullable) NSString *formattedCoordinates; +@property(nonatomic, readonly, nullable) NSString *localAdsUrl; @property(nonatomic, readonly) BOOL wifiAvailable; @property(nonatomic, readonly) PlacePageDataLocalAdsStatus localAdsStatus; diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm index b167f60859..d9b9b76279 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm @@ -70,6 +70,7 @@ static PlacePageDataLocalAdsStatus convertLocalAdsStatus(LocalAdsStatus status) _rawCoordinates = @(rawData.GetFormattedCoordinate(true).c_str()); _formattedCoordinates = @(rawData.GetFormattedCoordinate(false).c_str()); _localAdsStatus = convertLocalAdsStatus(rawData.GetLocalAdsStatus()); + _localAdsUrl = rawData.GetLocalAdsUrl().empty() ? nil : @(rawData.GetLocalAdsUrl().c_str()); } return self; } diff --git a/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.h b/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.h index 8612966f53..86bc88e39b 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.h +++ b/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.h @@ -50,9 +50,20 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) BOOL isLargeToponim; @property(nonatomic, readonly) BOOL isSightseeing; @property(nonatomic, readonly) BOOL isPromoCatalog; +@property(nonatomic, readonly) BOOL isPartner; @property(nonatomic, readonly) BOOL shouldShowUgc; @property(nonatomic, readonly) BOOL isMyPosition; +@property(nonatomic, readonly) NSInteger partnerIndex; +@property(nonatomic, readonly, nullable) NSString *partnerName; @property(nonatomic, readonly) CLLocationCoordinate2D locationCoordinate; +@property(nonatomic, readonly) NSArray *ratingCategories; +@property(nonatomic, readonly) NSString *statisticsTags; +@property(nonatomic, readonly, nullable) NSString *sponsoredURL; +@property(nonatomic, readonly, nullable) NSString *sponsoredDescriptionURL; +@property(nonatomic, readonly, nullable) NSString *sponsoredMoreURL; +@property(nonatomic, readonly, nullable) NSString *sponsoredReviewURL; +@property(nonatomic, readonly, nullable) NSString *sponsoredDeeplink; + - (void)loadOnlineDataWithCompletion:(MWMVoidBlock)completion; - (void)loadUgcWithCompletion:(MWMVoidBlock)completion; diff --git a/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm b/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm index 818ec8986e..5b3fdea77f 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm +++ b/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm @@ -80,9 +80,32 @@ static PlacePageTaxiProvider convertTaxiProvider(taxi::Provider::Type providerTy _isPromoCatalog = _isLargeToponim || _isSightseeing; _shouldShowUgc = rawData().ShouldShowUGC(); _isMyPosition = rawData().IsMyPosition(); + _isPartner = rawData().GetSponsoredType() == place_page::SponsoredType::Partner; + _partnerIndex = _isPartner ? rawData().GetPartnerIndex() : -1; + _partnerName = _isPartner ? @(rawData().GetPartnerName().c_str()) : nil; _bookingSearchUrl = rawData().GetBookingSearchUrl().empty() ? nil : @(rawData().GetBookingSearchUrl().c_str()); auto latlon = rawData().GetLatLon(); _locationCoordinate = CLLocationCoordinate2DMake(latlon.m_lat, latlon.m_lon); + + NSMutableArray *ratingCategoriesArray = [NSMutableArray array]; + for (auto ratingCategory : rawData().GetRatingCategories()) { + [ratingCategoriesArray addObject:@(ratingCategory.c_str())]; + } + _ratingCategories = [ratingCategoriesArray copy]; + + NSMutableArray *tagsArray = [NSMutableArray array]; + for (auto const & s : rawData().GetRawTypes()) { + [tagsArray addObject:@(s.c_str())]; + } + _statisticsTags = [tagsArray componentsJoinedByString:@", "]; + + if (rawData().IsSponsored()) { + _sponsoredURL = @(rawData().GetSponsoredUrl().c_str()); + _sponsoredDescriptionURL = @(rawData().GetSponsoredDescriptionUrl().c_str()); + _sponsoredMoreURL = @(rawData().GetSponsoredMoreUrl().c_str()); + _sponsoredReviewURL = @(rawData().GetSponsoredReviewUrl().c_str()); + _sponsoredDeeplink = @(rawData().GetSponsoredDeepLink().c_str()); + } } return self; } diff --git a/iphone/CoreApi/CoreApi/PlacePageData/UGC/UgcSummaryRating.h b/iphone/CoreApi/CoreApi/PlacePageData/UGC/UgcSummaryRating.h index c96d46811f..0ab2e2865c 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/UGC/UgcSummaryRating.h +++ b/iphone/CoreApi/CoreApi/PlacePageData/UGC/UgcSummaryRating.h @@ -1,13 +1,6 @@ #import -typedef NS_ENUM(NSInteger, UgcSummaryRatingType) { - UgcSummaryRatingTypeNone, - UgcSummaryRatingTypeHorrible, - UgcSummaryRatingTypeBad, - UgcSummaryRatingTypeNormal, - UgcSummaryRatingTypeGood, - UgcSummaryRatingTypeExcellent -}; +#import "UgcSummaryRatingType.h" NS_ASSUME_NONNULL_BEGIN diff --git a/iphone/CoreApi/CoreApi/PlacePageData/UGC/UgcSummaryRatingType.h b/iphone/CoreApi/CoreApi/PlacePageData/UGC/UgcSummaryRatingType.h new file mode 100644 index 0000000000..baedb004ee --- /dev/null +++ b/iphone/CoreApi/CoreApi/PlacePageData/UGC/UgcSummaryRatingType.h @@ -0,0 +1,8 @@ +typedef NS_ENUM(NSInteger, UgcSummaryRatingType) { + UgcSummaryRatingTypeNone, + UgcSummaryRatingTypeHorrible, + UgcSummaryRatingTypeBad, + UgcSummaryRatingTypeNormal, + UgcSummaryRatingTypeGood, + UgcSummaryRatingTypeExcellent +}; diff --git a/iphone/Maps/Bridging-Header.h b/iphone/Maps/Bridging-Header.h index 9d3d21de86..e394a6313c 100644 --- a/iphone/Maps/Bridging-Header.h +++ b/iphone/Maps/Bridging-Header.h @@ -57,7 +57,6 @@ #import "MWMPlacePageManagerHelper.h" #import "MWMPlacePageTaxiProvider.h" #import "MWMPushNotifications.h" -#import "MWMRatingSummaryViewValueType.h" #import "MWMReviewsViewModelProtocol.h" #import "MWMRouteManagerPointType.h" #import "MWMRoutePreviewTaxiCellType.h" diff --git a/iphone/Maps/Classes/Components/MWMMailViewController.m b/iphone/Maps/Classes/Components/MWMMailViewController.m index 88a2134727..459d016d40 100644 --- a/iphone/Maps/Classes/Components/MWMMailViewController.m +++ b/iphone/Maps/Classes/Components/MWMMailViewController.m @@ -6,6 +6,7 @@ { [super viewDidLoad]; self.navigationBar.tintColor = UIColor.whiteColor; + self.navigationBar.barTintColor = UIColor.primary; } - (UIStatusBarStyle)preferredStatusBarStyle diff --git a/iphone/Maps/Classes/Components/RatingSummaryView/MWMRatingSummaryViewValueType.h b/iphone/Maps/Classes/Components/RatingSummaryView/MWMRatingSummaryViewValueType.h deleted file mode 100644 index d18a14dd4b..0000000000 --- a/iphone/Maps/Classes/Components/RatingSummaryView/MWMRatingSummaryViewValueType.h +++ /dev/null @@ -1,8 +0,0 @@ -typedef NS_ENUM(NSUInteger, MWMRatingSummaryViewValueType) { - MWMRatingSummaryViewValueTypeNoValue, - MWMRatingSummaryViewValueTypeHorrible, - MWMRatingSummaryViewValueTypeBad, - MWMRatingSummaryViewValueTypeNormal, - MWMRatingSummaryViewValueTypeGood, - MWMRatingSummaryViewValueTypeExcellent -}; diff --git a/iphone/Maps/Classes/Components/RatingSummaryView/RatingSummaryView.swift b/iphone/Maps/Classes/Components/RatingSummaryView/RatingSummaryView.swift index c9ec22a6a1..6a4c2572be 100644 --- a/iphone/Maps/Classes/Components/RatingSummaryView/RatingSummaryView.swift +++ b/iphone/Maps/Classes/Components/RatingSummaryView/RatingSummaryView.swift @@ -8,7 +8,7 @@ final class RatingSummaryView: UIView { } } - var type = MWMRatingSummaryViewValueType.noValue { + var type = UgcSummaryRatingType.none { didSet { guard oldValue != type else { return } update() @@ -88,17 +88,17 @@ final class RatingSummaryView: UIView { } @IBInspectable var noValueImage: UIImage? { - get { return settings.images[.noValue] } + get { return settings.images[.none] } set { - settings.images[.noValue] = newValue + settings.images[.none] = newValue update() } } @IBInspectable var noValueColor: UIColor? { - get { return settings.colors[.noValue] } + get { return settings.colors[.none] } set { - settings.colors[.noValue] = newValue + settings.colors[.none] = newValue update() } } diff --git a/iphone/Maps/Classes/Components/RatingSummaryView/RatingSummaryViewSettings.swift b/iphone/Maps/Classes/Components/RatingSummaryView/RatingSummaryViewSettings.swift index 29937468a0..74f0c617a0 100644 --- a/iphone/Maps/Classes/Components/RatingSummaryView/RatingSummaryViewSettings.swift +++ b/iphone/Maps/Classes/Components/RatingSummaryView/RatingSummaryViewSettings.swift @@ -3,15 +3,15 @@ import UIKit struct RatingSummaryViewSettings { enum Default { static let backgroundOpacity: CGFloat = 0.16 - static let colors: [MWMRatingSummaryViewValueType: UIColor] = [ - .noValue: UIColor.lightGray, + static let colors: [UgcSummaryRatingType: UIColor] = [ + .none: UIColor.lightGray, .horrible: UIColor.red, .bad: UIColor.orange, .normal: UIColor.yellow, .good: UIColor.green, .excellent: UIColor.blue, ] - static let images: [MWMRatingSummaryViewValueType: UIImage] = [:] + static let images: [UgcSummaryRatingType: UIImage] = [:] static let textFont = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.footnote) static let textSize = textFont.pointSize static let value = "2.2" diff --git a/iphone/Maps/Classes/MapViewController.h b/iphone/Maps/Classes/MapViewController.h index 784bf639a9..f77f92b528 100644 --- a/iphone/Maps/Classes/MapViewController.h +++ b/iphone/Maps/Classes/MapViewController.h @@ -28,8 +28,7 @@ - (void)openBookmarks; - (void)openMapsDownloader:(MWMMapDownloaderMode)mode; - (void)openEditor; -- (void)openHotelFacilities; -- (void)openBookmarkEditorWithData:(MWMPlacePageData *)data; +- (void)openBookmarkEditor; - (void)openFullPlaceDescriptionWithHtml:(NSString *)htmlString; - (void)showUGCAuth; - (void)showBookmarksLoadedAlert:(UInt64)categoryId; diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 49551bf737..2fc245fc38 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -7,7 +7,6 @@ #import #import "MWMEditBookmarkController.h" #import "MWMEditorViewController.h" -#import "MWMFacilitiesController.h" #import "MWMFrameworkListener.h" #import "MWMFrameworkStorageObserver.h" #import "MWMFrameworkObservers.h" @@ -48,7 +47,6 @@ NSString * const kDownloaderSegue = @"Map2MapDownloaderSegue"; NSString * const kEditorSegue = @"Map2EditorSegue"; NSString * const kUDViralAlertWasShown = @"ViralAlertWasShown"; NSString * const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing"; -NSString * const kHotelFacilitiesSegue = @"Map2FacilitiesSegue"; } // namespace @interface NSValueWrapper : NSObject @@ -454,7 +452,7 @@ NSString * const kHotelFacilitiesSegue = @"Map2FacilitiesSegue"; { using namespace osm_auth_ios; - auto const & featureID = [self.controlsManager.featureHolder featureId]; + auto const & featureID = GetFramework().GetCurrentPlacePageInfo().GetID(); [Statistics logEvent:kStatEditorEditStart withParameters:@{ @@ -466,14 +464,9 @@ NSString * const kHotelFacilitiesSegue = @"Map2FacilitiesSegue"; [self performSegueWithIdentifier:kEditorSegue sender:self.controlsManager.featureHolder]; } -- (void)openHotelFacilities +- (void)openBookmarkEditor { - [self performSegueWithIdentifier:kHotelFacilitiesSegue sender:self.controlsManager.bookingInfoHolder]; -} - -- (void)openBookmarkEditorWithData:(MWMPlacePageData *)data -{ - [self performSegueWithIdentifier:kPP2BookmarkEditingSegue sender:data]; + [self performSegueWithIdentifier:kPP2BookmarkEditingSegue sender:nil]; } - (void)openFullPlaceDescriptionWithHtml:(NSString *)htmlString @@ -753,8 +746,8 @@ NSString * const kHotelFacilitiesSegue = @"Map2FacilitiesSegue"; } else if ([segue.identifier isEqualToString:kPP2BookmarkEditingSegue]) { - MWMEditBookmarkController * dvc = segue.destinationViewController; - dvc.data = static_cast(sender); +// MWMEditBookmarkController * dvc = segue.destinationViewController; +// dvc.data = static_cast(sender); } else if ([segue.identifier isEqualToString:kDownloaderSegue]) { @@ -772,13 +765,6 @@ NSString * const kHotelFacilitiesSegue = @"Map2FacilitiesSegue"; MWMAuthorizationWebViewLoginViewController * dvc = segue.destinationViewController; dvc.authType = MWMWebViewAuthorizationTypeGoogle; } - else if ([segue.identifier isEqualToString:kHotelFacilitiesSegue]) - { - MWMFacilitiesController * dvc = segue.destinationViewController; - auto bookingInfo = id(sender); - dvc.facilities = bookingInfo.hotelFacilities; - dvc.hotelName = bookingInfo.hotelName; - } } #pragma mark - MWMKeyboard diff --git a/iphone/Maps/Classes/Share/MWMActivityViewController.h b/iphone/Maps/Classes/Share/MWMActivityViewController.h index dda9a0c26a..b86ae1dfa7 100644 --- a/iphone/Maps/Classes/Share/MWMActivityViewController.h +++ b/iphone/Maps/Classes/Share/MWMActivityViewController.h @@ -1,4 +1,5 @@ @protocol MWMPlacePageObject; +@class PlacePageData; @interface MWMActivityViewController : UIActivityViewController @@ -8,6 +9,8 @@ + (instancetype)shareControllerForPlacePageObject:(id)object; ++ (instancetype)shareControllerForPlacePage:(PlacePageData *)data; + + (instancetype)shareControllerForURL:(NSURL * _Nullable)url message:(NSString *)message completionHandler: diff --git a/iphone/Maps/Classes/Share/MWMActivityViewController.mm b/iphone/Maps/Classes/Share/MWMActivityViewController.mm index feaf47bbf5..846b355da5 100644 --- a/iphone/Maps/Classes/Share/MWMActivityViewController.mm +++ b/iphone/Maps/Classes/Share/MWMActivityViewController.mm @@ -34,14 +34,19 @@ return shareVC; } -+ (instancetype)shareControllerForPlacePageObject:(id)object -{ - MWMShareActivityItem * item = [[MWMShareActivityItem alloc] initForPlacePageObject:object]; ++ (instancetype)shareControllerForPlacePage:(PlacePageData *)data { + MWMShareActivityItem * item = [[MWMShareActivityItem alloc] initForPlacePage:data]; MWMActivityViewController *shareVC = [[self alloc] initWithActivityItem:item]; shareVC.excludedActivityTypes = [shareVC.excludedActivityTypes arrayByAddingObject:UIActivityTypeAirDrop]; return shareVC; } ++ (instancetype)shareControllerForPlacePageObject:(id)object +{ + NSAssert(false, @"deprecated"); + return nil; +} + + (instancetype)shareControllerForURL:(NSURL *)url message:(NSString *)message completionHandler: diff --git a/iphone/Maps/Classes/Share/MWMShareActivityItem.h b/iphone/Maps/Classes/Share/MWMShareActivityItem.h index fd66a31d41..f445c5b8a1 100644 --- a/iphone/Maps/Classes/Share/MWMShareActivityItem.h +++ b/iphone/Maps/Classes/Share/MWMShareActivityItem.h @@ -16,9 +16,12 @@ class LatLon; @end +@class PlacePageData; + @interface MWMShareActivityItem : NSObject - (instancetype)initForMyPositionAtLocation:(CLLocationCoordinate2D const &)location; - (instancetype)initForPlacePageObject:(id)object; +- (instancetype)initForPlacePage:(PlacePageData *)data; @end diff --git a/iphone/Maps/Classes/Share/MWMShareActivityItem.mm b/iphone/Maps/Classes/Share/MWMShareActivityItem.mm index 69afcf90d9..8c403de80a 100644 --- a/iphone/Maps/Classes/Share/MWMShareActivityItem.mm +++ b/iphone/Maps/Classes/Share/MWMShareActivityItem.mm @@ -4,6 +4,9 @@ #import "3party/Alohalytics/src/alohalytics_objc.h" #include +#import +#import +#import NSString * httpGe0Url(NSString * shortUrl) { @@ -13,7 +16,7 @@ NSString * httpGe0Url(NSString * shortUrl) @interface MWMShareActivityItem () -@property(nonatomic) id object; +@property(nonatomic) PlacePageData *data; @property(nonatomic) CLLocationCoordinate2D location; @property(nonatomic) BOOL isMyPosition; @@ -34,13 +37,18 @@ NSString * httpGe0Url(NSString * shortUrl) - (instancetype)initForPlacePageObject:(id)object { + NSAssert(false, @"deprecated"); + + return nil; +} + +- (instancetype)initForPlacePage:(PlacePageData *)data { self = [super init]; if (self) { - NSAssert(object, @"Entity can't be nil!"); - BOOL const isMyPosition = object.isMyPosition; - _isMyPosition = isMyPosition; - _object = object; + NSAssert(data, @"Entity can't be nil!"); + _isMyPosition = data.isMyPosition; + _data = data; } return self; } @@ -49,23 +57,24 @@ NSString * httpGe0Url(NSString * shortUrl) { auto & f = GetFramework(); - auto const title = ^NSString *(id obj) + auto const title = ^NSString *(PlacePageData *data) { - if (!obj || obj.isMyPosition) + if (!data || data.isMyPosition) return L(@"core_my_position"); - else if (obj.title.length) - return obj.title; - else if (obj.subtitle.length) - return obj.subtitle; - else if (obj.address.length) - return obj.address; + else if (data.previewData.title.length > 0) + return data.previewData.title; + else if (data.previewData.subtitle.length) + return data.previewData.subtitle; + else if (data.previewData.address.length) + return data.previewData.address; else return @""; }; - ms::LatLon const ll = self.object ? self.object.latLon + ms::LatLon const ll = self.data ? ms::LatLon(self.data.locationCoordinate.latitude, + self.data.locationCoordinate.longitude) : ms::LatLon(self.location.latitude, self.location.longitude); - std::string const & s = f.CodeGe0url(ll.m_lat, ll.m_lon, f.GetDrawScale(), title(self.object).UTF8String); + std::string const & s = f.CodeGe0url(ll.m_lat, ll.m_lon, f.GetDrawScale(), title(self.data).UTF8String); NSString * url = @(s.c_str()); if (!isShort) @@ -107,7 +116,7 @@ NSString * httpGe0Url(NSString * shortUrl) NSString * shortUrl = [self url:YES]; return [NSString stringWithFormat:@"%@\n%@", httpGe0Url(shortUrl), self.isMyPosition ? L(@"my_position_share_email_subject") - : self.object.title]; + : self.data.previewData.title]; } - (NSString *)itemDefaultWithActivityType:(NSString *)activityType @@ -124,17 +133,17 @@ NSString * httpGe0Url(NSString * shortUrl) } NSMutableString * result = [L(@"sharing_call_action_look") mutableCopy]; - std::vector strings{self.object.title, - self.object.subtitle, - self.object.address, - self.object.phoneNumber, + std::vector strings{self.data.previewData.title, + self.data.previewData.subtitle, + self.data.previewData.address, + self.data.infoData.phone, url, ge0Url}; - if (self.object.isBooking) + if (self.data.previewData.isBookingPlace) { strings.push_back(L(@"sharing_booking")); - strings.push_back(self.object.sponsoredDescriptionURL.absoluteString); + strings.push_back(self.data.sponsoredDescriptionURL); } for (auto const & str : strings) diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 91c945b3e4..93e9877070 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -705,7 +705,7 @@ F653CE121C6DEC8E00A453F1 /* MWMDropDown.m in Sources */ = {isa = PBXBuildFile; fileRef = F653CE101C6DEB5A00A453F1 /* MWMDropDown.m */; }; F653CE191C71F62700A453F1 /* MWMAddPlaceNavigationBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = F653CE151C71F60200A453F1 /* MWMAddPlaceNavigationBar.mm */; }; F6550C1F1FD81B3800352D88 /* RatingSummaryView+DefaultConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6550C1D1FD81B3800352D88 /* RatingSummaryView+DefaultConfig.swift */; }; - F6558DA21E642CC0002203AE /* MWMFacilitiesController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6558DA01E642CC0002203AE /* MWMFacilitiesController.mm */; }; + F6558DA21E642CC0002203AE /* MWMFacilitiesController.m in Sources */ = {isa = PBXBuildFile; fileRef = F6558DA01E642CC0002203AE /* MWMFacilitiesController.m */; }; F655C027207278300048A241 /* DiscoveryMoreCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F655C026207278300048A241 /* DiscoveryMoreCell.swift */; }; F655C02920727A630048A241 /* DiscoveryMoreCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F655C02820727A630048A241 /* DiscoveryMoreCell.xib */; }; F65D1E1A20E4F11600FE31DD /* ugc_migration in Resources */ = {isa = PBXBuildFile; fileRef = F65D1E1920E4F11600FE31DD /* ugc_migration */; }; @@ -1138,7 +1138,6 @@ 348B926B1FF3B5E100379009 /* UIView+Animation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Animation.swift"; sourceTree = ""; }; 348F8A4D1F863A8500060C2A /* UGCYourReview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UGCYourReview.swift; sourceTree = ""; }; 348F8A511F863B6100060C2A /* UGCReview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UGCReview.swift; sourceTree = ""; }; - 348F8A551F864A1700060C2A /* MWMRatingSummaryViewValueType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMRatingSummaryViewValueType.h; sourceTree = ""; }; 3490D2D91CE9DD2500D0B838 /* MWMSideButtons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSideButtons.h; sourceTree = ""; }; 3490D2DA1CE9DD2500D0B838 /* MWMSideButtons.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSideButtons.mm; sourceTree = ""; }; 3490D2DB1CE9DD2500D0B838 /* MWMSideButtonsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSideButtonsView.h; sourceTree = ""; }; @@ -1889,7 +1888,7 @@ F653CE171C71F62400A453F1 /* MWMAddPlaceNavigationBar.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMAddPlaceNavigationBar.xib; sourceTree = ""; }; F6550C1D1FD81B3800352D88 /* RatingSummaryView+DefaultConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RatingSummaryView+DefaultConfig.swift"; sourceTree = ""; }; F6558D9F1E642CC0002203AE /* MWMFacilitiesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMFacilitiesController.h; sourceTree = ""; }; - F6558DA01E642CC0002203AE /* MWMFacilitiesController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMFacilitiesController.mm; sourceTree = ""; }; + F6558DA01E642CC0002203AE /* MWMFacilitiesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMFacilitiesController.m; sourceTree = ""; }; F655C026207278300048A241 /* DiscoveryMoreCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscoveryMoreCell.swift; sourceTree = ""; }; F655C02820727A630048A241 /* DiscoveryMoreCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DiscoveryMoreCell.xib; sourceTree = ""; }; F6588E2A1B15C26700EE1E58 /* MWMTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMTextView.h; sourceTree = ""; }; @@ -2787,7 +2786,6 @@ children = ( 344BEAF01F66BDC30045DC45 /* RatingSummaryView.swift */, 344BEAF11F66BDC30045DC45 /* RatingSummaryViewSettings.swift */, - 348F8A551F864A1700060C2A /* MWMRatingSummaryViewValueType.h */, ); path = RatingSummaryView; sourceTree = ""; @@ -4164,7 +4162,7 @@ isa = PBXGroup; children = ( F6558D9F1E642CC0002203AE /* MWMFacilitiesController.h */, - F6558DA01E642CC0002203AE /* MWMFacilitiesController.mm */, + F6558DA01E642CC0002203AE /* MWMFacilitiesController.m */, ); name = Controllers; path = ../Controllers; @@ -5530,7 +5528,7 @@ 47B9065421C7FA400079C85E /* UIImageView+WebImage.m in Sources */, F6E2FF481E097BA00083EBEC /* SettingsTableViewSelectableCell.swift in Sources */, 34BBD6581F826F810070CA50 /* AuthorizationTransitioningManager.swift in Sources */, - F6558DA21E642CC0002203AE /* MWMFacilitiesController.mm in Sources */, + F6558DA21E642CC0002203AE /* MWMFacilitiesController.m in Sources */, 33F7668F21A57CDF00A88B16 /* EditOnWebViewController.swift in Sources */, 34AB664A1FC5AA330078E451 /* RouteManageriPadPresentationController.swift in Sources */, B366130A20D5E2E000E7DC3E /* CatalogCategoryCell.swift in Sources */, diff --git a/iphone/Maps/UI/Discovery/Collection Cells/DiscoveryBookingCell.swift b/iphone/Maps/UI/Discovery/Collection Cells/DiscoveryBookingCell.swift index d97c8e3d9b..c4766e93cd 100644 --- a/iphone/Maps/UI/Discovery/Collection Cells/DiscoveryBookingCell.swift +++ b/iphone/Maps/UI/Discovery/Collection Cells/DiscoveryBookingCell.swift @@ -67,7 +67,7 @@ final class DiscoveryBookingCell: UICollectionViewCell { } } - private func setRating(_ ratingValue: String, _ ratingType: MWMRatingSummaryViewValueType) { + private func setRating(_ ratingValue: String, _ ratingType: UgcSummaryRatingType) { rating.value = ratingValue rating.type = ratingType } @@ -77,7 +77,7 @@ final class DiscoveryBookingCell: UICollectionViewCell { subtitle: String, price: String, ratingValue: String, - ratingType: MWMRatingSummaryViewValueType, + ratingType: UgcSummaryRatingType, distance: String, onBuildRoute: @escaping OnBuildRoute) { setAvatar(avatarURL) diff --git a/iphone/Maps/UI/Discovery/Collection Cells/DiscoverySearchCell.swift b/iphone/Maps/UI/Discovery/Collection Cells/DiscoverySearchCell.swift index 44f90deed2..561c15d9d4 100644 --- a/iphone/Maps/UI/Discovery/Collection Cells/DiscoverySearchCell.swift +++ b/iphone/Maps/UI/Discovery/Collection Cells/DiscoverySearchCell.swift @@ -25,7 +25,7 @@ final class DiscoverySearchCell: UICollectionViewCell { distance: String, popular: Bool, ratingValue: String, - ratingType: MWMRatingSummaryViewValueType, + ratingType: UgcSummaryRatingType, tap: @escaping Tap) { titleLabel.text = title subtitleLabel.text = subtitle diff --git a/iphone/Maps/UI/Discovery/View Models/MWMDiscoveryControllerViewModel.mm b/iphone/Maps/UI/Discovery/View Models/MWMDiscoveryControllerViewModel.mm index 77ff57b5ca..d76c75f7b5 100644 --- a/iphone/Maps/UI/Discovery/View Models/MWMDiscoveryControllerViewModel.mm +++ b/iphone/Maps/UI/Discovery/View Models/MWMDiscoveryControllerViewModel.mm @@ -106,7 +106,7 @@ using namespace discovery; NSString *title = result.GetString().empty() ? subtitle : @(result.GetString().c_str()); NSString *ratingValue = [self ratingValueForProductInfo:info]; - MWMRatingSummaryViewValueType ratingType = [self ratingTypeForProductInfo:info]; + UgcSummaryRatingType ratingType = [self ratingTypeForProductInfo:info]; NSString *distance = [self distanceFrom:center to:result.GetFeatureCenter()]; @@ -137,7 +137,7 @@ using namespace discovery; NSString *price = @(result.GetHotelApproximatePricing().c_str()); NSString *ratingValue = [self ratingValueForProductInfo:info]; - MWMRatingSummaryViewValueType ratingType = [self ratingTypeForProductInfo:info]; + UgcSummaryRatingType ratingType = [self ratingTypeForProductInfo:info]; NSString *distance = [self distanceFrom:center to:result.GetFeatureCenter()]; @@ -176,8 +176,8 @@ using namespace discovery; return @(place_page::rating::GetRatingFormatted(info.m_ugcRating).c_str()); } -- (MWMRatingSummaryViewValueType)ratingTypeForProductInfo:(search::ProductInfo const &)info { - return (MWMRatingSummaryViewValueType)place_page::rating::GetImpress(info.m_ugcRating); +- (UgcSummaryRatingType)ratingTypeForProductInfo:(search::ProductInfo const &)info { + return (UgcSummaryRatingType)place_page::rating::GetImpress(info.m_ugcRating); } @end diff --git a/iphone/Maps/UI/Discovery/View Models/MWMDiscoveryHotelViewModel.h b/iphone/Maps/UI/Discovery/View Models/MWMDiscoveryHotelViewModel.h index 150f5204b0..6762a56cb2 100644 --- a/iphone/Maps/UI/Discovery/View Models/MWMDiscoveryHotelViewModel.h +++ b/iphone/Maps/UI/Discovery/View Models/MWMDiscoveryHotelViewModel.h @@ -1,4 +1,4 @@ -#import "MWMRatingSummaryViewValueType.h" +#import NS_ASSUME_NONNULL_BEGIN @@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSString *distance; @property(nonatomic, readonly) BOOL isPopular; @property(nonatomic, readonly) NSString *ratingValue; -@property(nonatomic, readonly) MWMRatingSummaryViewValueType ratingType; +@property(nonatomic, readonly) UgcSummaryRatingType ratingType; - (instancetype)initWithTitle:(NSString *)title subtitle:(NSString *)subtitle @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN distance:(NSString *)distance isPopular:(BOOL)isPopular ratingValue:(NSString *) ratingValue - ratingType:(MWMRatingSummaryViewValueType)ratingType; + ratingType:(UgcSummaryRatingType)ratingType; @end diff --git a/iphone/Maps/UI/Discovery/View Models/MWMDiscoveryHotelViewModel.m b/iphone/Maps/UI/Discovery/View Models/MWMDiscoveryHotelViewModel.m index 5a30eeaf73..f3df24a3b2 100644 --- a/iphone/Maps/UI/Discovery/View Models/MWMDiscoveryHotelViewModel.m +++ b/iphone/Maps/UI/Discovery/View Models/MWMDiscoveryHotelViewModel.m @@ -8,7 +8,7 @@ @property(nonatomic, readwrite) NSString *distance; @property(nonatomic, readwrite) BOOL isPopular; @property(nonatomic, readwrite) NSString *ratingValue; -@property(nonatomic, readwrite) MWMRatingSummaryViewValueType ratingType; +@property(nonatomic, readwrite) UgcSummaryRatingType ratingType; @end @@ -20,7 +20,7 @@ distance:(NSString *)distance isPopular:(BOOL)isPopular ratingValue:(NSString *) ratingValue - ratingType:(MWMRatingSummaryViewValueType)ratingType { + ratingType:(UgcSummaryRatingType)ratingType { self = [super init]; if (self) { self.title = title; diff --git a/iphone/Maps/UI/Discovery/View Models/MWMDiscoverySearchViewModel.h b/iphone/Maps/UI/Discovery/View Models/MWMDiscoverySearchViewModel.h index 48e46b19e1..49d9acf87d 100644 --- a/iphone/Maps/UI/Discovery/View Models/MWMDiscoverySearchViewModel.h +++ b/iphone/Maps/UI/Discovery/View Models/MWMDiscoverySearchViewModel.h @@ -1,4 +1,4 @@ -#import "MWMRatingSummaryViewValueType.h" +#import NS_ASSUME_NONNULL_BEGIN @@ -9,14 +9,14 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSString *distance; @property(nonatomic, readonly) BOOL isPopular; @property(nonatomic, readonly) NSString *ratingValue; -@property(nonatomic, readonly) MWMRatingSummaryViewValueType ratingType; +@property(nonatomic, readonly) UgcSummaryRatingType ratingType; - (instancetype)initWithTitle:(NSString *)title subtitle:(NSString *)subtitle distance:(NSString *)distance isPopular:(BOOL)isPopular ratingValue:(NSString *) ratingValue - ratingType:(MWMRatingSummaryViewValueType)ratingType; + ratingType:(UgcSummaryRatingType)ratingType; @end NS_ASSUME_NONNULL_END diff --git a/iphone/Maps/UI/Discovery/View Models/MWMDiscoverySearchViewModel.m b/iphone/Maps/UI/Discovery/View Models/MWMDiscoverySearchViewModel.m index 399d11d8fb..70cb71fc9e 100644 --- a/iphone/Maps/UI/Discovery/View Models/MWMDiscoverySearchViewModel.m +++ b/iphone/Maps/UI/Discovery/View Models/MWMDiscoverySearchViewModel.m @@ -1,4 +1,5 @@ #import "MWMDiscoverySearchViewModel.h" +#import @interface MWMDiscoverySearchViewModel() @@ -7,7 +8,7 @@ @property(nonatomic, readwrite) NSString *distance; @property(nonatomic, readwrite) BOOL isPopular; @property(nonatomic, readwrite) NSString *ratingValue; -@property(nonatomic, readwrite) MWMRatingSummaryViewValueType ratingType; +@property(nonatomic, readwrite) UgcSummaryRatingType ratingType; @end @@ -18,7 +19,7 @@ distance:(NSString *)distance isPopular:(BOOL)isPopular ratingValue:(NSString *) ratingValue - ratingType:(MWMRatingSummaryViewValueType)ratingType { + ratingType:(UgcSummaryRatingType)ratingType { self = [super init]; if (self) { self.title = title; diff --git a/iphone/Maps/UI/EditBookmark/MWMEditBookmarkController.h b/iphone/Maps/UI/EditBookmark/MWMEditBookmarkController.h index d8d47c6e20..49e062db52 100644 --- a/iphone/Maps/UI/EditBookmark/MWMEditBookmarkController.h +++ b/iphone/Maps/UI/EditBookmark/MWMEditBookmarkController.h @@ -1,9 +1,5 @@ #import "MWMTableViewController.h" -@class MWMPlacePageData; - @interface MWMEditBookmarkController : MWMTableViewController -@property(weak, nonatomic) MWMPlacePageData * data; - @end diff --git a/iphone/Maps/UI/EditBookmark/MWMEditBookmarkController.mm b/iphone/Maps/UI/EditBookmark/MWMEditBookmarkController.mm index 8551242415..c332dcc574 100644 --- a/iphone/Maps/UI/EditBookmark/MWMEditBookmarkController.mm +++ b/iphone/Maps/UI/EditBookmark/MWMEditBookmarkController.mm @@ -50,14 +50,13 @@ enum RowInMetaInfo { [super viewDidLoad]; self.cachedNewBookmarkCatId = kml::kInvalidMarkGroupId; - auto data = self.data; - NSAssert(data, @"Data can't be nil!"); - self.cachedDescription = data.bookmarkDescription; - self.cachedTitle = data.title; - self.cachedCategory = data.bookmarkCategory; - self.cachedColor = data.bookmarkColor; - m_cachedBookmarkId = data.bookmarkId; - m_cachedBookmarkCatId = data.bookmarkCategoryId; + auto const & info = GetFramework().GetCurrentPlacePageInfo(); + self.cachedDescription = @(GetPreferredBookmarkStr(info.GetBookmarkData().m_description).c_str()); + self.cachedTitle = info.GetTitle().empty() ? nil : @(info.GetTitle().c_str()); + self.cachedCategory = @(info.GetBookmarkCategoryName().c_str()); + self.cachedColor = info.GetBookmarkData().m_color.m_predefinedColor; + m_cachedBookmarkId = info.GetBookmarkId(); + m_cachedBookmarkCatId = info.GetBookmarkCategoryId(); [self configNavBar]; [self registerCells]; } @@ -248,7 +247,7 @@ enum RowInMetaInfo - (void)cellSelect:(UITableViewCell *)cell { - [self.data updateBookmarkStatus:NO]; + [[MWMBookmarksManager sharedManager] deleteBookmark:m_cachedBookmarkId]; GetFramework().UpdatePlacePageInfoForCurrentSelection(); [self goBack]; } diff --git a/iphone/Maps/UI/PlacePage/ActionBarViewController.swift b/iphone/Maps/UI/PlacePage/ActionBarViewController.swift index a56305dc6b..135614b11a 100644 --- a/iphone/Maps/UI/PlacePage/ActionBarViewController.swift +++ b/iphone/Maps/UI/PlacePage/ActionBarViewController.swift @@ -1,3 +1,6 @@ +protocol ActionBarViewControllerDelegate: AnyObject { + func actionBarDidPressButton(_ type: ActionBarButtonType) +} class ActionBarViewController: UIViewController { @IBOutlet var stackView: UIStackView! @@ -9,6 +12,8 @@ class ActionBarViewController: UIViewController { private var visibleButtons: [ActionBarButtonType] = [] private var additionalButtons: [ActionBarButtonType] = [] + weak var delegate: ActionBarViewControllerDelegate? + override func viewDidLoad() { super.viewDidLoad() @@ -23,12 +28,12 @@ class ActionBarViewController: UIViewController { if buttonType == .bookmark { if let bookmarkData = placePageData.bookmarkData { selected = true - disabled = bookmarkData.isEditable + disabled = !bookmarkData.isEditable } } guard let button = ActionBarButton(delegate: self, buttonType: buttonType, - partnerIndex: -1, + partnerIndex: placePageData.partnerIndex, isSelected: selected, isDisabled: disabled) else { continue } stackView.addArrangedSubview(button) @@ -43,7 +48,7 @@ class ActionBarViewController: UIViewController { if placePageData.previewData.isBookingPlace { buttons.append(.booking) } - if placePageData.sponsoredType == .partner { + if placePageData.isPartner { buttons.append(.partner) } if placePageData.bookingSearchUrl != nil { @@ -89,10 +94,29 @@ class ActionBarViewController: UIViewController { visibleButtons.append(.more) } } + + private func showMore() { + let actionSheet = UIAlertController(title: placePageData.previewData.title, + message: placePageData.previewData.subtitle, + preferredStyle: .actionSheet) + for button in additionalButtons { + actionSheet.addAction(UIAlertAction(title: titleForButton(button, placePageData.partnerIndex, false), + style: .default, + handler: { [weak self] _ in + self?.delegate?.actionBarDidPressButton(button) + })) + } + actionSheet.addAction(UIAlertAction(title: L("cancel"), style: .cancel)) + present(actionSheet, animated: true) + } } extension ActionBarViewController: ActionBarButtonDelegate { func tapOnButton(with type: ActionBarButtonType) { - + if type == .more { + showMore() + return + } + delegate?.actionBarDidPressButton(type) } } diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageButtonsProtocol.h b/iphone/Maps/UI/PlacePage/MWMPlacePageButtonsProtocol.h index ef340a9370..e3055869d1 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageButtonsProtocol.h +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageButtonsProtocol.h @@ -1,6 +1,7 @@ #import "MWMPlacePageTaxiProvider.h" -#import "MWMRatingSummaryViewValueType.h" #import "MWMUGCReviewSource.h" +#import +#import typedef UIView * _Nullable (^MWMPlacePageButtonsDismissBlock)(NSInteger); @@ -16,20 +17,17 @@ typedef UIView * _Nullable (^MWMPlacePageButtonsDismissBlock)(NSInteger); - (void)openMoreUrl; - (void)openReviewUrl; - (void)editBookmark; -- (void)orderTaxi:(MWMPlacePageTaxiProvider)provider; - (void)showAllFacilities; - (void)showPhotoAtIndex:(NSInteger)index referenceView:(UIView * _Nullable)referenceView referenceViewWhenDismissingHandler: (nonnull MWMPlacePageButtonsDismissBlock)referenceViewWhenDismissingHandler; - (void)showGallery; -- (void)showUGCAddReview:(MWMRatingSummaryViewValueType)value fromSource:(MWMUGCReviewSource)source; +- (void)showUGCAddReview:(UgcSummaryRatingType)value fromSource:(MWMUGCReviewSource)source; - (void)searchSimilar; - (void)openLocalAdsURL; -- (void)openSponsoredURL:(NSURL * _Nullable)url; - - (void)openReviews:(id _Nonnull)reviewsViewModel; - (void)showPlaceDescription:(NSString * _Nonnull)htmlString; diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageData.h b/iphone/Maps/UI/PlacePage/MWMPlacePageData.h index 514011bb90..cce296f028 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageData.h +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageData.h @@ -1,5 +1,4 @@ #import "MWMPlacePageActionBar.h" -#import "MWMRatingSummaryViewValueType.h" #include "partners_api/taxi_provider.hpp" @@ -11,6 +10,8 @@ #include "platform/network_policy.hpp" #include +#import + #include @class MWMPlacePageData; @@ -278,7 +279,7 @@ typedef void (^RefreshPromoCallbackBlock)(NSIndexSet *insertedSections); - (BOOL)isPreviewPlus; - (BOOL)isPartnerAppInstalled; -+ (MWMRatingSummaryViewValueType)ratingValueType:(place_page::rating::Impress)impress; ++ (UgcSummaryRatingType)ratingValueType:(place_page::rating::Impress)impress; // Coordinates - (m2::PointD const &)mercator; diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageData.mm b/iphone/Maps/UI/PlacePage/MWMPlacePageData.mm index ec03d5858e..525564ea37 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageData.mm +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageData.mm @@ -844,16 +844,16 @@ NSString * const kUserDefaultsLatLonAsDMSKey = @"UserDefaultsLatLonAsDMS"; return [UIApplication.sharedApplication canOpenURL:self.deepLink]; } -+ (MWMRatingSummaryViewValueType)ratingValueType:(rating::Impress)impress ++ (UgcSummaryRatingType)ratingValueType:(rating::Impress)impress { switch (impress) { - case rating::Impress::None: return MWMRatingSummaryViewValueTypeNoValue; - case rating::Impress::Horrible: return MWMRatingSummaryViewValueTypeHorrible; - case rating::Impress::Bad: return MWMRatingSummaryViewValueTypeBad; - case rating::Impress::Normal: return MWMRatingSummaryViewValueTypeNormal; - case rating::Impress::Good: return MWMRatingSummaryViewValueTypeGood; - case rating::Impress::Excellent: return MWMRatingSummaryViewValueTypeExcellent; + case rating::Impress::None: return UgcSummaryRatingTypeNone; + case rating::Impress::Horrible: return UgcSummaryRatingTypeHorrible; + case rating::Impress::Bad: return UgcSummaryRatingTypeBad; + case rating::Impress::Normal: return UgcSummaryRatingTypeNormal; + case rating::Impress::Good: return UgcSummaryRatingTypeGood; + case rating::Impress::Excellent: return UgcSummaryRatingTypeExcellent; } } #pragma mark - Coordinates diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm index 6a73b5081b..7cd9f39974 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageManager.mm @@ -1,6 +1,7 @@ #import "MWMPlacePageManager.h" #import "CLLocation+Mercator.h" #import "MWMActivityViewController.h" +#import "MWMFacilitiesController.h" #import "MWMFrameworkListener.h" #import "MWMFrameworkStorageObserver.h" #import "MWMLocationHelpers.h" @@ -24,6 +25,32 @@ using namespace storage; namespace { +void logSponsoredEvent(PlacePageData *data, NSString *eventName) +{ + NSMutableDictionary *stat = [NSMutableDictionary dictionary]; + if (data.hotelBooking != nil) + { + stat[kStatProvider] = kStatBooking; + stat[kStatHotel] = data.hotelBooking.hotelId; + stat[kStatHotelLocation] = makeLocationEventValue(data.locationCoordinate.latitude, + data.locationCoordinate.longitude); + } + else if (data.isPartner) + { + stat[kStatProvider] = data.partnerName; + stat[kStatObjectLat] = @(data.locationCoordinate.latitude); + stat[kStatObjectLon] = @(data.locationCoordinate.longitude); + } + else + { + stat[kStatProvider] = kStatPlacePageHotelSearch; + stat[kStatHotelLocation] = makeLocationEventValue(data.locationCoordinate.latitude, + data.locationCoordinate.longitude); + } + + [Statistics logEvent:eventName withParameters:stat atLocation:[MWMLocationManager lastLocation]]; +} + void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) { auto const & latLon = data.latLon; @@ -57,9 +84,10 @@ void logSponsoredEvent(MWMPlacePageData * data, NSString * eventName) [Statistics logEvent:eventName withParameters:stat atLocation:[MWMLocationManager lastLocation]]; } -void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page::Info const & info) +void RegisterEventIfPossible(eye::MapObject::Event::Type const type) { auto const userPos = GetFramework().GetCurrentPosition(); + auto const & info = GetFramework().GetCurrentPlacePageInfo(); utils::RegisterEyeEventIfPossible(type, userPos, info); } } // namespace @@ -81,7 +109,7 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: - (void)showReview { [self show]; - [self showUGCAddReview:MWMRatingSummaryViewValueTypeNoValue + [self showUGCAddReview:UgcSummaryRatingTypeNone fromSource:MWMUGCReviewSourceNotification]; } @@ -329,6 +357,16 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: } - (void)mwm_refreshUI { [self.layout mwm_refreshUI]; } + +- (void)routeFrom:(PlacePageData *)data { + [Statistics logEvent:kStatEventName(kStatPlacePage, kStatBuildRoute) + withParameters:@{kStatValue : kStatSource}]; + + MWMRoutePoint *point = [self routePoint:data withType:MWMRoutePointTypeStart intermediateIndex:0]; + [MWMRouter buildFromPoint:point bestRouter:YES]; + [self closePlacePage]; +} + - (void)routeFrom { [Statistics logEvent:kStatEventName(kStatPlacePage, kStatBuildRoute) @@ -339,6 +377,23 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [self closePlacePage]; } +- (void)routeTo:(PlacePageData *)data { + [Statistics logEvent:kStatEventName(kStatPlacePage, kStatBuildRoute) + withParameters:@{kStatValue : kStatDestination}]; + + if ([MWMRouter isOnRoute]) { + [MWMRouter stopRouting]; + } + + if ([MWMTrafficManager transitEnabled]) { + [MWMRouter setType:MWMRouterTypePublicTransport]; + } + + MWMRoutePoint *point = [self routePoint:data withType:MWMRoutePointTypeFinish intermediateIndex:0]; + [MWMRouter buildToPoint:point bestRouter:YES]; + [self closePlacePage]; +} + - (void)routeTo { [Statistics logEvent:kStatEventName(kStatPlacePage, kStatBuildRoute) @@ -346,15 +401,21 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: if ([MWMRouter isOnRoute]) [MWMRouter stopRouting]; - + if ([MWMTrafficManager transitEnabled]) [MWMRouter setType:MWMRouterTypePublicTransport]; - + MWMRoutePoint * point = [self routePointWithType:MWMRoutePointTypeFinish intermediateIndex:0]; [MWMRouter buildToPoint:point bestRouter:YES]; [self closePlacePage]; } +- (void)routeAddStop:(PlacePageData *)data { + MWMRoutePoint *point = [self routePoint:data withType:MWMRoutePointTypeIntermediate intermediateIndex:0]; + [MWMRouter addPointAndRebuild:point]; + [self closePlacePage]; +} + - (void)routeAddStop { MWMRoutePoint * point = @@ -363,51 +424,134 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [self closePlacePage]; } -- (void)routeRemoveStop -{ - auto data = self.data; - MWMRoutePoint * point = nil; - switch (data.routeMarkType) - { +- (void)routeRemoveStop:(PlacePageData *)data { + MWMRoutePoint *point = nil; + auto const intermediateIndex = GetFramework().GetCurrentPlacePageInfo().GetIntermediateIndex(); + switch (GetFramework().GetCurrentPlacePageInfo().GetRouteMarkType()) { case RouteMarkType::Start: - point = - [self routePointWithType:MWMRoutePointTypeStart intermediateIndex:data.intermediateIndex]; + point = [self routePoint:data withType:MWMRoutePointTypeStart intermediateIndex:intermediateIndex]; break; case RouteMarkType::Finish: - point = - [self routePointWithType:MWMRoutePointTypeFinish intermediateIndex:data.intermediateIndex]; + point = [self routePoint:data withType:MWMRoutePointTypeFinish intermediateIndex:intermediateIndex]; break; case RouteMarkType::Intermediate: - point = [self routePointWithType:MWMRoutePointTypeIntermediate - intermediateIndex:data.intermediateIndex]; + point = [self routePoint:data withType:MWMRoutePointTypeIntermediate intermediateIndex:intermediateIndex]; break; } [MWMRouter removePointAndRebuild:point]; [self closePlacePage]; } -- (void)orderTaxi:(MWMPlacePageTaxiProvider)provider +- (void)routeRemoveStop { - auto data = self.data; - if (!data) - return; - NSString * providerString = nil; - switch (provider) + MWMRoutePoint * point = nil; + auto const intermediateIndex = GetFramework().GetCurrentPlacePageInfo().GetIntermediateIndex(); + switch (GetFramework().GetCurrentPlacePageInfo().GetRouteMarkType()) { - case MWMPlacePageTaxiProviderTaxi: providerString = kStatUnknown; break; - case MWMPlacePageTaxiProviderUber: providerString = kStatUber; break; - case MWMPlacePageTaxiProviderYandex: providerString = kStatYandex; break; - case MWMPlacePageTaxiProviderMaxim: providerString = kStatMaxim; break; - case MWMPlacePageTaxiProviderVezet: providerString = kStatVezet; break; + case RouteMarkType::Start: + point = + [self routePointWithType:MWMRoutePointTypeStart intermediateIndex:intermediateIndex]; + break; + case RouteMarkType::Finish: + point = + [self routePointWithType:MWMRoutePointTypeFinish intermediateIndex:intermediateIndex]; + break; + case RouteMarkType::Intermediate: + point = [self routePointWithType:MWMRoutePointTypeIntermediate + intermediateIndex:intermediateIndex]; + break; } + [MWMRouter removePointAndRebuild:point]; + [self closePlacePage]; +} + +- (void)orderTaxi:(PlacePageData *)data +{ + NSString * providerString = nil; + switch (data.taxiProvider) + { + case PlacePageTaxiProviderNone: providerString = kStatUnknown; break; + case PlacePageTaxiProviderUber: providerString = kStatUber; break; + case PlacePageTaxiProviderYandex: providerString = kStatYandex; break; + case PlacePageTaxiProviderMaxim: providerString = kStatMaxim; break; + case PlacePageTaxiProviderRutaxi: providerString = kStatVezet; break; + } + [Statistics logEvent:kStatPlacePageTaxiClick withParameters:@{kStatProvider : providerString, kStatTags : data.statisticsTags}]; [MWMRouter setType:MWMRouterTypeTaxi]; - MWMRoutePoint * point = [self routePointWithType:MWMRoutePointTypeFinish intermediateIndex:0]; + MWMRoutePoint * point = [self routePointWithData:data pointType:MWMRoutePointTypeFinish intermediateIndex:0]; [MWMRouter buildToPoint:point bestRouter:NO]; [self closePlacePage]; } +- (MWMRoutePoint *)routePointWithData:(PlacePageData *)data + pointType:(MWMRoutePointType)type + intermediateIndex:(size_t)intermediateIndex +{ + if (data.isMyPosition) { + return [[MWMRoutePoint alloc] initWithLastLocationAndType:type intermediateIndex:intermediateIndex]; + } + + NSString *title = nil; + if (data.previewData.title.length > 0) { + title = data.previewData.title; + } else if (data.previewData.address.length > 0) { + title = data.previewData.address; + } else if (data.previewData.subtitle.length > 0) { + title = data.previewData.subtitle; + } else if (data.bookmarkData != nil) { + title = data.bookmarkData.externalTitle; + } else { + title = L(@"core_placepage_unknown_place"); + } + + NSString * subtitle = nil; + if (data.previewData.subtitle.length > 0 && ![title isEqualToString:data.previewData.subtitle]) { + subtitle = data.previewData.subtitle; + } + + return [[MWMRoutePoint alloc] initWithPoint:location_helpers::ToMercator(data.locationCoordinate) + title:title + subtitle:subtitle + type:type + intermediateIndex:intermediateIndex]; +} + +- (MWMRoutePoint *)routePoint:(PlacePageData *)data + withType:(MWMRoutePointType)type + intermediateIndex:(size_t)intermediateIndex +{ + if (data.isMyPosition) { + return [[MWMRoutePoint alloc] initWithLastLocationAndType:type + intermediateIndex:intermediateIndex]; + } + + NSString *title = nil; + if (data.previewData.title.length > 0) { + title = data.previewData.title; + } else if (data.previewData.address.length > 0) { + title = data.previewData.address; + } else if (data.previewData.subtitle.length > 0) { + title = data.previewData.subtitle; + } else if (data.bookmarkData != nil) { + title = data.bookmarkData.externalTitle; + } else { + title = L(@"core_placepage_unknown_place"); + } + + NSString * subtitle = nil; + if (data.previewData.subtitle.length > 0 && ![title isEqualToString:data.previewData.subtitle]) { + subtitle = data.previewData.subtitle; + } + + return [[MWMRoutePoint alloc] initWithPoint:location_helpers::ToMercator(data.locationCoordinate) + title:title + subtitle:subtitle + type:type + intermediateIndex:intermediateIndex]; +} + - (MWMRoutePoint *)routePointWithType:(MWMRoutePointType)type intermediateIndex:(size_t)intermediateIndex { @@ -442,6 +586,13 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: intermediateIndex:intermediateIndex]; } + +- (void)share:(PlacePageData *)data { + [Statistics logEvent:kStatEventName(kStatPlacePage, kStatShare)]; + MWMActivityViewController * shareVC = [MWMActivityViewController shareControllerForPlacePage:data]; + [shareVC presentInParentViewController:self.ownerViewController anchorView:self.layout.shareAnchor]; +} + - (void)share { auto data = self.data; @@ -477,17 +628,62 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [[MWMMapViewControlsManager manager] addPlace:NO hasPoint:YES point:data.mercator]; } +- (void)addPlace:(CLLocationCoordinate2D)coordinate +{ + [Statistics logEvent:kStatEditorAddClick + withParameters:@{kStatValue : kStatPlacePageNonBuilding}]; + [[MWMMapViewControlsManager manager] addPlace:NO hasPoint:YES point:location_helpers::ToMercator(coordinate)]; +} + +- (void)addBookmark:(PlacePageData *)data { + RegisterEventIfPossible(eye::MapObject::Event::Type::AddToBookmark); + [Statistics logEvent:kStatBookmarkCreated]; + + auto &f = GetFramework(); + auto &bmManager = f.GetBookmarkManager(); + auto &info = f.GetCurrentPlacePageInfo(); + auto const categoryId = f.LastEditedBMCategory(); + kml::BookmarkData bmData; + bmData.m_name = info.FormatNewBookmarkName(); + bmData.m_color.m_predefinedColor = f.LastEditedBMColor(); + bmData.m_point = info.GetMercator(); + if (info.IsFeature()) { + SaveFeatureTypes(info.GetTypes(), bmData); + } + auto editSession = bmManager.GetEditSession(); + auto const *bookmark = editSession.CreateBookmark(std::move(bmData), categoryId); + + auto buildInfo = info.GetBuildInfo(); + buildInfo.m_match = place_page::BuildInfo::Match::Everything; + buildInfo.m_userMarkId = bookmark->GetId(); + f.UpdatePlacePageInfoForCurrentSelection(buildInfo); +} + - (void)addBookmark { auto data = self.data; if (!data) return; - RegisterEventIfPossible(eye::MapObject::Event::Type::AddToBookmark, data.getRawData); + RegisterEventIfPossible(eye::MapObject::Event::Type::AddToBookmark); [Statistics logEvent:kStatBookmarkCreated]; [data updateBookmarkStatus:YES]; [self.layout reloadBookmarkSection:YES]; } +- (void)removeBookmark:(PlacePageData *)data +{ + [Statistics logEvent:kStatEventName(kStatPlacePage, kStatBookmarks) + withParameters:@{kStatValue : kStatRemove}]; + + auto &f = GetFramework(); + f.GetBookmarkManager().GetEditSession().DeleteBookmark(data.bookmarkData.bookmarkId); + + auto buildInfo = f.GetCurrentPlacePageInfo().GetBuildInfo(); + buildInfo.m_match = place_page::BuildInfo::Match::FeatureOnly; + buildInfo.m_userMarkId = kml::kInvalidMarkId; + f.UpdatePlacePageInfoForCurrentSelection(buildInfo); +} + - (void)removeBookmark { auto data = self.data; @@ -499,6 +695,12 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [self.layout reloadBookmarkSection:NO]; } +- (void)call:(PlacePageData *)data { + if (data.infoData.phoneUrl && [UIApplication.sharedApplication canOpenURL:data.infoData.phoneUrl]) { + [UIApplication.sharedApplication openURL:data.infoData.phoneUrl options:@{} completionHandler:nil]; + } +} + - (void)call { MWMPlacePageData *data = self.data; @@ -513,11 +715,8 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: } } -- (void)editBookmark -{ - auto data = self.data; - if (data) - [self.ownerViewController openBookmarkEditorWithData:data]; +- (void)editBookmark { + [self.ownerViewController openBookmarkEditor]; } - (void)showPlaceDescription:(NSString *)htmlString @@ -525,6 +724,26 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [self.ownerViewController openFullPlaceDescriptionWithHtml:htmlString]; } +- (void)openPartner:(PlacePageData *)data withStatisticLog:(NSString *)eventName proposedUrl:(NSURL *)proposedUrl +{ + logSponsoredEvent(data, eventName); + + NSURL *deeplink = [NSURL URLWithString:data.sponsoredDeeplink]; + if (deeplink != nil && [UIApplication.sharedApplication canOpenURL:deeplink]) { + [UIApplication.sharedApplication openURL:deeplink options:@{} completionHandler:nil]; + } else if (proposedUrl != nil) { + [UIApplication.sharedApplication openURL:proposedUrl options:@{} completionHandler:nil]; + } else { + NSAssert(proposedUrl, @"Sponsored url can't be nil!"); + return; + } + + if (data.previewData.isBookingPlace) { + auto mercator = location_helpers::ToMercator(data.locationCoordinate); + [MWMEye transitionToBookingWithPos:CGPointMake(mercator.x, mercator.y)]; + } +} + - (void)openPartnerWithStatisticLog:(NSString *)eventName proposedUrl:(NSURL *)proposedUrl { auto data = self.data; @@ -542,6 +761,11 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [MWMEye transitionToBookingWithPos:CGPointMake(data.mercator.x, data.mercator.y)]; } +- (void)book:(PlacePageData *)data { + NSURL *url = [NSURL URLWithString:data.sponsoredURL]; + [self openPartner:data withStatisticLog:kStatPlacePageHotelBook proposedUrl:url]; +} + - (void)book { auto data = self.data; @@ -565,16 +789,30 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [self openPartnerWithStatisticLog:eventName proposedUrl:data.sponsoredURL]; } +- (void)openDescriptionUrl:(PlacePageData *)data { + NSURL *url = [NSURL URLWithString:data.sponsoredDescriptionURL]; + [self openPartner:data withStatisticLog:kStatPlacePageHotelDetails proposedUrl:url]; +} + - (void)openDescriptionUrl { auto data = self.data; if (!data) return; - + [self openPartnerWithStatisticLog:kStatPlacePageHotelDetails proposedUrl:data.sponsoredDescriptionURL]; } +- (void)openMoreUrl:(PlacePageData *)data { + NSURL *url = [NSURL URLWithString:data.sponsoredMoreURL]; + if (!url) { return; } + logSponsoredEvent(data, kStatPlacePageHotelMore); + [UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil]; + auto mercator = location_helpers::ToMercator(data.locationCoordinate); + [MWMEye transitionToBookingWithPos:CGPointMake(mercator.x, mercator.y)]; +} + - (void)openMoreUrl { auto data = self.data; @@ -587,12 +825,17 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [MWMEye transitionToBookingWithPos:CGPointMake(data.mercator.x, data.mercator.y)]; } +- (void)openReviewUrl:(PlacePageData *)data { + NSURL *url = [NSURL URLWithString:data.sponsoredReviewURL]; + [self openPartner:data withStatisticLog:kStatPlacePageHotelReviews proposedUrl:url]; +} + - (void)openReviewUrl { auto data = self.data; if (!data) return; - + [self openPartnerWithStatisticLog:kStatPlacePageHotelReviews proposedUrl:data.sponsoredReviewURL]; } @@ -609,6 +852,14 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil]; } +- (void)openPartner:(PlacePageData *)data +{ + logSponsoredEvent(data, kStatPlacePageSponsoredActionButtonClick); + NSURL *url = [NSURL URLWithString:data.sponsoredURL]; + NSAssert(url, @"Partner url can't be nil!"); + [UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil]; +} + - (void)openPartner { auto data = self.data; @@ -676,7 +927,42 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [[MapViewController sharedController].navigationController pushViewController:galleryVc animated:YES]; } -- (void)showUGCAddReview:(MWMRatingSummaryViewValueType)value fromSource:(MWMUGCReviewSource)source +- (void)showUGCAddReview:(PlacePageData *)data rating:(UgcSummaryRatingType)value fromSource:(MWMUGCReviewSource)source +{ + NSMutableArray *ratings = [NSMutableArray array]; + for (NSString *cat in data.ratingCategories) { + [ratings addObject:[[MWMUGCRatingStars alloc] initWithTitle:cat + value:value + maxValue:5.0f]]; + } + + RegisterEventIfPossible(eye::MapObject::Event::Type::UgcEditorOpened); + NSString * sourceString; + switch (source) { + case MWMUGCReviewSourcePlacePage: + sourceString = kStatPlacePage; + break; + case MWMUGCReviewSourcePlacePagePreview: + sourceString = kStatPlacePagePreview; + break; + case MWMUGCReviewSourceNotification: + sourceString = kStatNotification; + break; + } + [Statistics logEvent:kStatUGCReviewStart + withParameters:@{ + kStatIsAuthenticated: @([MWMAuthorizationViewModel isAuthenticated]), + kStatIsOnline: @(GetPlatform().ConnectionStatus() != Platform::EConnectionType::CONNECTION_NONE), + kStatMode: kStatAdd, + kStatFrom: sourceString + }]; + auto ugcReviewModel = + [[MWMUGCReviewModel alloc] initWithReviewValue:value ratings:ratings title:data.previewData.title text:@""]; + auto ugcVC = [MWMUGCAddReviewController instanceWithModel:ugcReviewModel saver:self]; + [[MapViewController sharedController].navigationController pushViewController:ugcVC animated:YES]; +} + +- (void)showUGCAddReview:(UgcSummaryRatingType)value fromSource:(MWMUGCReviewSource)source { auto data = self.data; if (!data) @@ -689,7 +975,7 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: maxValue:5.0f]]; auto title = data.title; - RegisterEventIfPossible(eye::MapObject::Event::Type::UgcEditorOpened, data.getRawData); + RegisterEventIfPossible(eye::MapObject::Event::Type::UgcEditorOpened); NSString * sourceString; switch (source) { case MWMUGCReviewSourcePlacePage: @@ -721,11 +1007,7 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [Statistics logEvent:@"Placepage_Hotel_search_similar" withParameters:@{kStatProvider : self.data.isBooking ? kStatBooking : kStatOSM}]; - auto data = self.data; - if (!data) - return; - - MWMHotelParams * params = [[MWMHotelParams alloc] initWithPlacePageData:data]; + MWMHotelParams * params = [[MWMHotelParams alloc] init]; [[MWMSearchManager manager] showHotelFilterWithParams:params onFinishCallback:^{ [MWMMapViewControlsManager.manager searchTextOnMap:[L(@"booking_hotel") stringByAppendingString:@" "] @@ -733,13 +1015,35 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: }]; } +- (void)showAllFacilities:(PlacePageData *)data { + logSponsoredEvent(data, kStatPlacePageHotelFacilities); + MWMFacilitiesController *vc = [[MWMFacilitiesController alloc] init]; + vc.name = data.previewData.title; + vc.facilities = data.hotelBooking.facilities; + [[MapViewController sharedController].navigationController pushViewController:vc animated:YES]; +} + - (void)showAllFacilities { - auto data = self.data; - if (!data) + NSAssert(false, @"deprecated"); +} + +- (void)openLocalAdsURL:(PlacePageData *)data +{ + NSURL *url = [NSURL URLWithString:data.infoData.localAdsUrl]; + if (!url) return; - logSponsoredEvent(data, kStatPlacePageHotelFacilities); - [self.ownerViewController openHotelFacilities]; + + auto const & feature = GetFramework().GetCurrentPlacePageInfo().GetID(); + [Statistics logEvent:kStatPlacePageOwnershipButtonClick + withParameters:@{ + @"mwm_name" : @(feature.GetMwmName().c_str()), + @"mwm_version" : @(feature.GetMwmVersion()), + @"feature_id" : @(feature.m_index) + } + atLocation:[MWMLocationManager lastLocation]]; + + [self.ownerViewController openUrl:url]; } - (void)openLocalAdsURL @@ -763,11 +1067,11 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [self.ownerViewController openUrl:url]; } -- (void)openSponsoredURL:(nullable NSURL *)url -{ - if (auto u = url ?: self.data.sponsoredURL) - [self.ownerViewController openUrl:u]; -} +//- (void)openSponsoredURL:(nullable NSURL *)url +//{ +// if (auto u = url ?: self.data.sponsoredURL) +// [self.ownerViewController openUrl:u]; +//} - (void)openReviews:(id _Nonnull)reviewsViewModel { @@ -775,6 +1079,36 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: [[MapViewController sharedController].navigationController pushViewController:reviewsVC animated:YES]; } +- (void)openWebsite:(PlacePageData *)data { + NSURL *url = [NSURL URLWithString:data.infoData.website]; + if (url) { + [self.ownerViewController openUrl:url]; + //TODO: add local ads events + } +} + +- (void)openCatalogSingleItem:(PlacePageData *)data atIndex:(NSInteger)index { + [Statistics logEvent:kStatPlacepageSponsoredItemSelected + withParameters:@{ + kStatProvider: kStatMapsmeGuides, + kStatPlacement: data.isLargeToponim ? kStatPlacePageToponims : kStatPlacePageSightSeeing, + kStatItem: @(index), + kStatDestination: kStatCatalogue + }]; + NSURL *url = [NSURL URLWithString:data.catalogPromo.promoItems[index].catalogUrl]; + NSURL *patchedUrl = [[MWMBookmarksManager sharedManager] injectCatalogUTMContent:url content:MWMUTMContentView]; + [self openCatalogForURL:patchedUrl]; +} + +- (void)openCatalogMoreItems:(PlacePageData *)data { + [self openCatalogForURL:data.catalogPromo.moreUrl]; + [Statistics logEvent:kStatPlacepageSponsoredMoreSelected + withParameters:@{ + kStatProvider: kStatMapsmeGuides, + kStatPlacement: data.isLargeToponim ? kStatPlacePageToponims : kStatPlacePageSightSeeing, + }]; +} + #pragma mark - AvailableArea / PlacePageArea - (void)updateAvailableArea:(CGRect)frame @@ -786,7 +1120,7 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: #pragma mark - MWMFeatureHolder -- (FeatureID const &)featureId { return [self.data featureId]; } +- (FeatureID const &)featureId { return GetFramework().GetCurrentPlacePageInfo().GetID(); } #pragma mark - MWMBookingInfoHolder - (std::vector const &)hotelFacilities { return self.data.facilities; } @@ -796,17 +1130,41 @@ void RegisterEventIfPossible(eye::MapObject::Event::Type const type, place_page: - (MapViewController *)ownerViewController { return [MapViewController sharedController]; } -- (void)saveUgcWithModel:(MWMUGCReviewModel *)model language:(NSString *)language resultHandler:(void (^)(BOOL))resultHandler -{ - auto data = self.data; - if (!data) +- (void)saveUgcWithModel:(MWMUGCReviewModel *)model + language:(NSString *)language + resultHandler:(void (^)(BOOL))resultHandler { + using namespace ugc; + auto appInfo = AppInfo.sharedInfo; + auto const locale = + static_cast(StringUtf8Multilang::GetLangIndex(appInfo.twoLetterLanguageId.UTF8String)); + std::vector keyboardLanguages; + // TODO: Set the list of used keyboard languages (not only the recent one). + auto twoLetterInputLanguage = languages::Normalize(language.UTF8String); + keyboardLanguages.emplace_back(StringUtf8Multilang::GetLangIndex(twoLetterInputLanguage)); + + KeyboardText t{model.text.UTF8String, locale, keyboardLanguages}; + Ratings r; + for (MWMUGCRatingStars * star in model.ratings) + r.emplace_back(star.title.UTF8String, star.value); + + UGCUpdate update{r, t, std::chrono::system_clock::now()}; + + place_page::Info const & info = GetFramework().GetCurrentPlacePageInfo(); + GetFramework().GetUGCApi()->SetUGCUpdate(info.GetID(), update, + [resultHandler, info](ugc::Storage::SettingResult const result) { - NSAssert(false, @""); - resultHandler(NO); - return; - } - - [data setUGCUpdateFrom:model language:language resultHandler:resultHandler]; + if (result != ugc::Storage::SettingResult::Success) + { + resultHandler(NO); + return; + } + + resultHandler(YES); + GetFramework().UpdatePlacePageInfoForCurrentSelection(); + + utils::RegisterEyeEventIfPossible(eye::MapObject::Event::Type::UgcSaved, + GetFramework().GetCurrentPosition(), info); + }); } #pragma mark - MWMPlacePagePromoProtocol diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageManagerHelper.h b/iphone/Maps/UI/PlacePage/MWMPlacePageManagerHelper.h index 13d2339a18..ff7df10d6c 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageManagerHelper.h +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageManagerHelper.h @@ -1,10 +1,42 @@ -#import "MWMRatingSummaryViewValueType.h" #import "MWMUGCReviewSource.h" +#import + +@class PlacePageData; @interface MWMPlacePageManagerHelper : NSObject + (void)updateAvailableArea:(CGRect)frame; -+ (void)showUGCAddReview:(MWMRatingSummaryViewValueType)value fromSource:(MWMUGCReviewSource)source; ++ (void)showUGCAddReview:(UgcSummaryRatingType)value fromSource:(MWMUGCReviewSource)source; ++ (void)showUGCAddReview:(PlacePageData *)data + rating:(UgcSummaryRatingType)value + fromSource:(MWMUGCReviewSource)source; + (void)searchSimilar; ++ (void)editPlace; ++ (void)addBusiness; ++ (void)addPlace:(CLLocationCoordinate2D)coordinate; ++ (void)orderTaxi:(PlacePageData *)data; ++ (void)openLocalAdsURL:(PlacePageData *)data; ++ (void)openWebsite:(PlacePageData *)data; ++ (void)call:(PlacePageData *)data; ++ (void)showAllFacilities:(PlacePageData *)data; ++ (void)showPlaceDescription:(NSString *)htmlString; ++ (void)openMoreUrl:(PlacePageData *)data; ++ (void)openReviewUrl:(PlacePageData *)data; ++ (void)openDescriptionUrl:(PlacePageData *)data; ++ (void)openCatalogSingleItem:(PlacePageData *)data atIndex:(NSInteger)index; ++ (void)openCatalogMoreItems:(PlacePageData *)data; ++ (void)addBookmark:(PlacePageData *)data; ++ (void)removeBookmark:(PlacePageData *)data; ++ (void)editBookmark; ++ (void)openPartner:(PlacePageData *)data; ++ (void)book:(PlacePageData *)data; ++ (void)share:(PlacePageData *)data; ++ (void)routeFrom:(PlacePageData *)data; ++ (void)routeTo:(PlacePageData *)data; ++ (void)routeAddStop:(PlacePageData *)data; ++ (void)routeRemoveStop:(PlacePageData *)data; ++ (void)avoidDirty; ++ (void)avoidFerry; ++ (void)avoidToll; @end diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageManagerHelper.mm b/iphone/Maps/UI/PlacePage/MWMPlacePageManagerHelper.mm index 5acc49036c..a92e853560 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageManagerHelper.mm +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageManagerHelper.mm @@ -11,8 +11,36 @@ @interface MWMPlacePageManager () - (void)updateAvailableArea:(CGRect)frame; -- (void)showUGCAddReview:(MWMRatingSummaryViewValueType)value fromPreview:(BOOL)fromPreview; +- (void)showUGCAddReview:(UgcSummaryRatingType)value fromPreview:(BOOL)fromPreview; +- (void)showUGCAddReview:(PlacePageData *)data rating:(UgcSummaryRatingType)value fromSource:(MWMUGCReviewSource)source; - (void)searchSimilar; +- (void)editPlace; +- (void)addBusiness; +- (void)addPlace:(CLLocationCoordinate2D)coordinate; +- (void)orderTaxi:(PlacePageData *)data; +- (void)openLocalAdsURL:(PlacePageData *)data; +- (void)openWebsite:(PlacePageData *)data; +- (void)call:(PlacePageData *)data; +- (void)showAllFacilities:(PlacePageData *)data; +- (void)showPlaceDescription:(NSString *)htmlString; +- (void)openMoreUrl:(PlacePageData *)data; +- (void)openReviewUrl:(PlacePageData *)data; +- (void)openDescriptionUrl:(PlacePageData *)data; +- (void)openCatalogSingleItem:(PlacePageData *)data atIndex:(NSInteger)index; +- (void)openCatalogMoreItems:(PlacePageData *)data; +- (void)addBookmark:(PlacePageData *)data; +- (void)removeBookmark:(PlacePageData *)data; +- (void)editBookmark; +- (void)openPartner:(PlacePageData *)data; +- (void)book:(PlacePageData *)data; +- (void)share:(PlacePageData *)data; +- (void)routeFrom:(PlacePageData *)data; +- (void)routeTo:(PlacePageData *)data; +- (void)routeAddStop:(PlacePageData *)data; +- (void)routeRemoveStop:(PlacePageData *)data; +- (void)avoidDirty; +- (void)avoidFerry; +- (void)avoidToll; @end @@ -23,15 +51,127 @@ [[MWMMapViewControlsManager manager].placePageManager updateAvailableArea:frame]; } -+ (void)showUGCAddReview:(MWMRatingSummaryViewValueType)value fromSource:(MWMUGCReviewSource)source ++ (void)showUGCAddReview:(UgcSummaryRatingType)value fromSource:(MWMUGCReviewSource)source { [[MWMMapViewControlsManager manager].placePageManager showUGCAddReview:value fromSource:source]; } ++ (void)showUGCAddReview:(PlacePageData *)data rating:(UgcSummaryRatingType)value fromSource:(MWMUGCReviewSource)source { + [[MWMMapViewControlsManager manager].placePageManager showUGCAddReview:data rating:value fromSource:source]; +} + + (void)searchSimilar { [[MWMMapViewControlsManager manager].placePageManager searchSimilar]; } ++ (void)editPlace { + [[MWMMapViewControlsManager manager].placePageManager editPlace]; +} + ++ (void)addBusiness { + [[MWMMapViewControlsManager manager].placePageManager addBusiness]; +} + ++ (void)addPlace:(CLLocationCoordinate2D)coordinate { + [[MWMMapViewControlsManager manager].placePageManager addPlace:coordinate]; +} + ++ (void)orderTaxi:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager orderTaxi:data]; +} + ++ (void)openLocalAdsURL:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager openLocalAdsURL:data]; +} + ++ (void)openWebsite:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager openWebsite:data]; +} + ++ (void)call:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager call:data]; +} + ++ (void)showAllFacilities:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager showAllFacilities:data]; +} + ++ (void)showPlaceDescription:(NSString *)htmlString { + [[MWMMapViewControlsManager manager].placePageManager showPlaceDescription:htmlString]; +} + ++ (void)openMoreUrl:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager openMoreUrl:data]; +} + ++ (void)openReviewUrl:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager openReviewUrl:data]; +} + ++ (void)openDescriptionUrl:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager openDescriptionUrl:data]; +} + ++ (void)openCatalogSingleItem:(PlacePageData *)data atIndex:(NSInteger)index { + [[MWMMapViewControlsManager manager].placePageManager openCatalogSingleItem:data atIndex:index]; +} + ++ (void)openCatalogMoreItems:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager openCatalogMoreItems:data]; +} + ++ (void)addBookmark:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager addBookmark:data]; +} + ++ (void)removeBookmark:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager removeBookmark:data]; +} + ++ (void)editBookmark { + [[MWMMapViewControlsManager manager].placePageManager editBookmark]; +} + ++ (void)openPartner:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager openPartner:data]; +} + ++ (void)book:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager book:data]; +} + ++ (void)share:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager share:data]; +} + ++ (void)routeFrom:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager routeFrom:data]; +} + ++ (void)routeTo:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager routeTo:data]; +} + ++ (void)routeAddStop:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager routeAddStop:data]; +} + ++ (void)routeRemoveStop:(PlacePageData *)data { + [[MWMMapViewControlsManager manager].placePageManager routeRemoveStop:data]; +} + ++ (void)avoidDirty { + [[MWMMapViewControlsManager manager].placePageManager avoidDirty]; +} + ++ (void)avoidFerry { + [[MWMMapViewControlsManager manager].placePageManager avoidFerry]; +} + ++ (void)avoidToll { + [[MWMMapViewControlsManager manager].placePageManager avoidToll]; +} + @end diff --git a/iphone/Maps/UI/PlacePage/MWMPlacePageProtocol.h b/iphone/Maps/UI/PlacePage/MWMPlacePageProtocol.h index f94be7e4d1..6db9de1dc6 100644 --- a/iphone/Maps/UI/PlacePage/MWMPlacePageProtocol.h +++ b/iphone/Maps/UI/PlacePage/MWMPlacePageProtocol.h @@ -1,6 +1,5 @@ #import "MWMMapViewControlsManager.h" #import "MWMPlacePageButtonsProtocol.h" -#include "geometry/point2d.hpp" @class MWMViewController; @@ -43,7 +42,6 @@ struct HotelFacility; @protocol MWMBookingInfoHolder -- (std::vector const &)hotelFacilities; - (NSString *)hotelName; @end diff --git a/iphone/Maps/UI/PlacePage/PlacePage.storyboard b/iphone/Maps/UI/PlacePage/PlacePage.storyboard index 7b3ee803bb..e8441e90bd 100644 --- a/iphone/Maps/UI/PlacePage/PlacePage.storyboard +++ b/iphone/Maps/UI/PlacePage/PlacePage.storyboard @@ -3005,14 +3005,14 @@ - + - + - +