Files
comaps/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm
Konstantin Pastbin e3e4a1985a 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
2025-05-08 21:10:51 +07:00

56 lines
1.8 KiB
Plaintext

#import "MWMSearchCommonCell.h"
#import "CLLocation+Mercator.h"
#import "MWMLocationManager.h"
#import "SwiftBridge.h"
#import "SearchResult.h"
@interface MWMSearchCommonCell ()
@property(weak, nonatomic) IBOutlet UILabel * distanceLabel;
@property(weak, nonatomic) IBOutlet UILabel * infoLabel;
@property(weak, nonatomic) IBOutlet UILabel * locationLabel;
@property(weak, nonatomic) IBOutlet UILabel * openLabel;
@property(weak, nonatomic) IBOutlet UIView * popularView;
@property(weak, nonatomic) IBOutlet UIImageView * iconImageView;
@end
@implementation MWMSearchCommonCell
- (void)configureWith:(SearchResult * _Nonnull)result isPartialMatching:(BOOL)isPartialMatching {
[super configureWith:result isPartialMatching:isPartialMatching];
self.locationLabel.text = result.addressText;
[self.locationLabel sizeToFit];
self.infoLabel.text = result.infoText;
self.distanceLabel.text = result.distanceText;
self.popularView.hidden = YES;
self.openLabel.text = result.openStatusText;
self.openLabel.textColor = result.openStatusColor;
[self.openLabel setHidden:result.openStatusText.length == 0];
[self setStyleNameAndApply:@"Background"];
[self.iconImageView setStyleNameAndApply:@"BlueBackground"];
self.iconImageView.image = [UIImage imageNamed:result.iconImageName];
self.separatorInset = UIEdgeInsetsMake(0, kSearchCellSeparatorInset, 0, 0);
}
- (void)layoutSubviews {
[super layoutSubviews];
[self.iconImageView.layer setCornerRadius:self.iconImageView.height / 2];
}
- (NSDictionary *)selectedTitleAttributes {
return @{
NSForegroundColorAttributeName : [UIColor blackPrimaryText],
NSFontAttributeName : [UIFont bold17]
};
}
- (NSDictionary *)unselectedTitleAttributes {
return @{
NSForegroundColorAttributeName : [UIColor blackPrimaryText],
NSFontAttributeName : [UIFont regular17]
};
}
@end