From 9234c0ce2311ab9fe117f7168ceb5e2e841102a1 Mon Sep 17 00:00:00 2001 From: David Martinez <47610359+dvdmrtnz@users.noreply.github.com> Date: Sat, 6 Apr 2024 13:07:40 +0200 Subject: [PATCH] [ios][placepage] Add drive_through to place page Signed-off-by: David Martinez <47610359+dvdmrtnz@users.noreply.github.com> --- .../PlacePageData/Common/PlacePageInfoData.h | 1 + .../PlacePageData/Common/PlacePageInfoData.mm | 5 ++++ .../Contents.json | 24 +++++++++++++++++++ .../ic_drive_through_white.svg | 4 ++++ .../PlacePageInfoViewController.swift | 5 ++++ 5 files changed, 39 insertions(+) create mode 100644 iphone/Maps/Images.xcassets/Place Page/ic_placepage_drive_through.imageset/Contents.json create mode 100644 iphone/Maps/Images.xcassets/Place Page/ic_placepage_drive_through.imageset/ic_drive_through_white.svg diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h index dda1aded4c..b110605b94 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h @@ -30,6 +30,7 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly, nullable) NSString *atm; @property(nonatomic, readonly, nullable) NSString *capacity; @property(nonatomic, readonly, nullable) NSString *wheelchair; +@property(nonatomic, readonly, nullable) NSString *driveThrough; @end diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm index e7ed3f7bc7..b71d94be6d 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm @@ -79,6 +79,11 @@ using namespace osm; case MetadataID::FMD_LEVEL: _level = ToNSString(value); break; case MetadataID::FMD_CAPACITY: _capacity = [NSString stringWithFormat:NSLocalizedString(@"capacity", nil), ToNSString(value)]; break; case MetadataID::FMD_WHEELCHAIR: _wheelchair = ToNSString(platform::GetLocalizedTypeName(value)); break; + case MetadataID::FMD_DRIVE_THROUGH: + if (value == "yes") + _driveThrough = NSLocalizedString(@"drive_through", nil); + break; + default: break; } diff --git a/iphone/Maps/Images.xcassets/Place Page/ic_placepage_drive_through.imageset/Contents.json b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_drive_through.imageset/Contents.json new file mode 100644 index 0000000000..c480ce1947 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_drive_through.imageset/Contents.json @@ -0,0 +1,24 @@ +{ + "images" : [ + { + "filename" : "ic_drive_through_white.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/iphone/Maps/Images.xcassets/Place Page/ic_placepage_drive_through.imageset/ic_drive_through_white.svg b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_drive_through.imageset/ic_drive_through_white.svg new file mode 100644 index 0000000000..7b5d40b26c --- /dev/null +++ b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_drive_through.imageset/ic_drive_through_white.svg @@ -0,0 +1,4 @@ + + + + diff --git a/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift b/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift index c3aea45aaa..82c090cdcc 100644 --- a/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift @@ -96,6 +96,7 @@ class PlacePageInfoViewController: UIViewController { private var coordinatesView: InfoItemViewController? private var capacityView: InfoItemViewController? private var wheelchairView: InfoItemViewController? + private var driveThroughView: InfoItemViewController? var placePageInfoData: PlacePageInfoData! weak var delegate: PlacePageInfoViewControllerDelegate? @@ -202,6 +203,10 @@ class PlacePageInfoViewController: UIViewController { wheelchairView = createInfoItem(wheelchair, icon: UIImage(named: "ic_placepage_wheelchair")) } + if let driveThrough = placePageInfoData.driveThrough { + driveThroughView = createInfoItem(driveThrough, icon: UIImage(named: "ic_placepage_drive_through")) + } + if let email = placePageInfoData.email { emailView = createInfoItem(email, icon: UIImage(named: "ic_placepage_email"),