Manos Chorianopoulos

Wallet redesign changes

......@@ -8,6 +8,9 @@
import UIKit
@objc public class WalletActiveCouponsTableViewCell: UITableViewCell {
@IBOutlet weak var sectionTitleLabel: UILabel!
@IBOutlet weak var historyButtonImage: UIImageView!
@IBOutlet weak var dfyViewParent: UIView!
@IBOutlet weak var dfyView: UIView!
@IBOutlet weak var dfyImage: UIImageView!
......@@ -32,6 +35,12 @@ import UIKit
super.awakeFromNib()
// Initialization code
// Section Header
sectionTitleLabel.text = "Κουπόνια"
historyButtonImage.image = UIImage(named: "wallet_history_blue", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
historyButtonImage.image = historyButtonImage.image?.withRenderingMode(.alwaysTemplate)
historyButtonImage.tintColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
// DFY Banner
// dfyViewParent.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00)
dfyViewParent.backgroundColor = .white
......
......@@ -13,24 +13,39 @@ import UIKit
@IBOutlet weak var bannerIconImageWidth: NSLayoutConstraint!
@IBOutlet weak var bannerLabel: UILabel!
@IBOutlet weak var bannerLabelLeftSpace: NSLayoutConstraint!
@IBOutlet weak var bannerArrowImage: UIImageView!
// @IBOutlet weak var bannerArrowImage: UIImageView!
@IBOutlet weak var bannerCenteredView: UIView!
@IBOutlet weak var bannerCenteredIconImage: UIImageView!
@IBOutlet weak var bannerCenteredIconImageWidth: NSLayoutConstraint!
@IBOutlet weak var bannerCenteredLabel: UILabel!
@IBOutlet weak var bannerCenteredLabelLeftSpace: NSLayoutConstraint!
public override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
bannerView.layer.cornerRadius = 16.0
bannerView.layer.cornerRadius = 12.0
bannerView.layer.borderWidth = 1
bannerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
bannerView.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
// bannerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
bannerCenteredView.layer.cornerRadius = 12.0
bannerCenteredView.layer.borderWidth = 1
bannerCenteredView.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
// Add shadow
bannerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
bannerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
bannerView.layer.shadowOpacity = 1.0
bannerView.layer.shadowRadius = 1.0
// bannerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
// bannerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
// bannerView.layer.shadowOpacity = 1.0
// bannerView.layer.shadowRadius = 1.0
bannerIconImage.image = UIImage(named: "wallet_plus", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
bannerCenteredIconImage.image = UIImage(named: "wallet_plus", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
// bannerArrowImage.image = UIImage(named: "arrow_right_black", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
bannerIconImage.image = UIImage(named: "wallet_plus_blue", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
bannerArrowImage.image = UIImage(named: "arrow_right_black", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
bannerLabel.font = UIFont(name: "PeridotPE-Bold", size: 12)
bannerCenteredLabel.font = UIFont(name: "PeridotPE-Bold", size: 12)
}
public override func setSelected(_ selected: Bool, animated: Bool) {
......@@ -39,7 +54,7 @@ import UIKit
// Configure the view for the selected state
}
func configureCell() {
func configureCell(isCentered: Bool) {
let userTag = swiftApi().getUserTag()
// print("User tag: " + userTag)
if (userTag != "" && userTag != "undefined") {
......@@ -48,13 +63,39 @@ import UIKit
bannerIconImage.isHidden = true
bannerIconImageWidth.constant = CGFloat(0.0)
bannerLabelLeftSpace.constant = CGFloat(0.0)
bannerView.frame.size.width = bannerView.intrinsicContentSize.width
bannerCenteredLabel.text = userTag
bannerCenteredLabel.frame.size.width = bannerCenteredLabel.intrinsicContentSize.width
bannerCenteredIconImage.isHidden = true
bannerCenteredIconImageWidth.constant = CGFloat(0.0)
bannerCenteredLabelLeftSpace.constant = CGFloat(0.0)
bannerCenteredView.frame.size.width = bannerLabel.intrinsicContentSize.width
} else {
bannerLabel.text = "Πρόσθεσε τις προτιμήσεις σου"
bannerLabel.frame.size.width = bannerLabel.intrinsicContentSize.width
bannerIconImage.isHidden = false
bannerIconImageWidth.constant = CGFloat(22.0)
bannerLabelLeftSpace.constant = CGFloat(10.0)
bannerIconImageWidth.constant = CGFloat(16.0)
bannerLabelLeftSpace.constant = CGFloat(5.0)
bannerView.frame.size.width = bannerView.intrinsicContentSize.width
bannerCenteredLabel.text = "Πρόσθεσε τις προτιμήσεις σου"
bannerCenteredLabel.frame.size.width = bannerCenteredLabel.intrinsicContentSize.width
bannerCenteredIconImage.isHidden = false
bannerCenteredIconImageWidth.constant = CGFloat(16.0)
bannerCenteredLabelLeftSpace.constant = CGFloat(5.0)
bannerCenteredView.frame.size.width = bannerCenteredView.intrinsicContentSize.width
}
if (isCentered) {
bannerView.isHidden = true
bannerCenteredView.isHidden = false
} else {
bannerView.isHidden = false
bannerCenteredView.isHidden = true
}
}
......