Manos Chorianopoulos

UnifiedCouponBarcodeViewController ui fixes

......@@ -25,20 +25,22 @@ import AVFoundation
termsTextView.delegate = self
mapButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 17)
mapButton.titleLabel?.font = UIFont(name: "PeridotPE-SBold", size: 17)
mapButton.setTitle("Δες τα supermarket", for: .normal)
mapButton.setTitleColor(UIColor(red: 1.00, green: 1.00, blue: 1.00, alpha: 1.00), for: .normal)
mapButton.backgroundColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00)
mapButton.layer.cornerRadius = 15.0
mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 50)
mapButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
mapButton.frame = CGRect(x: 0.0, y: 0.0, width: 260, height: 55)
// mapButton.frame = CGRect(x: 0.0, y: 0.0, width: mapButton.intrinsicContentSize.width, height: 50)
// mapButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
cancelButton.titleLabel?.font = UIFont(name: "PeridotPE-Bold", size: 17)
cancelButton.setTitle("Ακύρωση ενιαίου κουπονιού", for: .normal)
cancelButton.setTitle("Ακυρωση κουπονιού", for: .normal) // Ακύρωση ενιαίου κουπονιού
cancelButton.setTitleColor(UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00), for: .normal)
cancelButton.layer.cornerRadius = 15.0
cancelButton.frame = CGRect(x: 0.0, y: 0.0, width: cancelButton.intrinsicContentSize.width, height: 50)
cancelButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
cancelButton.frame = CGRect(x: 0.0, y: 0.0, width: 260, height: 55)
// cancelButton.frame = CGRect(x: 0.0, y: 0.0, width: cancelButton.intrinsicContentSize.width, height: 50)
// cancelButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 25, bottom: 0, right: 25)
cancelButton.backgroundColor = .clear
cancelButton.layer.borderWidth = 2
cancelButton.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
......
......@@ -26,6 +26,8 @@ import AVFoundation
@IBOutlet weak var barcodeLabelHeight: NSLayoutConstraint!
@IBOutlet weak var showBarcodeButton: UIButton!
@IBOutlet weak var expirationLabel: UILabel!
@IBOutlet weak var expirationLabelHeight: NSLayoutConstraint!
@IBOutlet weak var expirationLabelTopSpace: NSLayoutConstraint!
@IBOutlet weak var borderViewHeight: NSLayoutConstraint!
@IBOutlet weak var borderView2Height: NSLayoutConstraint!
@IBOutlet weak var border1TopSpace: NSLayoutConstraint!
......@@ -35,6 +37,9 @@ import AVFoundation
@IBOutlet weak var showBarcodeButtonHeight: NSLayoutConstraint!
@IBOutlet weak var showBarcodeButtonTopSpace: NSLayoutConstraint!
@IBOutlet weak var showCouponsButton: UIButton!
@IBOutlet weak var topExpirationView: UIView!
@IBOutlet weak var topExpirationLabel: UILabel!
@IBOutlet weak var barcodeTitleLabel: UILabel!
let uiscreen: CGRect = UIScreen.main.bounds
......@@ -55,6 +60,23 @@ import AVFoundation
couponImageHeight.constant = 222 // 255 //230 // 253 // self.uiscreen.height * 0.25
nameLabel.text = "Εκπτωτικό κουπόνι COSMOTE SUPERMARKET DEALS!"
topExpirationView.backgroundColor = UIColor(rgb: 0xB8E0EF)
topExpirationView.layer.cornerRadius = 13.0
topExpirationLabel.font = UIFont(name: "PeridotPE-Bold", size: 13)
topExpirationLabel.textColor = UIColor(rgb: 0x004B87)
// Hide bottom expirationLabel ==>
expirationLabel.isHidden = true
expirationLabelHeight.constant = CGFloat(0)
expirationLabelTopSpace.constant = CGFloat(0)
// ===
barcodeTitleLabel.text = "barcode κουπονιού"
barcodeTitleLabel.font = UIFont(name: "PeridotPE-Bold", size: 16)
barcodeTitleLabel.textColor = UIColor(rgb: 0x212121)
discriptionLabel.text = "Χρησιμοποίησε τον παρακάτω κωδικό και πάρε έκπτωση στα ενεργά κουπόνια προσφορών."
merchantDescrTextView.text = ""
......@@ -199,8 +221,11 @@ import AVFoundation
// if let earliestExpiration = coupon?._coupons.min(by: { ($0.expiration ?? "") < ($1.expiration ?? "") }) {
if let latestExpiration = coupon?._coupons.max(by: { ($0.expiration ?? "") < ($1.expiration ?? "") }) {
expirationLabel.text = "Το κουπόνι ισχύει έως " + (latestExpiration.expiration ?? "")
topExpirationLabel.text = "Ισχύει έως " + (latestExpiration.expiration ?? "")
topExpirationLabel.frame.size.width = topExpirationLabel.intrinsicContentSize.width
} else {
expirationLabel.text = ""
topExpirationLabel.text = ""
}
toggleCoupons(couponsVisible: couponsVisible)
......