forked from organicmaps/organicmaps
[ios] Refactored cuisine displaying in place page.
This commit is contained in:
parent
a346495efb
commit
3637bef619
2 changed files with 15 additions and 2 deletions
|
@ -13,6 +13,8 @@
|
|||
|
||||
extern CGFloat const kBottomPlacePageOffset = 15.;
|
||||
extern CGFloat const kLabelsBetweenOffset = 8.;
|
||||
extern NSString * const kMWMCuisineSeparator;
|
||||
|
||||
namespace
|
||||
{
|
||||
CGFloat const kLeftOffset = 16.;
|
||||
|
@ -106,7 +108,18 @@ enum class AttributePosition
|
|||
else
|
||||
{
|
||||
self.titleLabel.text = entity.title;
|
||||
self.typeLabel.text = [entity.category capitalizedString];
|
||||
NSString * typeString = entity.category.capitalizedString;
|
||||
NSRange const range = [typeString rangeOfString:kMWMCuisineSeparator];
|
||||
if (range.location != NSNotFound)
|
||||
{
|
||||
NSMutableAttributedString * str = [[NSMutableAttributedString alloc] initWithString:typeString];
|
||||
[str addAttributes:@{NSForegroundColorAttributeName : [UIColor blackHintText]} range:range];
|
||||
self.typeLabel.attributedText = str;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.typeLabel.text = typeString;
|
||||
}
|
||||
}
|
||||
|
||||
[self.typeDescriptionView removeFromSuperview];
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
using feature::Metadata;
|
||||
|
||||
extern NSString * const kUserDefaultsLatLonAsDMSKey = @"UserDefaultsLatLonAsDMS";
|
||||
extern NSString * const kMWMCuisineSeparator = @" • ";
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
NSString * const kOSMCuisineSeparator = @";";
|
||||
NSString * const kMWMCuisineSeparator = @" • ";
|
||||
|
||||
NSString * makeOSMCuisineString(NSSet<NSString *> * cuisines)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue