diff options
author | Alexander Boriskov <a.boriskov@corp.mail.ru> | 2020-02-19 12:06:04 +0300 |
---|---|---|
committer | Aleksey Belousov <beloal@users.noreply.github.com> | 2020-02-19 12:08:17 +0300 |
commit | c8d21dfdbffca26fddeb1af6fbd95aabed6e16e4 (patch) | |
tree | 9cabd17fdc7c137636fddabc3dc2643c6e395d8b | |
parent | c09bdfd4418079733f5171566e1aa9f65c149713 (diff) |
[iOS] Fixed cell style in Search
https://jira.mail.ru/browse/MAPSME-13200
-rw-r--r-- | iphone/Maps/Core/Theme/SearchStyleSheet.swift | 8 | ||||
-rw-r--r-- | iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm | 6 | ||||
-rw-r--r-- | iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.xib | 8 |
3 files changed, 16 insertions, 6 deletions
diff --git a/iphone/Maps/Core/Theme/SearchStyleSheet.swift b/iphone/Maps/Core/Theme/SearchStyleSheet.swift index e6f79f3af7..86afd4aeee 100644 --- a/iphone/Maps/Core/Theme/SearchStyleSheet.swift +++ b/iphone/Maps/Core/Theme/SearchStyleSheet.swift @@ -103,5 +103,13 @@ class SearchStyleSheet: IStyleSheet { s.borderColor = colors.blackDividers s.textAlignment = .natural } + + theme.add(styleName: "SearchCellAds", from: "TableCell") { (s) -> (Void) in + s.backgroundColor = colors.bannerBackground + } + + theme.add(styleName: "SearchCellAvaliable", from: "TableCell") { (s) -> (Void) in + s.backgroundColor = colors.transparentGreen + } } } diff --git a/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm b/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm index 341ef247c2..4fcf80bcad 100644 --- a/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm +++ b/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm @@ -122,11 +122,11 @@ bool PopularityHasHigherPriority(bool hasPosition, double distanceInMeters) } if (productInfo.m_isLocalAdsCustomer) - self.backgroundColor = [UIColor bannerBackground]; + [self setStyleAndApply: @"SearchCellAds"]; else if (isAvailable) - self.backgroundColor = [UIColor transparentGreen]; + [self setStyleAndApply: @"SearchCellAvaliable"]; else - self.backgroundColor = [UIColor white]; + [self setStyleAndApply: @"Background"]; } - (void)setInfoText:(NSString *)infoText diff --git a/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.xib b/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.xib index d345624e3c..2bb464dcba 100644 --- a/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.xib +++ b/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.xib @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" 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="15706"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -21,7 +23,7 @@ <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="bold17:blackPrimaryText"/> + <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="regular17: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"> @@ -289,10 +291,10 @@ </userDefinedRuntimeAttributes> </view> <imageView hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" image="ic_hot_offer" translatesAutoresizingMaskIntoConstraints="NO" id="eHM-Vf-w4R"> - <rect key="frame" x="307" y="46.5" width="40" height="36"/> + <rect key="frame" x="307" y="55.5" width="20" height="18"/> </imageView> </subviews> - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> + <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="70N-Lq-mj9" firstAttribute="top" secondItem="5UO-MD-Hgx" secondAttribute="bottom" constant="4" id="5D1-Su-Oke"/> |