Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
59
iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm
Normal file
59
iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
#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.distanceLabel.textColor = [UIColor.labelColor colorWithAlphaComponent:0.7];
|
||||
self.popularView.hidden = YES;
|
||||
self.openLabel.text = result.openStatusText;
|
||||
self.openLabel.textColor = result.openStatusColor;
|
||||
[self.openLabel setHidden:result.openStatusText.length == 0];
|
||||
[self setStyleNameAndApply:@"Background"];
|
||||
if (result.iconImageName != nil) {
|
||||
self.iconImageView.image = [[UIImage imageNamed:result.iconImageName] imageWithTintColor:UIColor.white];
|
||||
}
|
||||
self.iconImageView.backgroundColor = [UIColor colorNamed:@"Base Colors/Blue Color"];
|
||||
self.separatorInset = UIEdgeInsetsMake(0, kSearchCellSeparatorInset, 0, 0);
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
self.iconImageView.image = [self.iconImageView.image imageWithTintColor:UIColor.white];
|
||||
[self.iconImageView.layer setCornerRadius:self.iconImageView.height / 2];
|
||||
}
|
||||
|
||||
- (NSDictionary *)selectedTitleAttributes {
|
||||
return @{
|
||||
NSForegroundColorAttributeName : [UIColor black],
|
||||
NSFontAttributeName : [UIFont bold17]
|
||||
};
|
||||
}
|
||||
|
||||
- (NSDictionary *)unselectedTitleAttributes {
|
||||
return @{
|
||||
NSForegroundColorAttributeName : [UIColor blackPrimaryText],
|
||||
NSFontAttributeName : [UIFont medium17]
|
||||
};
|
||||
}
|
||||
|
||||
@end
|
||||
Loading…
Add table
Add a link
Reference in a new issue