mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-03 11:23:48 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#import "MWMMapDownloaderPlaceTableViewCell.h"
|
||||
|
||||
#import <CoreApi/MWMMapNodeAttributes.h>
|
||||
|
||||
@interface MWMMapDownloaderPlaceTableViewCell ()
|
||||
|
||||
@property(weak, nonatomic) IBOutlet UILabel *descriptionLabel;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint *titleBottomOffset;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMMapDownloaderPlaceTableViewCell
|
||||
|
||||
#pragma mark - Config
|
||||
|
||||
- (void)config:(MWMMapNodeAttributes *)nodeAttrs searchQuery:(NSString *)searchQuery {
|
||||
[super config:nodeAttrs searchQuery:searchQuery];
|
||||
BOOL isDescriptionVisible = NO;
|
||||
NSDictionary *selectedAreaAttrs = @{NSFontAttributeName : [UIFont bold12]};
|
||||
NSDictionary *unselectedAreaAttrs = @{NSFontAttributeName : [UIFont regular12]};
|
||||
self.needDisplayArea = !nodeAttrs.hasParent;
|
||||
if (self.needDisplayArea && nodeAttrs.topmostParentInfo.count == 1) {
|
||||
isDescriptionVisible = nodeAttrs.hasParent;
|
||||
if (isDescriptionVisible) {
|
||||
self.descriptionLabel.attributedText = [self matchedString:nodeAttrs.topmostParentInfo[0].countryName
|
||||
selectedAttrs:selectedAreaAttrs
|
||||
unselectedAttrs:unselectedAreaAttrs];
|
||||
}
|
||||
}
|
||||
else if (nodeAttrs.nodeDescription.length > 0)
|
||||
{
|
||||
isDescriptionVisible = YES;
|
||||
self.descriptionLabel.attributedText = [self matchedString:nodeAttrs.nodeDescription
|
||||
selectedAttrs:selectedAreaAttrs
|
||||
unselectedAttrs:unselectedAreaAttrs];
|
||||
}
|
||||
self.descriptionLabel.hidden = !isDescriptionVisible;
|
||||
self.titleBottomOffset.priority =
|
||||
isDescriptionVisible ? UILayoutPriorityDefaultLow : UILayoutPriorityDefaultHigh;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user