Manos Chorianopoulos

redesign CouponBarcodeViewController

...@@ -77,22 +77,22 @@ import AVFoundation ...@@ -77,22 +77,22 @@ import AVFoundation
77 // scrollView.layer.cornerRadius = 30 77 // scrollView.layer.cornerRadius = 30
78 // scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius 78 // scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
79 79
80 - let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)! 80 +// let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
81 - var aspectR: CGFloat = 0.0 81 +// var aspectR: CGFloat = 0.0
82 - 82 +//
83 - aspectR = image.size.width/image.size.height 83 +// aspectR = image.size.width/image.size.height
84 - 84 +//
85 - topBorderLine.translatesAutoresizingMaskIntoConstraints = false 85 +// topBorderLine.translatesAutoresizingMaskIntoConstraints = false
86 - topBorderLine.image = image 86 +// topBorderLine.image = image
87 - topBorderLine.contentMode = .scaleAspectFill 87 +// topBorderLine.contentMode = .scaleAspectFill
88 - 88 +//
89 - NSLayoutConstraint.activate([ 89 +// NSLayoutConstraint.activate([
90 - topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0), 90 +// topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
91 - topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0), 91 +// topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
92 - topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0), 92 +// topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
93 - topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width), 93 +// topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
94 - topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR) 94 +// topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
95 - ]) 95 +// ])
96 96
97 // COUPONSET: desc, img_preview, name, terms 97 // COUPONSET: desc, img_preview, name, terms
98 // COUPON: coupon, expiration, discount, status 98 // COUPON: coupon, expiration, discount, status
...@@ -119,8 +119,8 @@ import AVFoundation ...@@ -119,8 +119,8 @@ import AVFoundation
119 119
120 if (htmlMerchDescrText != "") { 120 if (htmlMerchDescrText != "") {
121 merchantDescrTextView.attributedText = htmlMerchDescrText.htmlToAttributedString 121 merchantDescrTextView.attributedText = htmlMerchDescrText.htmlToAttributedString
122 - merchantDescrTextView.font = UIFont(name: "PFSquareSansPro-Regular", size: 17) 122 + merchantDescrTextView.font = UIFont(name: "PeridotPE-Regular", size: 16)
123 - merchantDescrTextView.textColor = UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00) 123 + merchantDescrTextView.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
124 merchantDescrTextView.textAlignment = .center 124 merchantDescrTextView.textAlignment = .center
125 merchantDescrTextView.isScrollEnabled = false 125 merchantDescrTextView.isScrollEnabled = false
126 merchantDescrTextView.isUserInteractionEnabled = true 126 merchantDescrTextView.isUserInteractionEnabled = true
...@@ -138,7 +138,7 @@ import AVFoundation ...@@ -138,7 +138,7 @@ import AVFoundation
138 } 138 }
139 } 139 }
140 140
141 - couponView.layer.cornerRadius = 8 141 + couponView.layer.cornerRadius = 16
142 couponNumberLabel.text = coupon?.coupon ?? "" 142 couponNumberLabel.text = coupon?.coupon ?? ""
143 couponView.frame = CGRect(x: 0.0, y: 0.0, width: couponView.intrinsicContentSize.width, height: 55) 143 couponView.frame = CGRect(x: 0.0, y: 0.0, width: couponView.intrinsicContentSize.width, height: 55)
144 144
...@@ -182,23 +182,23 @@ import AVFoundation ...@@ -182,23 +182,23 @@ import AVFoundation
182 showBarcodeButtonTopSpace.constant = 0 182 showBarcodeButtonTopSpace.constant = 0
183 // === 183 // ===
184 184
185 - showBarcodeButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16) 185 + showBarcodeButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 16)
186 showBarcodeButton.setTitle("Εμφάνιση barcode", for: .normal) 186 showBarcodeButton.setTitle("Εμφάνιση barcode", for: .normal)
187 - showBarcodeButton.setTitleColor(UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00), for: .normal) 187 + showBarcodeButton.setTitleColor(UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00), for: .normal)
188 showBarcodeButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal) 188 showBarcodeButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
189 showBarcodeButton.semanticContentAttribute = .forceRightToLeft 189 showBarcodeButton.semanticContentAttribute = .forceRightToLeft
190 - showBarcodeButton.tintColor = UIColor(red: 0.21, green: 0.32, blue: 0.41, alpha: 1.00) 190 + showBarcodeButton.tintColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 1.00)
191 showBarcodeButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0); 191 showBarcodeButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
192 showBarcodeButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5); 192 showBarcodeButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
193 showBarcodeButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8) 193 showBarcodeButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
194 194
195 expirationLabel.text = "Το κουπόνι ισχύει έως " + (coupon?.expiration ?? "") 195 expirationLabel.text = "Το κουπόνι ισχύει έως " + (coupon?.expiration ?? "")
196 196
197 - redeemButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18) 197 + redeemButton.titleLabel?.font = UIFont(name: "PeridotPE-SemiBold", size: 18)
198 redeemButton.setTitle("Δώρισέ το", for: .normal) 198 redeemButton.setTitle("Δώρισέ το", for: .normal)
199 redeemButton.setTitleColor(.white, for: .normal) 199 redeemButton.setTitleColor(.white, for: .normal)
200 - redeemButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00) 200 + redeemButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
201 - redeemButton.layer.cornerRadius = 8.0 201 + redeemButton.layer.cornerRadius = 16.0
202 redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: redeemButton.intrinsicContentSize.width, height: 44) 202 redeemButton.frame = CGRect(x: 0.0, y: 0.0, width: redeemButton.intrinsicContentSize.width, height: 44)
203 redeemButton.contentEdgeInsets = UIEdgeInsets(top: 1, left: 16, bottom: 0, right: 16) 203 redeemButton.contentEdgeInsets = UIEdgeInsets(top: 1, left: 16, bottom: 0, right: 16)
204 // Fix width for ipad 204 // Fix width for ipad
...@@ -210,13 +210,16 @@ import AVFoundation ...@@ -210,13 +210,16 @@ import AVFoundation
210 // redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true 210 // redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
211 // } 211 // }
212 212
213 - mapButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18) 213 + mapButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 18)
214 mapButton.setTitle("Δες τα καταστήματα", for: .normal) 214 mapButton.setTitle("Δες τα καταστήματα", for: .normal)
215 - mapButton.setTitleColor(UIColor(red: 0.31, green: 0.62, blue: 0.18, alpha: 1.00), for: .normal) 215 + mapButton.setTitleColor(UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00), for: .normal)
216 - mapButton.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00) 216 + mapButton.layer.cornerRadius = 15.0
217 - mapButton.layer.cornerRadius = 8.0
218 mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44) 217 mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 44)
219 mapButton.contentEdgeInsets = UIEdgeInsets(top: 1, left: 16, bottom: 0, right: 16) 218 mapButton.contentEdgeInsets = UIEdgeInsets(top: 1, left: 16, bottom: 0, right: 16)
219 + mapButton.backgroundColor = .clear
220 + mapButton.layer.borderWidth = 2
221 + mapButton.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
222 +
220 223
221 // mapButton.isHidden = true 224 // mapButton.isHidden = true
222 // mapButtonHeight.constant = 0 225 // mapButtonHeight.constant = 0
...@@ -265,21 +268,21 @@ import AVFoundation ...@@ -265,21 +268,21 @@ import AVFoundation
265 // mapButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true 268 // mapButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
266 // } 269 // }
267 270
268 - termsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Regular", size: 16) 271 + termsButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 16)
269 // termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5) 272 // termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
270 termsButton.setTitle("Όροι χρήσης", for: .normal) 273 termsButton.setTitle("Όροι χρήσης", for: .normal)
271 - termsButton.setTitleColor(UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00), for: .normal) 274 + termsButton.setTitleColor(UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00), for: .normal)
272 termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal) 275 termsButton.setImage(UIImage(named: "ic_down_dark_2.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
273 termsButton.semanticContentAttribute = .forceRightToLeft 276 termsButton.semanticContentAttribute = .forceRightToLeft
274 - termsButton.tintColor = UIColor(red: 0.21, green: 0.32, blue: 0.41, alpha: 1.00) 277 + termsButton.tintColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 1.00)
275 termsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0); 278 termsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
276 termsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5); 279 termsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
277 termsButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8) 280 termsButton.imageView?.layer.transform = CATransform3DMakeScale(0.8, 0.8, 0.8)
278 281
279 let htmlText = couponSetData?.terms ?? "" 282 let htmlText = couponSetData?.terms ?? ""
280 termsTextView.attributedText = htmlText.htmlToAttributedString 283 termsTextView.attributedText = htmlText.htmlToAttributedString
281 - termsTextView.font = UIFont(name: "PFSquareSansPro-Regular", size: 15) 284 + termsTextView.font = UIFont(name: "PeridotPE-Regular", size: 15)
282 - termsTextView.textColor = UIColor(red: 0.25, green: 0.33, blue: 0.39, alpha: 1.00) 285 + termsTextView.textColor = UIColor(red: 0.62, green: 0.62, blue: 0.61, alpha: 1.00)
283 termsTextView.textAlignment = .center 286 termsTextView.textAlignment = .center
284 termsTextView.isScrollEnabled = false 287 termsTextView.isScrollEnabled = false
285 288
......