Manos Chorianopoulos

Wallet redesign changes

...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
8 import UIKit 8 import UIKit
9 9
10 @objc public class WalletActiveCouponsTableViewCell: UITableViewCell { 10 @objc public class WalletActiveCouponsTableViewCell: UITableViewCell {
11 + @IBOutlet weak var sectionTitleLabel: UILabel!
12 + @IBOutlet weak var historyButtonImage: UIImageView!
13 +
11 @IBOutlet weak var dfyViewParent: UIView! 14 @IBOutlet weak var dfyViewParent: UIView!
12 @IBOutlet weak var dfyView: UIView! 15 @IBOutlet weak var dfyView: UIView!
13 @IBOutlet weak var dfyImage: UIImageView! 16 @IBOutlet weak var dfyImage: UIImageView!
...@@ -32,6 +35,12 @@ import UIKit ...@@ -32,6 +35,12 @@ import UIKit
32 super.awakeFromNib() 35 super.awakeFromNib()
33 // Initialization code 36 // Initialization code
34 37
38 + // Section Header
39 + sectionTitleLabel.text = "Κουπόνια"
40 + historyButtonImage.image = UIImage(named: "wallet_history_blue", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
41 + historyButtonImage.image = historyButtonImage.image?.withRenderingMode(.alwaysTemplate)
42 + historyButtonImage.tintColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
43 +
35 // DFY Banner 44 // DFY Banner
36 // dfyViewParent.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00) 45 // dfyViewParent.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00)
37 dfyViewParent.backgroundColor = .white 46 dfyViewParent.backgroundColor = .white
......
...@@ -13,24 +13,39 @@ import UIKit ...@@ -13,24 +13,39 @@ import UIKit
13 @IBOutlet weak var bannerIconImageWidth: NSLayoutConstraint! 13 @IBOutlet weak var bannerIconImageWidth: NSLayoutConstraint!
14 @IBOutlet weak var bannerLabel: UILabel! 14 @IBOutlet weak var bannerLabel: UILabel!
15 @IBOutlet weak var bannerLabelLeftSpace: NSLayoutConstraint! 15 @IBOutlet weak var bannerLabelLeftSpace: NSLayoutConstraint!
16 - @IBOutlet weak var bannerArrowImage: UIImageView! 16 +// @IBOutlet weak var bannerArrowImage: UIImageView!
17 +
18 + @IBOutlet weak var bannerCenteredView: UIView!
19 + @IBOutlet weak var bannerCenteredIconImage: UIImageView!
20 + @IBOutlet weak var bannerCenteredIconImageWidth: NSLayoutConstraint!
21 + @IBOutlet weak var bannerCenteredLabel: UILabel!
22 + @IBOutlet weak var bannerCenteredLabelLeftSpace: NSLayoutConstraint!
17 23
18 public override func awakeFromNib() { 24 public override func awakeFromNib() {
19 super.awakeFromNib() 25 super.awakeFromNib()
20 // Initialization code 26 // Initialization code
21 27
22 - bannerView.layer.cornerRadius = 16.0 28 + bannerView.layer.cornerRadius = 12.0
23 bannerView.layer.borderWidth = 1 29 bannerView.layer.borderWidth = 1
24 - bannerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor 30 + bannerView.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
31 +// bannerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
32 +
33 + bannerCenteredView.layer.cornerRadius = 12.0
34 + bannerCenteredView.layer.borderWidth = 1
35 + bannerCenteredView.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
25 36
26 // Add shadow 37 // Add shadow
27 - bannerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor 38 +// bannerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
28 - bannerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0) 39 +// bannerView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
29 - bannerView.layer.shadowOpacity = 1.0 40 +// bannerView.layer.shadowOpacity = 1.0
30 - bannerView.layer.shadowRadius = 1.0 41 +// bannerView.layer.shadowRadius = 1.0
42 +
43 + bannerIconImage.image = UIImage(named: "wallet_plus", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
44 + bannerCenteredIconImage.image = UIImage(named: "wallet_plus", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
45 +// bannerArrowImage.image = UIImage(named: "arrow_right_black", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
31 46
32 - bannerIconImage.image = UIImage(named: "wallet_plus_blue", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) 47 + bannerLabel.font = UIFont(name: "PeridotPE-Bold", size: 12)
33 - bannerArrowImage.image = UIImage(named: "arrow_right_black", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) 48 + bannerCenteredLabel.font = UIFont(name: "PeridotPE-Bold", size: 12)
34 } 49 }
35 50
36 public override func setSelected(_ selected: Bool, animated: Bool) { 51 public override func setSelected(_ selected: Bool, animated: Bool) {
...@@ -39,7 +54,7 @@ import UIKit ...@@ -39,7 +54,7 @@ import UIKit
39 // Configure the view for the selected state 54 // Configure the view for the selected state
40 } 55 }
41 56
42 - func configureCell() { 57 + func configureCell(isCentered: Bool) {
43 let userTag = swiftApi().getUserTag() 58 let userTag = swiftApi().getUserTag()
44 // print("User tag: " + userTag) 59 // print("User tag: " + userTag)
45 if (userTag != "" && userTag != "undefined") { 60 if (userTag != "" && userTag != "undefined") {
...@@ -48,13 +63,39 @@ import UIKit ...@@ -48,13 +63,39 @@ import UIKit
48 bannerIconImage.isHidden = true 63 bannerIconImage.isHidden = true
49 bannerIconImageWidth.constant = CGFloat(0.0) 64 bannerIconImageWidth.constant = CGFloat(0.0)
50 bannerLabelLeftSpace.constant = CGFloat(0.0) 65 bannerLabelLeftSpace.constant = CGFloat(0.0)
66 + bannerView.frame.size.width = bannerView.intrinsicContentSize.width
67 +
68 + bannerCenteredLabel.text = userTag
69 + bannerCenteredLabel.frame.size.width = bannerCenteredLabel.intrinsicContentSize.width
70 + bannerCenteredIconImage.isHidden = true
71 + bannerCenteredIconImageWidth.constant = CGFloat(0.0)
72 + bannerCenteredLabelLeftSpace.constant = CGFloat(0.0)
73 + bannerCenteredView.frame.size.width = bannerLabel.intrinsicContentSize.width
74 +
51 75
52 } else { 76 } else {
53 bannerLabel.text = "Πρόσθεσε τις προτιμήσεις σου" 77 bannerLabel.text = "Πρόσθεσε τις προτιμήσεις σου"
54 bannerLabel.frame.size.width = bannerLabel.intrinsicContentSize.width 78 bannerLabel.frame.size.width = bannerLabel.intrinsicContentSize.width
55 bannerIconImage.isHidden = false 79 bannerIconImage.isHidden = false
56 - bannerIconImageWidth.constant = CGFloat(22.0) 80 + bannerIconImageWidth.constant = CGFloat(16.0)
57 - bannerLabelLeftSpace.constant = CGFloat(10.0) 81 + bannerLabelLeftSpace.constant = CGFloat(5.0)
82 + bannerView.frame.size.width = bannerView.intrinsicContentSize.width
83 +
84 + bannerCenteredLabel.text = "Πρόσθεσε τις προτιμήσεις σου"
85 + bannerCenteredLabel.frame.size.width = bannerCenteredLabel.intrinsicContentSize.width
86 + bannerCenteredIconImage.isHidden = false
87 + bannerCenteredIconImageWidth.constant = CGFloat(16.0)
88 + bannerCenteredLabelLeftSpace.constant = CGFloat(5.0)
89 + bannerCenteredView.frame.size.width = bannerCenteredView.intrinsicContentSize.width
90 + }
91 +
92 + if (isCentered) {
93 + bannerView.isHidden = true
94 + bannerCenteredView.isHidden = false
95 +
96 + } else {
97 + bannerView.isHidden = false
98 + bannerCenteredView.isHidden = true
58 } 99 }
59 } 100 }
60 101
......