From 12aab83cced31605f69b0d10a600bdae09be804f Mon Sep 17 00:00:00 2001 From: David Martinez <47610359+dvdmrtnz@users.noreply.github.com> Date: Sun, 4 Feb 2024 22:20:13 +0100 Subject: [PATCH] [ios] Add wheelchair info to place page Signed-off-by: David Martinez <47610359+dvdmrtnz@users.noreply.github.com> --- .../PlacePageData/Common/PlacePageInfoData.h | 1 + .../PlacePageData/Common/PlacePageInfoData.mm | 3 +++ .../Contents.json | 24 +++++++++++++++++++ .../ic_wheelchair_white.svg | 4 ++++ .../PlacePageInfoViewController.swift | 5 ++++ 5 files changed, 37 insertions(+) create mode 100644 iphone/Maps/Images.xcassets/Place Page/ic_placepage_wheelchair.imageset/Contents.json create mode 100644 iphone/Maps/Images.xcassets/Place Page/ic_placepage_wheelchair.imageset/ic_wheelchair_white.svg diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h index 12af1fe36c..dda1aded4c 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.h @@ -29,6 +29,7 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly, nullable) NSString *level; @property(nonatomic, readonly, nullable) NSString *atm; @property(nonatomic, readonly, nullable) NSString *capacity; +@property(nonatomic, readonly, nullable) NSString *wheelchair; @end diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm index 729347941d..9f3e349090 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageInfoData.mm @@ -4,6 +4,8 @@ #import +#include "platform/localization.hpp" + #include "indexer/validate_and_format_contacts.hpp" #include "indexer/kayak.hpp" @@ -76,6 +78,7 @@ using namespace osm; break; 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; default: break; } diff --git a/iphone/Maps/Images.xcassets/Place Page/ic_placepage_wheelchair.imageset/Contents.json b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_wheelchair.imageset/Contents.json new file mode 100644 index 0000000000..fd84d64d78 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_wheelchair.imageset/Contents.json @@ -0,0 +1,24 @@ +{ + "images" : [ + { + "filename" : "ic_wheelchair_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_wheelchair.imageset/ic_wheelchair_white.svg b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_wheelchair.imageset/ic_wheelchair_white.svg new file mode 100644 index 0000000000..cf2855e754 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Place Page/ic_placepage_wheelchair.imageset/ic_wheelchair_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 d1bd1e81f2..afa7f87b3f 100644 --- a/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift @@ -95,6 +95,7 @@ class PlacePageInfoViewController: UIViewController { private var levelView: InfoItemViewController? private var coordinatesView: InfoItemViewController? private var capacityView: InfoItemViewController? + private var wheelchairView: InfoItemViewController? var placePageInfoData: PlacePageInfoData! weak var delegate: PlacePageInfoViewControllerDelegate? @@ -197,6 +198,10 @@ class PlacePageInfoViewController: UIViewController { capacityView = createInfoItem(capacity, icon: UIImage(named: "ic_placepage_capacity")) } + if let wheelchair = placePageInfoData.wheelchair { + wheelchairView = createInfoItem(wheelchair, icon: UIImage(named: "ic_placepage_wheelchair")) + } + if let email = placePageInfoData.email { emailView = createInfoItem(email, icon: UIImage(named: "ic_placepage_email"),