diff options
author | Aleksey Belouosv <aleksey@maps.me> | 2020-01-08 11:31:36 +0300 |
---|---|---|
committer | Alexander Boriskov <polas.okurtis@gmail.com> | 2020-02-14 17:21:36 +0300 |
commit | d0e9f80a4e38e602172b352289002dac71c9fb12 (patch) | |
tree | f01f53da83a03da69d4024d40d053b539072d8bf /iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC | |
parent | db0994460641ec66bea7c7b704a50e1819aa33b1 (diff) |
[iOS] [refactoring] remove old files
Diffstat (limited to 'iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC')
11 files changed, 0 insertions, 592 deletions
diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCRating.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCRating.swift index a634c7e630..b468368f86 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCRating.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCRating.swift @@ -1,15 +1,3 @@ -@objc(MWMUGCRatingValueType) -class UGCRatingValueType: NSObject { - let value: String - let type: UgcSummaryRatingType - - @objc init(value: String, type: UgcSummaryRatingType) { - self.value = value - self.type = type - super.init() - } -} - @objc(MWMUGCRatingStars) final class UGCRatingStars: NSObject { @objc let title: String diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReview.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReview.swift deleted file mode 100644 index f0bf756d2e..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReview.swift +++ /dev/null @@ -1,14 +0,0 @@ -@objc(MWMUGCReview) -final class UGCReview: NSObject, MWMReviewProtocol { - let title: String - let date: String - let text: String - let rating: UGCRatingValueType - - @objc init(title: String, date: String, text: String, rating: UGCRatingValueType) { - self.title = title - self.date = date - self.text = text - self.rating = rating - } -} diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.swift deleted file mode 100644 index 5fcdf71d89..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.swift +++ /dev/null @@ -1,26 +0,0 @@ -@objc(MWMUGCReviewCell) -final class UGCReviewCell: MWMTableViewCell { - @IBOutlet private weak var titleLabel: UILabel! - @IBOutlet private weak var dateLabel: UILabel! - @IBOutlet private weak var ratingView: RatingSummaryView! - @IBOutlet private weak var reviewLabel: ExpandableReviewView! { - didSet { - let settings = ExpandableReviewSettings(expandText: L("placepage_more_button"), - expandTextColor: .linkBlue(), - textColor: .blackPrimaryText(), - textFont: .regular14()) - reviewLabel.apply(settings: settings) - } - } - - @objc func config(review: UGCReview, isExpanded: Bool, onUpdate: @escaping () -> Void) { - titleLabel.text = review.title - dateLabel.text = review.date - reviewLabel.configure(text: review.text, - isExpanded: isExpanded, - onUpdate: onUpdate) - ratingView.value = review.rating.value - ratingView.type = review.rating.type - isSeparatorHidden = true - } -} diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.xib b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.xib deleted file mode 100644 index 612fc82113..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCReviewCell.xib +++ /dev/null @@ -1,100 +0,0 @@ -<?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="retina4_7" 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> - <objects> - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="UGCReviewCell" id="KGk-i7-Jjw" customClass="MWMUGCReviewCell" propertyAccessControl="none"> - <rect key="frame" x="0.0" y="0.0" width="320" height="135"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> - <rect key="frame" x="0.0" y="0.0" width="320" height="135"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sVT-L4-Mlw"> - <rect key="frame" x="0.0" y="-1" width="320" height="135.5"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" verticalCompressionResistancePriority="751" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3PE-rI-3N0"> - <rect key="frame" x="16" y="16" width="42" height="20.5"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="bold14:blackPrimaryText"/> - </userDefinedRuntimeAttributes> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" verticalCompressionResistancePriority="751" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CfZ-eF-OFu"> - <rect key="frame" x="16" y="40.5" width="42" height="21"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="regular12:blackSecondaryText"/> - </userDefinedRuntimeAttributes> - </label> - <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yfk-2d-jIs" customClass="RatingSummaryView" customModule="maps_me" customModuleProvider="target"> - <rect key="frame" x="256" y="16" width="48" height="20"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="20" placeholder="YES" id="GCB-u9-ND9"/> - <constraint firstAttribute="width" constant="48" placeholder="YES" id="TVO-Dx-h45"/> - </constraints> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="RatingSummaryView24"/> - </userDefinedRuntimeAttributes> - </view> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="762-NT-BKz" customClass="ExpandableReviewView" customModule="maps_me" customModuleProvider="target"> - <rect key="frame" x="16" y="77.5" width="288" height="41"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - </view> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="d1v-ce-wSZ"> - <rect key="frame" x="0.0" y="134.5" width="320" height="1"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="1" id="juL-ad-Qhb"/> - </constraints> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Divider"/> - </userDefinedRuntimeAttributes> - </view> - </subviews> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstItem="762-NT-BKz" firstAttribute="top" secondItem="CfZ-eF-OFu" secondAttribute="bottom" constant="16" id="1lo-ik-7Zm"/> - <constraint firstItem="CfZ-eF-OFu" firstAttribute="leading" secondItem="3PE-rI-3N0" secondAttribute="leading" id="51g-rF-VAQ"/> - <constraint firstItem="3PE-rI-3N0" firstAttribute="top" secondItem="sVT-L4-Mlw" secondAttribute="top" constant="16" id="Dsv-rC-mN3"/> - <constraint firstItem="3PE-rI-3N0" firstAttribute="leading" secondItem="sVT-L4-Mlw" secondAttribute="leading" constant="16" id="I43-QS-Z3Y"/> - <constraint firstItem="yfk-2d-jIs" firstAttribute="top" secondItem="sVT-L4-Mlw" secondAttribute="top" constant="16" id="IN6-Pr-eGH"/> - <constraint firstAttribute="trailing" secondItem="yfk-2d-jIs" secondAttribute="trailing" constant="16" id="Laz-IW-nlM"/> - <constraint firstAttribute="bottom" secondItem="d1v-ce-wSZ" secondAttribute="bottom" id="V6X-dF-duR"/> - <constraint firstItem="762-NT-BKz" firstAttribute="leading" secondItem="CfZ-eF-OFu" secondAttribute="leading" id="c4z-oJ-icf"/> - <constraint firstItem="d1v-ce-wSZ" firstAttribute="top" secondItem="762-NT-BKz" secondAttribute="bottom" priority="999" constant="16" id="cXY-MK-bsx"/> - <constraint firstItem="CfZ-eF-OFu" firstAttribute="top" secondItem="3PE-rI-3N0" secondAttribute="bottom" constant="4" id="dib-vK-VkM"/> - <constraint firstAttribute="trailing" secondItem="762-NT-BKz" secondAttribute="trailing" constant="16" id="eWs-tf-gnY"/> - <constraint firstItem="d1v-ce-wSZ" firstAttribute="leading" secondItem="sVT-L4-Mlw" secondAttribute="leading" id="fJH-u0-p1T"/> - <constraint firstAttribute="trailing" secondItem="d1v-ce-wSZ" secondAttribute="trailing" id="ix8-vC-6x9"/> - </constraints> - </view> - </subviews> - <constraints> - <constraint firstItem="sVT-L4-Mlw" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="NDg-Sq-JR5"/> - <constraint firstAttribute="bottom" secondItem="sVT-L4-Mlw" secondAttribute="bottom" constant="0.5" id="UOg-pG-9oV"/> - <constraint firstAttribute="trailing" secondItem="sVT-L4-Mlw" secondAttribute="trailing" id="lk8-vT-q6l"/> - <constraint firstItem="sVT-L4-Mlw" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="-1" id="oeh-CG-l1D"/> - </constraints> - </tableViewCellContentView> - <connections> - <outlet property="dateLabel" destination="CfZ-eF-OFu" id="RLX-Xu-oVJ"/> - <outlet property="ratingView" destination="yfk-2d-jIs" id="wyh-94-tVB"/> - <outlet property="reviewLabel" destination="762-NT-BKz" id="sqO-tb-UuV"/> - <outlet property="titleLabel" destination="3PE-rI-3N0" id="YqB-6N-buv"/> - </connections> - <point key="canvasLocation" x="141" y="155"/> - </tableViewCell> - </objects> -</document> diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.swift deleted file mode 100644 index 7f4a268217..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.swift +++ /dev/null @@ -1,54 +0,0 @@ -@objc(MWMUGCSummaryRatingCell) -final class UGCSummaryRatingCell: MWMTableViewCell { - @IBOutlet private weak var titleLabel: UILabel! - @IBOutlet private weak var countLabel: UILabel! - @IBOutlet private weak var ratingSummaryView: RatingSummaryView! - @IBOutlet private weak var ratingCollectionViewHeight: NSLayoutConstraint! - @IBOutlet private weak var ratingCollectionView: UICollectionView! { - didSet { - ratingCollectionView.register(cellClass: UGCSummaryRatingStarsCell.self) - } - } - - fileprivate var ratings: [UGCRatingStars]! - - override var frame: CGRect { - didSet { - if frame.size != oldValue.size { - updateCollectionView() - } - } - } - - @objc func config(reviewsCount: UInt, summaryRating: UGCRatingValueType, ratings: [UGCRatingStars]) { - countLabel.text = String(format:L("placepage_summary_rating_description"), reviewsCount) - ratingSummaryView.value = summaryRating.value - ratingSummaryView.type = summaryRating.type - self.ratings = ratings - updateCollectionView() - isSeparatorHidden = true - } - - override func didMoveToSuperview() { - super.didMoveToSuperview() - updateCollectionView() - } - - private func updateCollectionView() { - DispatchQueue.main.async { - self.ratingCollectionView.reloadData() - } - } -} - -extension UGCSummaryRatingCell: UICollectionViewDataSource { - func collectionView(_: UICollectionView, numberOfItemsInSection _: Int) -> Int { - return ratings?.count ?? 0 - } - - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell = collectionView.dequeueReusableCell(withCellClass: UGCSummaryRatingStarsCell.self, indexPath: indexPath) as! UGCSummaryRatingStarsCell - cell.config(rating: ratings[indexPath.item]) - return cell - } -} diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.xib b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.xib deleted file mode 100644 index 39b2a603d9..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingCell.xib +++ /dev/null @@ -1,127 +0,0 @@ -<?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="retina4_7" 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> - <objects> - <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> - <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> - <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="0.0" reuseIdentifier="UGCSummaryRatingCell" id="KGk-i7-Jjw" customClass="MWMUGCSummaryRatingCell" propertyAccessControl="none"> - <rect key="frame" x="0.0" y="0.0" width="320" height="135"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> - <rect key="frame" x="0.0" y="0.0" width="320" height="135"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MSt-Fx-y5y"> - <rect key="frame" x="0.0" y="0.0" width="320" height="78"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vuk-Pr-u1F"> - <rect key="frame" x="16" y="16" width="42" height="21"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="bold22:blackPrimaryText"/> - <userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="placepage_summary_rating"/> - </userDefinedRuntimeAttributes> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dL4-7I-zUJ"> - <rect key="frame" x="16" y="41" width="42" height="21"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="regular12:blackSecondaryText"/> - </userDefinedRuntimeAttributes> - </label> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1wF-gY-Wza" customClass="RatingSummaryView" customModule="maps_me" customModuleProvider="target"> - <rect key="frame" x="200" y="19" width="104" height="40"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="width" constant="104" placeholder="YES" id="K7d-bD-t4a"/> - <constraint firstAttribute="height" constant="40" placeholder="YES" id="XNy-10-mxa"/> - </constraints> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="RatingSummaryView24:bold28"/> - </userDefinedRuntimeAttributes> - </view> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ks7-ZL-gaO"> - <rect key="frame" x="16" y="77" width="304" height="1"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="1" id="0Ow-i9-Mmd"/> - </constraints> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Divider"/> - </userDefinedRuntimeAttributes> - </view> - </subviews> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="bottom" secondItem="Ks7-ZL-gaO" secondAttribute="bottom" id="EQg-NU-aaE"/> - <constraint firstItem="Ks7-ZL-gaO" firstAttribute="leading" secondItem="vuk-Pr-u1F" secondAttribute="leading" id="EzT-6G-Aaz"/> - <constraint firstAttribute="trailing" secondItem="1wF-gY-Wza" secondAttribute="trailing" constant="16" id="TmZ-A7-jSz"/> - <constraint firstAttribute="bottom" secondItem="dL4-7I-zUJ" secondAttribute="bottom" constant="16" id="Y4t-mx-i4U"/> - <constraint firstItem="dL4-7I-zUJ" firstAttribute="top" secondItem="vuk-Pr-u1F" secondAttribute="bottom" constant="4" id="gwC-3A-Cn6"/> - <constraint firstAttribute="trailing" secondItem="Ks7-ZL-gaO" secondAttribute="trailing" id="rqS-JS-29d"/> - <constraint firstItem="vuk-Pr-u1F" firstAttribute="top" secondItem="MSt-Fx-y5y" secondAttribute="top" constant="16" id="sW5-pu-RyS"/> - <constraint firstItem="dL4-7I-zUJ" firstAttribute="leading" secondItem="vuk-Pr-u1F" secondAttribute="leading" id="t1x-yk-QNA"/> - <constraint firstItem="1wF-gY-Wza" firstAttribute="centerY" secondItem="MSt-Fx-y5y" secondAttribute="centerY" id="x7o-2J-PIT"/> - <constraint firstItem="vuk-Pr-u1F" firstAttribute="leading" secondItem="MSt-Fx-y5y" secondAttribute="leading" constant="16" id="ykf-u3-iXH"/> - </constraints> - </view> - <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" prefetchingEnabled="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ek3-Zj-cfu"> - <rect key="frame" x="0.0" y="78" width="320" height="56"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" priority="999" constant="56" id="NOt-1H-Ou6"/> - </constraints> - <collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="12" minimumInteritemSpacing="16" id="liK-AI-Noj"> - <size key="itemSize" width="120" height="32"/> - <size key="headerReferenceSize" width="0.0" height="0.0"/> - <size key="footerReferenceSize" width="0.0" height="0.0"/> - <inset key="sectionInset" minX="16" minY="12" maxX="16" maxY="12"/> - </collectionViewFlowLayout> - <connections> - <outlet property="dataSource" destination="KGk-i7-Jjw" id="dDO-Dn-baT"/> - </connections> - </collectionView> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="deV-cR-pmt"> - <rect key="frame" x="0.0" y="134" width="320" height="1"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="1" id="xWy-nC-DYA"/> - </constraints> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Divider"/> - </userDefinedRuntimeAttributes> - </view> - </subviews> - <constraints> - <constraint firstAttribute="trailing" secondItem="ek3-Zj-cfu" secondAttribute="trailing" id="Bqn-Ho-oHK"/> - <constraint firstItem="MSt-Fx-y5y" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="E6a-WS-t4d"/> - <constraint firstItem="deV-cR-pmt" firstAttribute="top" secondItem="ek3-Zj-cfu" secondAttribute="bottom" id="LVT-d5-pQ9"/> - <constraint firstItem="ek3-Zj-cfu" firstAttribute="top" secondItem="MSt-Fx-y5y" secondAttribute="bottom" id="Nof-jo-qQX"/> - <constraint firstItem="ek3-Zj-cfu" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="O1E-QI-WCE"/> - <constraint firstItem="deV-cR-pmt" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="ZMV-M7-CZf"/> - <constraint firstAttribute="trailing" secondItem="deV-cR-pmt" secondAttribute="trailing" id="cGS-Z6-Jhu"/> - <constraint firstAttribute="bottom" secondItem="deV-cR-pmt" secondAttribute="bottom" id="hYI-fo-9ZF"/> - <constraint firstAttribute="trailing" secondItem="MSt-Fx-y5y" secondAttribute="trailing" id="lrY-p6-nWm"/> - <constraint firstItem="MSt-Fx-y5y" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="vuv-N8-45j"/> - </constraints> - </tableViewCellContentView> - <connections> - <outlet property="countLabel" destination="dL4-7I-zUJ" id="Tff-bs-ZJ1"/> - <outlet property="ratingCollectionView" destination="ek3-Zj-cfu" id="yaA-5U-Hkd"/> - <outlet property="ratingCollectionViewHeight" destination="NOt-1H-Ou6" id="OAa-93-CP3"/> - <outlet property="ratingSummaryView" destination="1wF-gY-Wza" id="Cik-Nz-9lb"/> - <outlet property="titleLabel" destination="vuk-Pr-u1F" id="BS6-tI-lXe"/> - </connections> - <point key="canvasLocation" x="139" y="155"/> - </tableViewCell> - </objects> -</document> diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.swift deleted file mode 100644 index f8b9e80c76..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.swift +++ /dev/null @@ -1,10 +0,0 @@ - -final class UGCSummaryRatingStarsCell: UICollectionViewCell { - @IBOutlet private weak var ratingView: RatingView! - - func config(rating: UGCRatingStars) { - ratingView.topText = L(rating.title) - ratingView.value = rating.value - ratingView.starsCount = Int(rating.maxValue) - } -} diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.xib b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.xib deleted file mode 100644 index bd1d856686..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCSummaryRatingStarsCell.xib +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> - <device id="retina4_7" orientation="portrait"> - <adaptation id="fullscreen"/> - </device> - <dependencies> - <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> - <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"/> - <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="UGCSummaryRatingStarsCell" customModule="maps_me" customModuleProvider="target" propertyAccessControl="all"> - <rect key="frame" x="0.0" y="0.0" width="50" height="50"/> - <autoresizingMask key="autoresizingMask"/> - <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> - <rect key="frame" x="0.0" y="0.0" width="50" height="50"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <subviews> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="BLZ-qJ-zka" customClass="RatingView" customModule="maps_me" customModuleProvider="target"> - <rect key="frame" x="0.0" y="0.0" width="50" height="50"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="number" keyPath="starSize"> - <real key="value" value="12"/> - </userDefinedRuntimeAttribute> - </userDefinedRuntimeAttributes> - </view> - </subviews> - </view> - <constraints> - <constraint firstAttribute="bottom" secondItem="BLZ-qJ-zka" secondAttribute="bottom" id="M7R-Mt-lBd"/> - <constraint firstItem="BLZ-qJ-zka" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="YpT-Vp-9OA"/> - <constraint firstAttribute="trailing" secondItem="BLZ-qJ-zka" secondAttribute="trailing" id="ZjF-5Y-apH"/> - <constraint firstItem="BLZ-qJ-zka" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="w5m-wz-I5t"/> - </constraints> - <connections> - <outlet property="ratingView" destination="BLZ-qJ-zka" id="BH2-xM-9PK"/> - </connections> - </collectionViewCell> - </objects> -</document> diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReview.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReview.swift deleted file mode 100644 index 3c3b2f5ec4..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReview.swift +++ /dev/null @@ -1,12 +0,0 @@ -@objc(MWMUGCYourReview) -final class UGCYourReview: NSObject, MWMReviewProtocol { - let date: String - let text: String - let ratings: [UGCRatingStars] - - @objc init(date: String, text: String, ratings: [UGCRatingStars]) { - self.date = date - self.text = text - self.ratings = ratings - } -} diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.swift b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.swift deleted file mode 100644 index 62c90d4e96..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.swift +++ /dev/null @@ -1,69 +0,0 @@ -@objc(MWMUGCYourReviewCell) -final class UGCYourReviewCell: MWMTableViewCell { - private enum Config { - static let defaultReviewBottomOffset: CGFloat = 16 - } - - @IBOutlet private weak var titleLabel: UILabel! - @IBOutlet private weak var dateLabel: UILabel! - @IBOutlet private weak var reviewLabel: ExpandableReviewView! { - didSet { - let settings = ExpandableReviewSettings(expandText: L("placepage_more_button"), - expandTextColor: .linkBlue(), - textColor: .blackPrimaryText(), - textFont: .regular14()) - reviewLabel.apply(settings: settings) - } - } - - @IBOutlet private weak var reviewBottomOffset: NSLayoutConstraint! - @IBOutlet private weak var ratingCollectionView: UICollectionView! { - didSet { - ratingCollectionView.register(cellClass: UGCSummaryRatingStarsCell.self) - } - } - - private var yourReview: UGCYourReview! - - override var frame: CGRect { - didSet { - if frame.size != oldValue.size { - updateCollectionView() - } - } - } - - @objc func config(yourReview: UGCYourReview, isExpanded: Bool, onUpdate: @escaping () -> Void) { - dateLabel.text = yourReview.date - self.yourReview = yourReview - reviewLabel.configure(text: yourReview.text, - isExpanded: isExpanded, - onUpdate: onUpdate) - reviewBottomOffset.constant = yourReview.text.isEmpty ? 0 : Config.defaultReviewBottomOffset - updateCollectionView() - isSeparatorHidden = true - } - - override func didMoveToSuperview() { - super.didMoveToSuperview() - updateCollectionView() - } - - private func updateCollectionView() { - DispatchQueue.main.async { - self.ratingCollectionView.reloadData() - } - } -} - -extension UGCYourReviewCell: UICollectionViewDataSource { - func collectionView(_: UICollectionView, numberOfItemsInSection _: Int) -> Int { - return yourReview?.ratings.count ?? 0 - } - - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell = collectionView.dequeueReusableCell(withCellClass: UGCSummaryRatingStarsCell.self, indexPath: indexPath) as! UGCSummaryRatingStarsCell - cell.config(rating: yourReview!.ratings[indexPath.item]) - return cell - } -} diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.xib b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.xib deleted file mode 100644 index 3a3317b063..0000000000 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/UGC/UGCYourReviewCell.xib +++ /dev/null @@ -1,125 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" 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="15704"/> - <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="none" indentationWidth="10" reuseIdentifier="UGCYourReviewCell" id="KGk-i7-Jjw" customClass="MWMUGCYourReviewCell" propertyAccessControl="none"> - <rect key="frame" x="0.0" y="0.0" width="320" height="192"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> - <rect key="frame" x="0.0" y="0.0" width="320" height="192"/> - <autoresizingMask key="autoresizingMask"/> - <subviews> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="M3q-L0-4Y7" propertyAccessControl="none"> - <rect key="frame" x="0.0" y="0.0" width="320" height="135"/> - <subviews> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" verticalCompressionResistancePriority="751" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nht-6C-S3i"> - <rect key="frame" x="16" y="16" width="42" height="20.5"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="bold14:blackPrimaryText"/> - <userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="placepage_reviews_your_comment"/> - </userDefinedRuntimeAttributes> - </label> - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="252" verticalCompressionResistancePriority="751" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qZ5-I9-7dJ"> - <rect key="frame" x="16" y="40.5" width="42" height="21"/> - <fontDescription key="fontDescription" type="system" pointSize="17"/> - <nil key="textColor"/> - <nil key="highlightedColor"/> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="regular12:blackSecondaryText"/> - </userDefinedRuntimeAttributes> - </label> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="G4x-pj-fmv" customClass="ExpandableReviewView" customModule="maps_me" customModuleProvider="target"> - <rect key="frame" x="16" y="77.5" width="288" height="40.5"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - </view> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aOE-yo-hUQ"> - <rect key="frame" x="16" y="134" width="304" height="1"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="1" id="E6L-PS-9ij"/> - </constraints> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Divider"/> - </userDefinedRuntimeAttributes> - </view> - </subviews> - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - <constraints> - <constraint firstItem="G4x-pj-fmv" firstAttribute="leading" secondItem="qZ5-I9-7dJ" secondAttribute="leading" id="0tv-ab-Ino"/> - <constraint firstItem="aOE-yo-hUQ" firstAttribute="leading" secondItem="nht-6C-S3i" secondAttribute="leading" id="5zo-5x-C5V"/> - <constraint firstItem="qZ5-I9-7dJ" firstAttribute="leading" secondItem="nht-6C-S3i" secondAttribute="leading" id="Gau-1M-wwW"/> - <constraint firstItem="aOE-yo-hUQ" firstAttribute="top" secondItem="G4x-pj-fmv" secondAttribute="bottom" priority="999" constant="16" id="NW0-Eu-IsI"/> - <constraint firstItem="G4x-pj-fmv" firstAttribute="top" secondItem="qZ5-I9-7dJ" secondAttribute="bottom" constant="16" id="OH9-Mm-dbX"/> - <constraint firstAttribute="trailing" secondItem="G4x-pj-fmv" secondAttribute="trailing" constant="16" id="PNg-SO-p6V"/> - <constraint firstItem="nht-6C-S3i" firstAttribute="leading" secondItem="M3q-L0-4Y7" secondAttribute="leading" constant="16" id="PY2-qj-nDO"/> - <constraint firstItem="qZ5-I9-7dJ" firstAttribute="top" secondItem="nht-6C-S3i" secondAttribute="bottom" constant="4" id="S3o-tR-arb"/> - <constraint firstAttribute="trailing" secondItem="aOE-yo-hUQ" secondAttribute="trailing" id="cx3-dh-2bm"/> - <constraint firstAttribute="bottom" secondItem="aOE-yo-hUQ" secondAttribute="bottom" id="hbw-cC-TVb"/> - <constraint firstItem="nht-6C-S3i" firstAttribute="top" secondItem="M3q-L0-4Y7" secondAttribute="top" constant="16" id="v5J-lZ-cdA"/> - </constraints> - </view> - <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" pagingEnabled="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" prefetchingEnabled="NO" translatesAutoresizingMaskIntoConstraints="NO" id="w6j-GC-6Bv"> - <rect key="frame" x="0.0" y="135" width="320" height="56"/> - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - <constraints> - <constraint firstAttribute="height" priority="999" constant="56" id="2hn-mr-UAw"/> - </constraints> - <collectionViewFlowLayout key="collectionViewLayout" scrollDirection="horizontal" minimumLineSpacing="12" minimumInteritemSpacing="16" id="MWR-PM-MMO"> - <size key="itemSize" width="120" height="32"/> - <size key="headerReferenceSize" width="0.0" height="0.0"/> - <size key="footerReferenceSize" width="0.0" height="0.0"/> - <inset key="sectionInset" minX="16" minY="12" maxX="16" maxY="12"/> - </collectionViewFlowLayout> - <connections> - <outlet property="dataSource" destination="KGk-i7-Jjw" id="XNi-U1-zp7"/> - </connections> - </collectionView> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="l8v-v7-2Xf"> - <rect key="frame" x="0.0" y="191" width="320" height="1"/> - <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <constraints> - <constraint firstAttribute="height" constant="1" id="FbW-ej-brB"/> - </constraints> - <userDefinedRuntimeAttributes> - <userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Divider"/> - </userDefinedRuntimeAttributes> - </view> - </subviews> - <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> - <constraints> - <constraint firstItem="l8v-v7-2Xf" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="77N-Z4-HEp"/> - <constraint firstItem="w6j-GC-6Bv" firstAttribute="top" secondItem="M3q-L0-4Y7" secondAttribute="bottom" id="L8X-HU-Nlw"/> - <constraint firstItem="M3q-L0-4Y7" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="T9p-nW-wRb"/> - <constraint firstItem="M3q-L0-4Y7" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="WVZ-X8-ZDo"/> - <constraint firstAttribute="trailing" secondItem="w6j-GC-6Bv" secondAttribute="trailing" id="XBx-IK-uxK"/> - <constraint firstAttribute="trailing" secondItem="M3q-L0-4Y7" secondAttribute="trailing" id="azy-n1-1rx"/> - <constraint firstAttribute="trailing" secondItem="M3q-L0-4Y7" secondAttribute="trailing" id="cLA-Dj-Ldj"/> - <constraint firstAttribute="bottom" secondItem="l8v-v7-2Xf" secondAttribute="bottom" id="l0O-cH-aHC"/> - <constraint firstItem="l8v-v7-2Xf" firstAttribute="top" secondItem="w6j-GC-6Bv" secondAttribute="bottom" id="nHN-wy-OWN"/> - <constraint firstItem="w6j-GC-6Bv" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="nP1-Z3-mNg"/> - <constraint firstItem="M3q-L0-4Y7" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="pqg-Sh-Khw"/> - <constraint firstAttribute="trailing" secondItem="l8v-v7-2Xf" secondAttribute="trailing" id="tjg-JB-UYP"/> - <constraint firstItem="M3q-L0-4Y7" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="xIs-eU-Xzv"/> - </constraints> - </tableViewCellContentView> - <connections> - <outlet property="dateLabel" destination="qZ5-I9-7dJ" id="Hkf-h6-ybf"/> - <outlet property="ratingCollectionView" destination="w6j-GC-6Bv" id="SbY-HY-zXO"/> - <outlet property="reviewBottomOffset" destination="NW0-Eu-IsI" id="emL-VB-8lD"/> - <outlet property="reviewLabel" destination="G4x-pj-fmv" id="pWq-RG-xv0"/> - <outlet property="titleLabel" destination="nht-6C-S3i" id="1lQ-nA-n7z"/> - </connections> - <point key="canvasLocation" x="139" y="155"/> - </tableViewCell> - </objects> -</document> |