Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
11
iphone/Maps/UI/Search/TableView/MWMSearchCell.h
Normal file
11
iphone/Maps/UI/Search/TableView/MWMSearchCell.h
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#import "MWMTableViewCell.h"
|
||||
|
||||
@class SearchResult;
|
||||
|
||||
static CGFloat const kSearchCellSeparatorInset = 48;
|
||||
|
||||
@interface MWMSearchCell : MWMTableViewCell
|
||||
|
||||
- (void)configureWith:(SearchResult * _Nonnull)result isPartialMatching:(BOOL)isPartialMatching;
|
||||
|
||||
@end
|
||||
68
iphone/Maps/UI/Search/TableView/MWMSearchCell.mm
Normal file
68
iphone/Maps/UI/Search/TableView/MWMSearchCell.mm
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
#import "MWMSearchCell.h"
|
||||
#import "SearchResult.h"
|
||||
|
||||
@interface MWMSearchCell ()
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel * titleLabel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMSearchCell
|
||||
|
||||
- (void)configureWith:(SearchResult * _Nonnull)result isPartialMatching:(BOOL)isPartialMatching {
|
||||
NSString * title = result.titleText;
|
||||
|
||||
if (title.length == 0)
|
||||
{
|
||||
self.titleLabel.text = @"";
|
||||
return;
|
||||
}
|
||||
|
||||
bool hasBranchName = (result.branchText && result.branchText.length > 0 && ![title containsString:result.branchText]);
|
||||
|
||||
NSDictionary * selectedTitleAttributes = [self selectedTitleAttributes];
|
||||
NSDictionary * unselectedTitleAttributes = [self unselectedTitleAttributes];
|
||||
if ((!selectedTitleAttributes || !unselectedTitleAttributes) && !hasBranchName)
|
||||
{
|
||||
self.titleLabel.text = title;
|
||||
return;
|
||||
}
|
||||
|
||||
NSMutableAttributedString * attributedTitle =
|
||||
[[NSMutableAttributedString alloc] initWithString:title];
|
||||
|
||||
NSArray<NSValue *> *highlightRanges = result.highlightRanges;
|
||||
[attributedTitle addAttributes:unselectedTitleAttributes range:NSMakeRange(0, title.length)];
|
||||
|
||||
// Add branch with thinner font weight if present and not already in title
|
||||
if (hasBranchName) {
|
||||
NSMutableDictionary * branchAttributes = [unselectedTitleAttributes mutableCopy];
|
||||
[branchAttributes setValue:[UIFont regular17] forKey:NSFontAttributeName];
|
||||
NSAttributedString * branchString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@" %@", result.branchText] attributes:branchAttributes];
|
||||
[attributedTitle appendAttributedString:branchString];
|
||||
}
|
||||
|
||||
for (NSValue *rangeValue in highlightRanges) {
|
||||
NSRange range = [rangeValue rangeValue];
|
||||
if (NSMaxRange(range) <= attributedTitle.string.length) {
|
||||
[attributedTitle setAttributes:selectedTitleAttributes range:range];
|
||||
} else {
|
||||
NSLog(@"Incorrect range: %@ for string: %@", NSStringFromRange(range), attributedTitle.string);
|
||||
}
|
||||
}
|
||||
|
||||
self.titleLabel.attributedText = attributedTitle;
|
||||
[self.titleLabel sizeToFit];
|
||||
}
|
||||
|
||||
- (NSDictionary *)selectedTitleAttributes
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSDictionary *)unselectedTitleAttributes
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
10
iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.h
Normal file
10
iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#import "MWMSearchCell.h"
|
||||
|
||||
@class SearchResult;
|
||||
|
||||
NS_SWIFT_NAME(SearchCommonCell)
|
||||
@interface MWMSearchCommonCell : MWMSearchCell
|
||||
|
||||
- (void)configureWith:(SearchResult * _Nonnull)result isPartialMatching:(BOOL)isPartialMatching;
|
||||
|
||||
@end
|
||||
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
|
||||
145
iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.xib
Normal file
145
iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.xib
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="MWMSearchCommonCell" rowHeight="85" id="KGk-i7-Jjw" customClass="MWMSearchCommonCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="321" height="85"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="321" height="85"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" verticalCompressionResistancePriority="752" text="New York Cafe" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4FD-RE-ffF">
|
||||
<rect key="frame" x="56" y="12" width="181" height="20.5"/>
|
||||
<accessibility key="accessibilityConfiguration" identifier="searchTitle"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/>
|
||||
<color key="textColor" red="0.12941176470588234" green="0.12941176470588234" blue="0.12941176470588234" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="blackPrimaryText"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="P8X-Xp-AaE">
|
||||
<rect key="frame" x="237" y="57" width="68" height="0.0"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
|
||||
<color key="textColor" red="0.12549019607843137" green="0.58823529411764708" blue="0.95294117647058818" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view hidden="YES" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="uWz-7m-GUu">
|
||||
<rect key="frame" x="262.5" y="16" width="41.5" height="20"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="TOP" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yjT-ah-SWQ">
|
||||
<rect key="frame" x="8" y="0.0" width="25.5" height="20"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
|
||||
<color key="textColor" red="0.1176470588" green="0.58823529409999997" blue="0.93983289930000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="bold12:linkBlueText"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="popular_place"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.14117647059999999" green="0.61176470589999998" blue="0.94901960780000005" alpha="0.16424978600000001" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="g2X-lA-DE3"/>
|
||||
<constraint firstAttribute="bottom" secondItem="yjT-ah-SWQ" secondAttribute="bottom" id="ghe-TD-Ni1"/>
|
||||
<constraint firstItem="yjT-ah-SWQ" firstAttribute="top" secondItem="uWz-7m-GUu" secondAttribute="top" id="rK0-T0-I3J"/>
|
||||
<constraint firstItem="yjT-ah-SWQ" firstAttribute="leading" secondItem="uWz-7m-GUu" secondAttribute="leading" constant="8" id="ucR-R6-Fyw"/>
|
||||
<constraint firstAttribute="trailing" secondItem="yjT-ah-SWQ" secondAttribute="trailing" constant="8" id="vYZ-sk-v7u"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="SearchPopularView"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Сafe" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5UO-MD-Hgx">
|
||||
<rect key="frame" x="56" y="36.5" width="29" height="1"/>
|
||||
<accessibility key="accessibilityConfiguration" identifier="searchType"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="26" id="O31-Vq-Bsz"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.54000000000000004" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="medium13:blackSecondaryText"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" text="Open" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SDd-3c-YeL">
|
||||
<rect key="frame" x="271.5" y="21.5" width="33.5" height="16"/>
|
||||
<accessibility key="accessibilityConfiguration" identifier="searchType"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="26" id="tqr-8N-JwN"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.54000000000000004" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="Russia, Moscow & Central, Moscow" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6pc-4s-GyP">
|
||||
<rect key="frame" x="56" y="41.5" width="181" height="31.5"/>
|
||||
<accessibility key="accessibilityConfiguration" identifier="searchSubTitle"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.54000000000000004" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="regular13:blackSecondaryText"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="YIa-Hb-PGV" userLabel="Icon ImageView">
|
||||
<rect key="frame" x="16" y="28.5" width="28" height="28"/>
|
||||
<color key="backgroundColor" systemColor="linkColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="28" id="fPn-mC-8Je"/>
|
||||
<constraint firstAttribute="width" constant="28" id="sJ9-6S-sMG"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="P8X-Xp-AaE" firstAttribute="leading" secondItem="6pc-4s-GyP" secondAttribute="trailing" id="0hr-QT-t0D"/>
|
||||
<constraint firstItem="5UO-MD-Hgx" firstAttribute="top" secondItem="4FD-RE-ffF" secondAttribute="bottom" constant="4" id="5dn-ca-dCn"/>
|
||||
<constraint firstItem="6pc-4s-GyP" firstAttribute="top" secondItem="5UO-MD-Hgx" secondAttribute="bottom" constant="4" id="7pm-XZ-vLK"/>
|
||||
<constraint firstAttribute="bottom" secondItem="6pc-4s-GyP" secondAttribute="bottom" constant="12" id="HWe-cz-8hm"/>
|
||||
<constraint firstItem="5UO-MD-Hgx" firstAttribute="trailing" relation="lessThanOrEqual" secondItem="SDd-3c-YeL" secondAttribute="leading" id="SJj-b5-T2k"/>
|
||||
<constraint firstAttribute="trailing" secondItem="4FD-RE-ffF" secondAttribute="trailing" constant="84" id="Ugu-lP-b9G"/>
|
||||
<constraint firstAttribute="trailing" secondItem="P8X-Xp-AaE" secondAttribute="trailing" constant="16" id="VJE-wo-TBb"/>
|
||||
<constraint firstItem="YIa-Hb-PGV" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="WRp-Ac-GmE"/>
|
||||
<constraint firstItem="YIa-Hb-PGV" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="g6c-sx-War"/>
|
||||
<constraint firstItem="5UO-MD-Hgx" firstAttribute="leading" secondItem="4FD-RE-ffF" secondAttribute="leading" id="gNK-ED-O8W"/>
|
||||
<constraint firstItem="4FD-RE-ffF" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="12" id="hM6-br-iKE"/>
|
||||
<constraint firstItem="6pc-4s-GyP" firstAttribute="leading" secondItem="5UO-MD-Hgx" secondAttribute="leading" id="jvQ-jd-XUJ"/>
|
||||
<constraint firstItem="4FD-RE-ffF" firstAttribute="leading" secondItem="YIa-Hb-PGV" secondAttribute="trailing" constant="12" id="nKc-RK-2zd"/>
|
||||
<constraint firstAttribute="trailing" secondItem="6pc-4s-GyP" secondAttribute="trailing" constant="84" id="nfE-NI-LX9"/>
|
||||
<constraint firstItem="6pc-4s-GyP" firstAttribute="baseline" secondItem="P8X-Xp-AaE" secondAttribute="firstBaseline" id="q7E-Jg-MYT"/>
|
||||
<constraint firstAttribute="trailing" secondItem="SDd-3c-YeL" secondAttribute="trailing" constant="16" id="vay-ux-6dA"/>
|
||||
<constraint firstItem="SDd-3c-YeL" firstAttribute="bottom" secondItem="5UO-MD-Hgx" secondAttribute="bottom" id="wXg-ce-SnG"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Background"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="distanceLabel" destination="P8X-Xp-AaE" id="Kaw-aR-8uJ"/>
|
||||
<outlet property="iconImageView" destination="YIa-Hb-PGV" id="oQP-F5-9hw"/>
|
||||
<outlet property="infoLabel" destination="5UO-MD-Hgx" id="lgJ-zE-omX"/>
|
||||
<outlet property="locationLabel" destination="6pc-4s-GyP" id="Te0-y3-sVQ"/>
|
||||
<outlet property="openLabel" destination="SDd-3c-YeL" id="5Rv-fO-g4x"/>
|
||||
<outlet property="popularView" destination="uWz-7m-GUu" id="LAK-NA-Fea"/>
|
||||
<outlet property="titleLabel" destination="4FD-RE-ffF" id="OQm-o8-LUd"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="315.21739130434787" y="296.98660714285711"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<systemColor name="linkColor">
|
||||
<color red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
#import "MWMSearchCell.h"
|
||||
|
||||
NS_SWIFT_NAME(SearchSuggestionCell)
|
||||
@interface MWMSearchSuggestionCell : MWMSearchCell
|
||||
|
||||
@property (nonatomic) BOOL isLastCell;
|
||||
|
||||
@end
|
||||
36
iphone/Maps/UI/Search/TableView/MWMSearchSuggestionCell.mm
Normal file
36
iphone/Maps/UI/Search/TableView/MWMSearchSuggestionCell.mm
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#import "MWMSearchSuggestionCell.h"
|
||||
|
||||
@interface MWMSearchSuggestionCell ()
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIImageView * icon;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMSearchSuggestionCell
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[super awakeFromNib];
|
||||
if (IPAD)
|
||||
self.contentView.backgroundColor = [UIColor white];
|
||||
}
|
||||
|
||||
- (NSDictionary *)selectedTitleAttributes
|
||||
{
|
||||
return @{NSForegroundColorAttributeName : UIColor.linkBlue, NSFontAttributeName : UIFont.bold16};
|
||||
}
|
||||
|
||||
- (NSDictionary *)unselectedTitleAttributes
|
||||
{
|
||||
return @{NSForegroundColorAttributeName : UIColor.linkBlue, NSFontAttributeName : UIFont.regular16};
|
||||
}
|
||||
|
||||
#pragma mark - Properties
|
||||
|
||||
- (void)setIsLastCell:(BOOL)isLastCell
|
||||
{
|
||||
_isLastCell = isLastCell;
|
||||
self.separatorInset = UIEdgeInsetsMake(0, isLastCell ? 0 : kSearchCellSeparatorInset, 0, 0);
|
||||
}
|
||||
|
||||
@end
|
||||
58
iphone/Maps/UI/Search/TableView/MWMSearchSuggestionCell.xib
Normal file
58
iphone/Maps/UI/Search/TableView/MWMSearchSuggestionCell.xib
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="MWMSearchSuggestionCell" propertyAccessControl="none">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_search" translatesAutoresizingMaskIntoConstraints="NO" id="1IA-T9-KOb">
|
||||
<rect key="frame" x="16" y="8" width="24" height="24"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="24" id="TPv-Js-EXq"/>
|
||||
<constraint firstAttribute="height" constant="24" id="bse-BN-jT9"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="MWMBlue"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="New Arbat Avenue" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gWP-Zj-GCt">
|
||||
<rect key="frame" x="52" y="9.5" width="252" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/>
|
||||
<color key="textColor" red="0.12549019610000001" green="0.58823529409999997" blue="0.95294117649999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="1IA-T9-KOb" secondAttribute="bottom" constant="8" id="0He-dX-gNg"/>
|
||||
<constraint firstAttribute="trailing" secondItem="gWP-Zj-GCt" secondAttribute="trailing" constant="16" id="c1H-CR-1P7"/>
|
||||
<constraint firstItem="gWP-Zj-GCt" firstAttribute="centerY" secondItem="1IA-T9-KOb" secondAttribute="centerY" id="iJZ-pk-VCW"/>
|
||||
<constraint firstItem="1IA-T9-KOb" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="l2F-lx-j3x"/>
|
||||
<constraint firstItem="gWP-Zj-GCt" firstAttribute="leading" secondItem="1IA-T9-KOb" secondAttribute="trailing" constant="12" id="xfc-Vx-bth"/>
|
||||
<constraint firstItem="1IA-T9-KOb" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="8" id="y24-rC-y5X"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Background"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="icon" destination="1IA-T9-KOb" id="eBB-Wj-yU5"/>
|
||||
<outlet property="titleLabel" destination="gWP-Zj-GCt" id="P6N-C2-ce6"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="139" y="154"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="ic_search" width="28" height="28"/>
|
||||
</resources>
|
||||
</document>
|
||||
Loading…
Add table
Add a link
Reference in a new issue