diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePagePreviewData.h b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePagePreviewData.h index 687f3aa6d9..de6e6bba29 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePagePreviewData.h +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePagePreviewData.h @@ -39,6 +39,7 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) BOOL isMyPosition; @property(nonatomic, readonly) BOOL hasBanner; @property(nonatomic, readonly) BOOL isPopular; +@property(nonatomic, readonly) BOOL isTopChoise; @property(nonatomic, readonly) BOOL isBookingPlace; @property(nonatomic, readonly) BOOL showUgc; @property(nonatomic, readonly, nullable) NSArray *banners; diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePagePreviewData.mm b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePagePreviewData.mm index e46f487a8c..fa6dd4f8a4 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePagePreviewData.mm +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePagePreviewData.mm @@ -81,6 +81,7 @@ static PlacePageDataHotelType convertHotelType(std::optional 0; + _isTopChoise = rawData.IsTopChoise(); _isBookingPlace = rawData.GetSponsoredType() == place_page::SponsoredType::Booking; _schedule = convertOpeningHours(rawData.GetOpeningHours()); _hotelType = convertHotelType(rawData.GetHotelType()); diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarViewController.swift b/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarViewController.swift index 4e85362ac9..568bbd6c9c 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarViewController.swift +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/GuidesNavigationBar/GuidesNavigationBarViewController.swift @@ -19,14 +19,14 @@ class GuidesNavigationBarViewController: UIViewController { super.viewDidLoad() navigationBarItem.title = category.title - let rightButton: UIButton = UIButton(type: .custom) - rightButton.setImage(UIImage(named: "ic_nav_bar_back")?.withRenderingMode(.alwaysTemplate), for: .normal) - rightButton.setTitle(L("list"), for: .normal) - rightButton.addTarget(self, action: #selector(onBackPressed), for: .touchUpInside) - rightButton.contentHorizontalAlignment = .left - rightButton.styleName = "FlatNormalTransButton" + let leftButton: UIButton = UIButton(type: .custom) + leftButton.setImage(UIImage(named: "ic_nav_bar_back")?.withRenderingMode(.alwaysTemplate), for: .normal) + leftButton.setTitle(L("bookmarks_groups"), for: .normal) + leftButton.addTarget(self, action: #selector(onBackPressed), for: .touchUpInside) + leftButton.contentHorizontalAlignment = .left + leftButton.styleName = "FlatNormalTransButton" - navigationBarItem.leftBarButtonItem = UIBarButtonItem(customView: rightButton) + navigationBarItem.leftBarButtonItem = UIBarButtonItem(customView: leftButton) navigationBarItem.rightBarButtonItem = UIBarButtonItem(title: L("cancel"), style: .plain, target: self, diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 425d376d14..fe0d1efbd7 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -577,6 +577,7 @@ 991CE2DD2373145C009EB02A /* PromoAfterBookingCampaign.swift in Sources */ = {isa = PBXBuildFile; fileRef = 991CE2DC2373145C009EB02A /* PromoAfterBookingCampaign.swift */; }; 991FCA2023B0FF33009AD684 /* AdsStyleSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 991FCA1F23B0FF33009AD684 /* AdsStyleSheet.swift */; }; 991FCA2423B11E61009AD684 /* BookmarksStyleSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 991FCA2323B11E61009AD684 /* BookmarksStyleSheet.swift */; }; + 993416F82534427300526F6E /* PlacePageDividerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 993416F72534427300526F6E /* PlacePageDividerViewController.swift */; }; 993DF0B523F6B2EF00AC231A /* PlacePageElevationLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 993DF0B423F6B2EF00AC231A /* PlacePageElevationLayout.swift */; }; 993DF0C823F6BD0600AC231A /* ElevationDetailsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 993DF0C323F6BD0600AC231A /* ElevationDetailsViewController.swift */; }; 993DF0C923F6BD0600AC231A /* ElevationDetailsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 993DF0C423F6BD0600AC231A /* ElevationDetailsBuilder.swift */; }; @@ -1694,6 +1695,7 @@ 991CE2DC2373145C009EB02A /* PromoAfterBookingCampaign.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PromoAfterBookingCampaign.swift; sourceTree = ""; }; 991FCA1F23B0FF33009AD684 /* AdsStyleSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdsStyleSheet.swift; sourceTree = ""; }; 991FCA2323B11E61009AD684 /* BookmarksStyleSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksStyleSheet.swift; sourceTree = ""; }; + 993416F72534427300526F6E /* PlacePageDividerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlacePageDividerViewController.swift; sourceTree = ""; }; 993DF0B423F6B2EF00AC231A /* PlacePageElevationLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlacePageElevationLayout.swift; sourceTree = ""; }; 993DF0C323F6BD0600AC231A /* ElevationDetailsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ElevationDetailsViewController.swift; sourceTree = ""; }; 993DF0C423F6BD0600AC231A /* ElevationDetailsBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ElevationDetailsBuilder.swift; sourceTree = ""; }; @@ -4049,6 +4051,7 @@ 99A906D823F6F7030005872B /* WikiDescriptionViewController.swift */, 478F6FA523C4521F00054A53 /* MoreReviewsViewController.swift */, 4726254821C27D4B00C7BAAD /* PlacePageDescriptionViewController.swift */, + 993416F72534427300526F6E /* PlacePageDividerViewController.swift */, 99C964222428C0D500E41723 /* PlacePageHeader */, 993DF0C223F6BD0600AC231A /* ElevationDetails */, 99DEF9D523E420D2006BFD21 /* ElevationProfile */, @@ -5542,6 +5545,7 @@ F6E2FDE91E097BA00083EBEC /* MWMObjectsCategorySelectorController.mm in Sources */, 34AB665F1FC5AA330078E451 /* TransportTransitIntermediatePoint.swift in Sources */, 34B846A82029E8110081ECCD /* BMCDefaultViewModel.swift in Sources */, + 993416F82534427300526F6E /* PlacePageDividerViewController.swift in Sources */, 470F5A7F2189C30800754295 /* InAppPurchase.swift in Sources */, 348A8DF51F66775A00D83026 /* RatingView.swift in Sources */, F63AF50F1EA6215100A1DB98 /* FilterPriceCategoryCell.swift in Sources */, diff --git a/iphone/Maps/UI/PlacePage/Components/PlacePageDividerViewController.swift b/iphone/Maps/UI/PlacePage/Components/PlacePageDividerViewController.swift new file mode 100644 index 0000000000..22b131e2af --- /dev/null +++ b/iphone/Maps/UI/PlacePage/Components/PlacePageDividerViewController.swift @@ -0,0 +1,20 @@ +final class PlacePageDividerViewController: UIViewController { + @IBOutlet private var titleLabel: UILabel! + @IBOutlet private var authorIcon: UIImageView! + + var titleText: String? { + didSet { + titleLabel.text = titleText + } + } + + var isAuthorIconHidden = true { + didSet { + authorIcon.isHidden = isAuthorIconHidden + } + } + + override func viewDidLoad() { + super.viewDidLoad() + } +} diff --git a/iphone/Maps/UI/PlacePage/Components/PlacePagePreviewViewController.swift b/iphone/Maps/UI/PlacePage/Components/PlacePagePreviewViewController.swift index 07f54e215a..fd32fbad3e 100644 --- a/iphone/Maps/UI/PlacePage/Components/PlacePagePreviewViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/PlacePagePreviewViewController.swift @@ -94,10 +94,14 @@ final class PlacePagePreviewViewController: UIViewController { subtitleString.append(NSAttributedString(string: L("popular_place"), attributes: [.foregroundColor : UIColor.linkBlue(), .font : UIFont.regular14()])) + } else if placePagePreviewData.isTopChoise { + subtitleString.append(NSAttributedString(string: L("mustsee_title"), + attributes: [.foregroundColor : UIColor.linkBlue(), + .font : UIFont.regular14()])) } if let subtitle = placePagePreviewData.subtitle ?? placePagePreviewData.coordinates { - subtitleString.append(NSAttributedString(string: placePagePreviewData.isPopular ? " • " + subtitle : subtitle, + subtitleString.append(NSAttributedString(string: !subtitleString.string.isEmpty ? " • " + subtitle : subtitle, attributes: [.foregroundColor : UIColor.blackSecondaryText(), .font : UIFont.regular14()])) } diff --git a/iphone/Maps/UI/PlacePage/PlacePage.storyboard b/iphone/Maps/UI/PlacePage/PlacePage.storyboard index cd15486589..3df1787f3e 100644 --- a/iphone/Maps/UI/PlacePage/PlacePage.storyboard +++ b/iphone/Maps/UI/PlacePage/PlacePage.storyboard @@ -1,11 +1,12 @@ - + - + + @@ -20,7 +21,7 @@ - + @@ -28,9 +29,9 @@ - + - + @@ -53,7 +54,7 @@ - + @@ -63,12 +64,13 @@ - + + @@ -89,7 +91,6 @@ - @@ -142,6 +143,7 @@ + @@ -150,13 +152,12 @@ - - + @@ -174,7 +175,7 @@ @@ -1939,7 +1940,7 @@ - + @@ -2043,7 +2044,8 @@ - + + @@ -2054,7 +2056,6 @@ - @@ -2078,7 +2079,7 @@ - + @@ -2112,7 +2113,7 @@ - + @@ -2121,7 +2122,7 @@ - + @@ -2142,7 +2143,7 @@ - + @@ -2151,7 +2152,8 @@ - + + @@ -2164,7 +2166,6 @@ - @@ -2195,7 +2196,7 @@ - + @@ -2258,7 +2259,7 @@ - + @@ -2292,7 +2293,7 @@ - + @@ -2319,7 +2320,8 @@ - + + @@ -2329,7 +2331,6 @@ - @@ -2545,7 +2546,8 @@ - + + @@ -2559,7 +2561,6 @@ - @@ -2587,7 +2588,7 @@ - - + + @@ -3080,7 +3082,6 @@ - @@ -3110,7 +3111,7 @@ - + @@ -3121,7 +3122,7 @@ - + @@ -3144,7 +3145,7 @@ - + @@ -3228,7 +3229,7 @@ - + @@ -3237,7 +3238,8 @@ - + + @@ -3247,7 +3249,6 @@ - @@ -3273,7 +3274,7 @@ - + @@ -3327,7 +3328,7 @@ - + @@ -3359,6 +3360,7 @@ + @@ -3370,7 +3372,6 @@ - @@ -3426,7 +3427,7 @@ - + @@ -3623,7 +3624,7 @@ - + @@ -3895,6 +3896,7 @@ + @@ -3902,7 +3904,6 @@ - @@ -3913,6 +3914,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3931,6 +3990,7 @@ + @@ -3938,5 +3998,23 @@ + + + + + + + + + + + + + + + + + + diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Layouts/PlacePageCommonLayout.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Layouts/PlacePageCommonLayout.swift index 42ade7fb8d..21a1c19875 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Layouts/PlacePageCommonLayout.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Layouts/PlacePageCommonLayout.swift @@ -64,7 +64,25 @@ class PlacePageCommonLayout: NSObject, IPlacePageLayout { vc.delegate = interactor return vc } () - + + lazy var descriptionDividerViewController: PlacePageDividerViewController = { + let vc = storyboard.instantiateViewController(ofType: PlacePageDividerViewController.self) + vc.view.isHidden = true + if let bookmarkData = placePageData.bookmarkData { + let group = BookmarkGroup(categoryId: bookmarkData.bookmarkGroupId, bookmarksManager: BookmarksManager.shared()) + vc.isAuthorIconHidden = !group.isLonelyPlanet + } + vc.titleText = L("placepage_place_description").uppercased() + return vc + } () + + lazy var keyInformationDividerViewController: PlacePageDividerViewController = { + let vc = storyboard.instantiateViewController(ofType: PlacePageDividerViewController.self) + vc.view.isHidden = true + vc.titleText = L("key_information_title").uppercased() + return vc + } () + lazy var bookmarkViewController: PlacePageBookmarkViewController = { let vc = storyboard.instantiateViewController(ofType: PlacePageBookmarkViewController.self) vc.view.isHidden = true @@ -174,11 +192,13 @@ class PlacePageCommonLayout: NSObject, IPlacePageLayout { placePageData.loadCatalogPromo(completion: onLoadCatalogPromo) } + viewControllers.append(descriptionDividerViewController) viewControllers.append(wikiDescriptionViewController) if let wikiDescriptionHtml = placePageData.wikiDescriptionHtml { wikiDescriptionViewController.descriptionHtml = wikiDescriptionHtml if placePageData.bookmarkData?.bookmarkDescription == nil && !placePageData.isPromoCatalog { wikiDescriptionViewController.view.isHidden = false + descriptionDividerViewController.view.isHidden = false } } @@ -186,6 +206,9 @@ class PlacePageCommonLayout: NSObject, IPlacePageLayout { if let bookmarkData = placePageData.bookmarkData { bookmarkViewController.bookmarkData = bookmarkData bookmarkViewController.view.isHidden = false + if let description = bookmarkData.bookmarkDescription, description.isEmpty == false { + descriptionDividerViewController.view.isHidden = false + } } viewControllers.append(hotelPhotosViewController) @@ -194,6 +217,8 @@ class PlacePageCommonLayout: NSObject, IPlacePageLayout { viewControllers.append(hotelReviewsViewController) if placePageData.infoData != nil { + viewControllers.append(keyInformationDividerViewController) + keyInformationDividerViewController.view.isHidden = false viewControllers.append(infoViewController) }