Manos Chorianopoulos

couponset fixes

...@@ -11,6 +11,7 @@ import UIKit ...@@ -11,6 +11,7 @@ import UIKit
11 public class CategoryOfferCollectionViewCell: UICollectionViewCell { 11 public class CategoryOfferCollectionViewCell: UICollectionViewCell {
12 @IBOutlet weak var parentView: UIView! 12 @IBOutlet weak var parentView: UIView!
13 @IBOutlet weak var bannerImage: UIImageView! 13 @IBOutlet weak var bannerImage: UIImageView!
14 + @IBOutlet weak var merchantLogoView: UIView!
14 @IBOutlet weak var logoImage: UIImageView! 15 @IBOutlet weak var logoImage: UIImageView!
15 @IBOutlet weak var discountView: UIView! 16 @IBOutlet weak var discountView: UIView!
16 @IBOutlet weak var discountLabel: UILabel! 17 @IBOutlet weak var discountLabel: UILabel!
...@@ -61,8 +62,12 @@ public class CategoryOfferCollectionViewCell: UICollectionViewCell { ...@@ -61,8 +62,12 @@ public class CategoryOfferCollectionViewCell: UICollectionViewCell {
61 parentView.layer.cornerRadius = 12.0 62 parentView.layer.cornerRadius = 12.0
62 parentView.clipsToBounds = true 63 parentView.clipsToBounds = true
63 64
64 - discountView.layer.cornerRadius = 17.0 65 + discountView.layer.cornerRadius = discountView.bounds.height / 2
65 discountView.clipsToBounds = true 66 discountView.clipsToBounds = true
67 +
68 + merchantLogoView.backgroundColor = UIColor(rgb: 0xFFFFFF)
69 + merchantLogoView.layer.cornerRadius = 10.0
70 + merchantLogoView.clipsToBounds = true
66 } 71 }
67 72
68 func configureCell(data: CouponSetItemModel) { 73 func configureCell(data: CouponSetItemModel) {
...@@ -99,8 +104,8 @@ public class CategoryOfferCollectionViewCell: UICollectionViewCell { ...@@ -99,8 +104,8 @@ public class CategoryOfferCollectionViewCell: UICollectionViewCell {
99 expirationLabel.textColor = UIColor(rgb: 0x9BA1A6) 104 expirationLabel.textColor = UIColor(rgb: 0x9BA1A6)
100 105
101 // Use merchant logo from bound merchant data 106 // Use merchant logo from bound merchant data
102 - if let merchant = data._merchant, !merchant._img_preview.isEmpty { 107 + if let merchant = data._merchant, !merchant._preview_img.isEmpty {
103 - self.logoImageURL = merchant._img_preview 108 + self.logoImageURL = merchant._preview_img
104 } else { 109 } else {
105 self.logoImageURL = nil 110 self.logoImageURL = nil
106 } 111 }
......
...@@ -25,18 +25,30 @@ ...@@ -25,18 +25,30 @@
25 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="cM3-Rs-tV7"> 25 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="cM3-Rs-tV7">
26 <rect key="frame" x="0.0" y="0.0" width="170" height="140"/> 26 <rect key="frame" x="0.0" y="0.0" width="170" height="140"/>
27 </imageView> 27 </imageView>
28 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5Rg-gJ-eWP" userLabel="MerchantLogoView">
29 + <rect key="frame" x="59.666666666666657" y="44.666666666666657" width="51" height="51"/>
30 + <subviews>
28 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="dN4-St-uW8"> 31 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="dN4-St-uW8">
29 - <rect key="frame" x="61" y="46" width="48" height="48"/> 32 + <rect key="frame" x="1.3333333333333357" y="1.3333333333333357" width="48" height="48"/>
30 <constraints> 33 <constraints>
31 <constraint firstAttribute="width" constant="48" id="eO5-Tu-vX9"/> 34 <constraint firstAttribute="width" constant="48" id="eO5-Tu-vX9"/>
32 <constraint firstAttribute="height" constant="48" id="fP6-Uv-wY0"/> 35 <constraint firstAttribute="height" constant="48" id="fP6-Uv-wY0"/>
33 </constraints> 36 </constraints>
34 </imageView> 37 </imageView>
38 + </subviews>
39 + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
40 + <constraints>
41 + <constraint firstItem="dN4-St-uW8" firstAttribute="centerY" secondItem="5Rg-gJ-eWP" secondAttribute="centerY" id="Xlp-xw-USg"/>
42 + <constraint firstAttribute="height" constant="51" id="k9D-2T-a4U"/>
43 + <constraint firstAttribute="width" constant="51" id="kpd-Cy-QdD"/>
44 + <constraint firstItem="dN4-St-uW8" firstAttribute="centerX" secondItem="5Rg-gJ-eWP" secondAttribute="centerX" id="lwO-HT-CNd"/>
45 + </constraints>
46 + </view>
35 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gQ7-Vw-xZ1" userLabel="discountView"> 47 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gQ7-Vw-xZ1" userLabel="discountView">
36 - <rect key="frame" x="128" y="8" width="34" height="34"/> 48 + <rect key="frame" x="121" y="8" width="41" height="41"/>
37 <subviews> 49 <subviews>
38 <label opaque="NO" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="%" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" translatesAutoresizingMaskIntoConstraints="NO" id="hR8-Wx-yA2"> 50 <label opaque="NO" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="%" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" translatesAutoresizingMaskIntoConstraints="NO" id="hR8-Wx-yA2">
39 - <rect key="frame" x="2" y="2" width="30" height="30"/> 51 + <rect key="frame" x="2" y="2" width="37" height="37"/>
40 <fontDescription key="fontDescription" type="system" pointSize="14"/> 52 <fontDescription key="fontDescription" type="system" pointSize="14"/>
41 <nil key="textColor"/> 53 <nil key="textColor"/>
42 <nil key="highlightedColor"/> 54 <nil key="highlightedColor"/>
...@@ -44,8 +56,8 @@ ...@@ -44,8 +56,8 @@
44 </subviews> 56 </subviews>
45 <color key="backgroundColor" red="0.79600000000000004" green="0.79600000000000004" blue="0.79600000000000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> 57 <color key="backgroundColor" red="0.79600000000000004" green="0.79600000000000004" blue="0.79600000000000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
46 <constraints> 58 <constraints>
47 - <constraint firstAttribute="width" constant="34" id="iS9-Xy-zB3"/> 59 + <constraint firstAttribute="width" constant="41" id="iS9-Xy-zB3"/>
48 - <constraint firstAttribute="height" constant="34" id="jT0-Yz-AC4"/> 60 + <constraint firstAttribute="height" constant="41" id="jT0-Yz-AC4"/>
49 <constraint firstItem="hR8-Wx-yA2" firstAttribute="top" secondItem="gQ7-Vw-xZ1" secondAttribute="top" constant="2" id="kU1-Za-BD5"/> 61 <constraint firstItem="hR8-Wx-yA2" firstAttribute="top" secondItem="gQ7-Vw-xZ1" secondAttribute="top" constant="2" id="kU1-Za-BD5"/>
50 <constraint firstItem="hR8-Wx-yA2" firstAttribute="leading" secondItem="gQ7-Vw-xZ1" secondAttribute="leading" constant="2" id="lV2-Ab-CE6"/> 62 <constraint firstItem="hR8-Wx-yA2" firstAttribute="leading" secondItem="gQ7-Vw-xZ1" secondAttribute="leading" constant="2" id="lV2-Ab-CE6"/>
51 <constraint firstAttribute="trailing" secondItem="hR8-Wx-yA2" secondAttribute="trailing" constant="2" id="mW3-Bc-DF7"/> 63 <constraint firstAttribute="trailing" secondItem="hR8-Wx-yA2" secondAttribute="trailing" constant="2" id="mW3-Bc-DF7"/>
...@@ -55,12 +67,12 @@ ...@@ -55,12 +67,12 @@
55 </subviews> 67 </subviews>
56 <color key="backgroundColor" red="0.93700000000000006" green="0.94099999999999995" blue="0.94499999999999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> 68 <color key="backgroundColor" red="0.93700000000000006" green="0.94099999999999995" blue="0.94499999999999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
57 <constraints> 69 <constraints>
70 + <constraint firstItem="5Rg-gJ-eWP" firstAttribute="centerY" secondItem="bL2-Qr-sU6" secondAttribute="centerY" id="79F-Ln-if0"/>
71 + <constraint firstItem="5Rg-gJ-eWP" firstAttribute="centerX" secondItem="bL2-Qr-sU6" secondAttribute="centerX" id="Llr-kz-Q2U"/>
58 <constraint firstItem="cM3-Rs-tV7" firstAttribute="top" secondItem="bL2-Qr-sU6" secondAttribute="top" id="oY5-De-FH9"/> 72 <constraint firstItem="cM3-Rs-tV7" firstAttribute="top" secondItem="bL2-Qr-sU6" secondAttribute="top" id="oY5-De-FH9"/>
59 <constraint firstItem="cM3-Rs-tV7" firstAttribute="leading" secondItem="bL2-Qr-sU6" secondAttribute="leading" id="pZ6-Ef-GI0"/> 73 <constraint firstItem="cM3-Rs-tV7" firstAttribute="leading" secondItem="bL2-Qr-sU6" secondAttribute="leading" id="pZ6-Ef-GI0"/>
60 <constraint firstAttribute="trailing" secondItem="cM3-Rs-tV7" secondAttribute="trailing" id="qA7-Fg-HJ1"/> 74 <constraint firstAttribute="trailing" secondItem="cM3-Rs-tV7" secondAttribute="trailing" id="qA7-Fg-HJ1"/>
61 <constraint firstAttribute="bottom" secondItem="cM3-Rs-tV7" secondAttribute="bottom" id="rB8-Gh-IK2"/> 75 <constraint firstAttribute="bottom" secondItem="cM3-Rs-tV7" secondAttribute="bottom" id="rB8-Gh-IK2"/>
62 - <constraint firstItem="dN4-St-uW8" firstAttribute="centerX" secondItem="bL2-Qr-sU6" secondAttribute="centerX" id="sC9-Hi-JL3"/>
63 - <constraint firstItem="dN4-St-uW8" firstAttribute="centerY" secondItem="bL2-Qr-sU6" secondAttribute="centerY" id="tD0-Ij-KM4"/>
64 <constraint firstAttribute="trailing" secondItem="gQ7-Vw-xZ1" secondAttribute="trailing" constant="8" id="uE1-Jk-LN5"/> 76 <constraint firstAttribute="trailing" secondItem="gQ7-Vw-xZ1" secondAttribute="trailing" constant="8" id="uE1-Jk-LN5"/>
65 <constraint firstItem="gQ7-Vw-xZ1" firstAttribute="top" secondItem="bL2-Qr-sU6" secondAttribute="top" constant="8" id="vF2-Kl-MO6"/> 77 <constraint firstItem="gQ7-Vw-xZ1" firstAttribute="top" secondItem="bL2-Qr-sU6" secondAttribute="top" constant="8" id="vF2-Kl-MO6"/>
66 <constraint firstAttribute="height" constant="140" id="wG3-Lm-NP7"/> 78 <constraint firstAttribute="height" constant="140" id="wG3-Lm-NP7"/>
...@@ -138,6 +150,7 @@ ...@@ -138,6 +150,7 @@
138 <outlet property="discountView" destination="gQ7-Vw-xZ1" id="BL4-Qr-SU8"/> 150 <outlet property="discountView" destination="gQ7-Vw-xZ1" id="BL4-Qr-SU8"/>
139 <outlet property="expirationLabel" destination="BL8-Qr-SU2" id="CM5-Rs-TV9"/> 151 <outlet property="expirationLabel" destination="BL8-Qr-SU2" id="CM5-Rs-TV9"/>
140 <outlet property="logoImage" destination="dN4-St-uW8" id="DN6-St-UW0"/> 152 <outlet property="logoImage" destination="dN4-St-uW8" id="DN6-St-UW0"/>
153 + <outlet property="merchantLogoView" destination="5Rg-gJ-eWP" id="9PO-A2-aZM"/>
141 <outlet property="merchantNameLabel" destination="yI5-No-PR9" id="EO7-Tu-VX1"/> 154 <outlet property="merchantNameLabel" destination="yI5-No-PR9" id="EO7-Tu-VX1"/>
142 <outlet property="parentView" destination="aK1-Pq-rT5" id="FP8-Uv-WY2"/> 155 <outlet property="parentView" destination="aK1-Pq-rT5" id="FP8-Uv-WY2"/>
143 <outlet property="subtitleLabel" destination="AK7-Pq-RT1" id="GQ9-Vw-XZ3"/> 156 <outlet property="subtitleLabel" destination="AK7-Pq-RT1" id="GQ9-Vw-XZ3"/>
......
...@@ -67,6 +67,7 @@ public class MyRewardsOfferCollectionViewCell: UICollectionViewCell { ...@@ -67,6 +67,7 @@ public class MyRewardsOfferCollectionViewCell: UICollectionViewCell {
67 67
68 discountView.layer.cornerRadius = 34.0 68 discountView.layer.cornerRadius = 34.0
69 69
70 + bannerImage.backgroundColor = UIColor(rgb: 0xE7E7E7)
70 } 71 }
71 72
72 func configureCell(data: OfferModel) { 73 func configureCell(data: OfferModel) {
...@@ -146,9 +147,9 @@ public class MyRewardsOfferCollectionViewCell: UICollectionViewCell { ...@@ -146,9 +147,9 @@ public class MyRewardsOfferCollectionViewCell: UICollectionViewCell {
146 expirationLabel.textColor = UIColor(rgb: 0x9BA1A6) 147 expirationLabel.textColor = UIColor(rgb: 0x9BA1A6)
147 148
148 // Use merchant logo from bound merchant data 149 // Use merchant logo from bound merchant data
149 - if let merchant = data._merchant, !merchant._img_preview.isEmpty { 150 + if let merchant = data._merchant, !merchant._preview_img.isEmpty {
150 // Use merchant's img_preview for logo 151 // Use merchant's img_preview for logo
151 - self.logoImageURL = merchant._img_preview 152 + self.logoImageURL = merchant._preview_img
152 } else { 153 } else {
153 self.logoImageURL = nil 154 self.logoImageURL = nil
154 } 155 }
......