Manos Chorianopoulos

redesign WalletViewController v2

...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>0</integer> 10 + <integer>1</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>1</integer> 10 + <integer>0</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -48,11 +48,13 @@ import UIKit ...@@ -48,11 +48,13 @@ import UIKit
48 // dfyCoupons = swiftApi().getActiveDFYCoupons() 48 // dfyCoupons = swiftApi().getActiveDFYCoupons()
49 // TODO: DELETE <=== 49 // TODO: DELETE <===
50 50
51 - activeCodeView.layer.cornerRadius = 5.0 51 + activeCodeView.layer.cornerRadius = 16.5
52 - activeCodeView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.16).cgColor 52 + activeCodeView.layer.borderWidth = 1
53 - activeCodeView.layer.shadowOffset = CGSize(width: 0.0, height: 0.0) 53 + activeCodeView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
54 - activeCodeView.layer.shadowOpacity = 1.0 54 +// activeCodeView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.16).cgColor
55 - activeCodeView.layer.shadowRadius = 6.0 55 +// activeCodeView.layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
56 +// activeCodeView.layer.shadowOpacity = 1.0
57 +// activeCodeView.layer.shadowRadius = 6.0
56 58
57 activeCodeImage.image = UIImage(named: "active_code_logo_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) 59 activeCodeImage.image = UIImage(named: "active_code_logo_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
58 60
...@@ -90,8 +92,8 @@ import UIKit ...@@ -90,8 +92,8 @@ import UIKit
90 // activeCodeLabel.text = dfyCoupons[0]._code 92 // activeCodeLabel.text = dfyCoupons[0]._code
91 let newLabel = CopyableLabel() 93 let newLabel = CopyableLabel()
92 newLabel.text = String(dfyCoupons[0]._code) 94 newLabel.text = String(dfyCoupons[0]._code)
93 - newLabel.font = UIFont(name: "PFSquareSansPro-Bold", size: 19) 95 + newLabel.font = UIFont(name: "PeridotPE-Bold", size: 18)
94 - newLabel.textColor = UIColor(rgb: 0x3C5365) 96 + newLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
95 newLabel.frame.size.width = newLabel.intrinsicContentSize.width 97 newLabel.frame.size.width = newLabel.intrinsicContentSize.width
96 newLabel.frame.size.height = newLabel.intrinsicContentSize.height // tagHeight 98 newLabel.frame.size.height = newLabel.intrinsicContentSize.height // tagHeight
97 activeCodeContentView.addSubview(newLabel) 99 activeCodeContentView.addSubview(newLabel)
...@@ -123,8 +125,8 @@ import UIKit ...@@ -123,8 +125,8 @@ import UIKit
123 // var couponCodesString = "" 125 // var couponCodesString = ""
124 for (index, item) in dfyCoupons.enumerated() { 126 for (index, item) in dfyCoupons.enumerated() {
125 let newLabel = CopyableLabel() 127 let newLabel = CopyableLabel()
126 - newLabel.font = UIFont(name: "PFSquareSansPro-Bold", size: 19) 128 + newLabel.font = UIFont(name: "PeridotPE-Bold", size: 18)
127 - newLabel.textColor = UIColor(rgb: 0x3C5365) 129 + newLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
128 130
129 if (index == (dfyCoupons.endIndex - 1)) { 131 if (index == (dfyCoupons.endIndex - 1)) {
130 // couponCodesString += String(item._code) 132 // couponCodesString += String(item._code)
......
This diff could not be displayed because it is too large.
...@@ -17,12 +17,14 @@ import SwiftEventBus ...@@ -17,12 +17,14 @@ import SwiftEventBus
17 @IBOutlet weak var dfyEarnBannerView: UIView! 17 @IBOutlet weak var dfyEarnBannerView: UIView!
18 @IBOutlet weak var dfyEarnBannerHeight: NSLayoutConstraint! 18 @IBOutlet weak var dfyEarnBannerHeight: NSLayoutConstraint!
19 @IBOutlet weak var dfyEarnBannerTopSpace: NSLayoutConstraint! 19 @IBOutlet weak var dfyEarnBannerTopSpace: NSLayoutConstraint!
20 + @IBOutlet weak var dfyEarnBannerInnerView: UIView!
20 @IBOutlet weak var dfyEarnLabel: UILabel! 21 @IBOutlet weak var dfyEarnLabel: UILabel!
21 @IBOutlet weak var dfyEarnAmountLabel: UILabel! 22 @IBOutlet weak var dfyEarnAmountLabel: UILabel!
22 @IBOutlet weak var dfyEarnImage: UIImageView! 23 @IBOutlet weak var dfyEarnImage: UIImageView!
23 @IBOutlet weak var couponEarnView: UIView! 24 @IBOutlet weak var couponEarnView: UIView!
24 @IBOutlet weak var couponEarnViewHeight: NSLayoutConstraint! 25 @IBOutlet weak var couponEarnViewHeight: NSLayoutConstraint!
25 @IBOutlet weak var couponEarnViewTopSpace: NSLayoutConstraint! 26 @IBOutlet weak var couponEarnViewTopSpace: NSLayoutConstraint!
27 + @IBOutlet weak var couponEarnInnerView: UIView!
26 @IBOutlet weak var couponEarnLabel: UILabel! 28 @IBOutlet weak var couponEarnLabel: UILabel!
27 @IBOutlet weak var couponEarnAmountLabel: UILabel! 29 @IBOutlet weak var couponEarnAmountLabel: UILabel!
28 @IBOutlet weak var couponEarnImage: UIImageView! 30 @IBOutlet weak var couponEarnImage: UIImageView!
...@@ -175,11 +177,14 @@ import SwiftEventBus ...@@ -175,11 +177,14 @@ import SwiftEventBus
175 questionnaireButton.layer.borderWidth = 2 177 questionnaireButton.layer.borderWidth = 2
176 questionnaireButton.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor 178 questionnaireButton.layer.borderColor = UIColor(red: 0.05, green: 0.65, blue: 0.00, alpha: 1.00).cgColor
177 179
178 - dfyEarnBannerView.layer.cornerRadius = 5.0 180 + dfyEarnBannerInnerView.layer.cornerRadius = 16.5
179 - dfyEarnBannerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.16).cgColor 181 + dfyEarnBannerInnerView.layer.borderWidth = 1
180 - dfyEarnBannerView.layer.shadowOffset = CGSize(width: 0.0, height: 3.0) 182 + dfyEarnBannerInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
181 - dfyEarnBannerView.layer.shadowOpacity = 1.0 183 +
182 - dfyEarnBannerView.layer.shadowRadius = 3.0 184 +// dfyEarnBannerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.16).cgColor
185 +// dfyEarnBannerView.layer.shadowOffset = CGSize(width: 0.0, height: 3.0)
186 +// dfyEarnBannerView.layer.shadowOpacity = 1.0
187 +// dfyEarnBannerView.layer.shadowRadius = 3.0
183 188
184 // var totalCouponValue = swiftApi().getDealsCouponsSum() 189 // var totalCouponValue = swiftApi().getDealsCouponsSum()
185 190
...@@ -205,8 +210,8 @@ import SwiftEventBus ...@@ -205,8 +210,8 @@ import SwiftEventBus
205 let boldText = totalCouponValueString + "€" 210 let boldText = totalCouponValueString + "€"
206 let normalText2 = " με το DEALS for YOU!" 211 let normalText2 = " με το DEALS for YOU!"
207 212
208 - let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PFSquareSansPro-Regular", size: 17) ?? UIFont.systemFont(ofSize: 16)] 213 + let attrRegular = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Regular", size: 14) ?? UIFont.systemFont(ofSize: 13), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)]
209 - let attrBold = [NSAttributedString.Key.font : UIFont(name: "PFSquareSansPro-Bold", size: 17) ?? UIFont.boldSystemFont(ofSize: 16)] 214 + let attrBold = [NSAttributedString.Key.font : UIFont(name: "PeridotPE-Bold", size: 14) ?? UIFont.boldSystemFont(ofSize: 13), NSAttributedString.Key.foregroundColor: UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)]
210 215
211 let attributedString = NSMutableAttributedString(string:normalText1, attributes:attrRegular) 216 let attributedString = NSMutableAttributedString(string:normalText1, attributes:attrRegular)
212 let boldString = NSMutableAttributedString(string: boldText, attributes:attrBold) 217 let boldString = NSMutableAttributedString(string: boldText, attributes:attrBold)
...@@ -217,6 +222,7 @@ import SwiftEventBus ...@@ -217,6 +222,7 @@ import SwiftEventBus
217 dfyEarnLabel.attributedText = attributedString 222 dfyEarnLabel.attributedText = attributedString
218 223
219 dfyEarnAmountLabel.text = totalCouponValueString + "€" 224 dfyEarnAmountLabel.text = totalCouponValueString + "€"
225 +// dfyEarnAmountLabel.font = UIFont(name: "PeridotPE-Bold", size: 14)
220 226
221 if (loyaltyBadge._couponCount == 0) { 227 if (loyaltyBadge._couponCount == 0) {
222 couponEarnView.isHidden = true 228 couponEarnView.isHidden = true
...@@ -226,15 +232,22 @@ import SwiftEventBus ...@@ -226,15 +232,22 @@ import SwiftEventBus
226 } else { 232 } else {
227 couponEarnView.isHidden = false 233 couponEarnView.isHidden = false
228 couponEarnViewHeight.constant = 75 234 couponEarnViewHeight.constant = 75
229 - couponEarnViewTopSpace.constant = 30 235 + if (totalCouponValue == 0.0) {
236 + couponEarnViewTopSpace.constant = 30
237 + } else {
238 + couponEarnViewTopSpace.constant = 15
239 + }
230 240
231 } 241 }
232 242
233 - couponEarnView.layer.cornerRadius = 5.0 243 + couponEarnInnerView.layer.cornerRadius = 16.5
234 - couponEarnView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.16).cgColor 244 + couponEarnInnerView.layer.borderWidth = 1
235 - couponEarnView.layer.shadowOffset = CGSize(width: 0.0, height: 3.0) 245 + couponEarnInnerView.layer.borderColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00).cgColor
236 - couponEarnView.layer.shadowOpacity = 1.0 246 +
237 - couponEarnView.layer.shadowRadius = 3.0 247 +// couponEarnView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.16).cgColor
248 +// couponEarnView.layer.shadowOffset = CGSize(width: 0.0, height: 3.0)
249 +// couponEarnView.layer.shadowOpacity = 1.0
250 +// couponEarnView.layer.shadowRadius = 3.0
238 251
239 // let totalCouponDiscount = Float(round(100 * loyaltyBadge._value) / 100) 252 // let totalCouponDiscount = Float(round(100 * loyaltyBadge._value) / 100)
240 var totalCouponDiscountString = "0" 253 var totalCouponDiscountString = "0"
...@@ -391,7 +404,7 @@ import SwiftEventBus ...@@ -391,7 +404,7 @@ import SwiftEventBus
391 404
392 dfyLogoImageHeight.constant = 0 405 dfyLogoImageHeight.constant = 0
393 activeCodeViewHeight.constant = 0 406 activeCodeViewHeight.constant = 0
394 - dfyLogoImageTopSpace.constant = 0 407 +// dfyLogoImageTopSpace.constant = 0
395 } 408 }
396 409
397 myPresentsLabel.text = "Τα δώρα μου" 410 myPresentsLabel.text = "Τα δώρα μου"
...@@ -684,11 +697,12 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -684,11 +697,12 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
684 697
685 public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 698 public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
686 if (section == 0) { 699 if (section == 0) {
687 - if (self.totalCouponValue == 0.0 && self.loyaltyBadge._couponCount == 0 && self.unifiedCouponsDiscount == 0.0) { 700 + // TODO: Uncomment when UnifiedCoupons will be shown again
701 +// if (self.totalCouponValue == 0.0 && self.loyaltyBadge._couponCount == 0 && self.unifiedCouponsDiscount == 0.0) {
688 return 0 702 return 0
689 - } else { 703 +// } else {
690 - return 1 704 +// return 1
691 - } 705 +// }
692 } else if (section == 1) { 706 } else if (section == 1) {
693 return self.unifiedCoupons.count 707 return self.unifiedCoupons.count
694 } else if (section == 2) { 708 } else if (section == 2) {
...@@ -706,11 +720,12 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -706,11 +720,12 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
706 720
707 public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 721 public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
708 if (indexPath.section == 0) { 722 if (indexPath.section == 0) {
709 - if (self.totalCouponValue == 0.0 && self.loyaltyBadge._couponCount == 0 && self.unifiedCouponsDiscount == 0.0) { 723 + // TODO: Uncomment when UnifiedCoupons will be shown again
724 +// if (self.totalCouponValue == 0.0 && self.loyaltyBadge._couponCount == 0 && self.unifiedCouponsDiscount == 0.0) {
710 return 0.0 725 return 0.0
711 - } else { 726 +// } else {
712 - return UITableView.automaticDimension 727 +// return UITableView.automaticDimension
713 - } 728 +// }
714 } else if (indexPath.section == 1) { 729 } else if (indexPath.section == 1) {
715 if (self.unifiedCoupons.count > 0) { 730 if (self.unifiedCoupons.count > 0) {
716 return 120.0 + 8.0 731 return 120.0 + 8.0
...@@ -744,9 +759,9 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -744,9 +759,9 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
744 let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 75)) 759 let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 75))
745 view.backgroundColor = .clear 760 view.backgroundColor = .clear
746 761
747 - let titleLabel = UILabel(frame: CGRect(x: 20, y: 40, width: view.frame.width - 40, height: 21)) 762 + let titleLabel = UILabel(frame: CGRect(x: 20, y: 40, width: view.frame.width - 40, height: 20))
748 - titleLabel.font = UIFont(name: "PFSquareSansPro-Medium", size: 21) 763 + titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 20)
749 - titleLabel.textColor = UIColor(rgb: 0xFFFFFF) 764 + titleLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
750 titleLabel.text = "COSMOTE SuperMarket Deals" 765 titleLabel.text = "COSMOTE SuperMarket Deals"
751 766
752 view.addSubview(titleLabel) 767 view.addSubview(titleLabel)
...@@ -758,11 +773,12 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -758,11 +773,12 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
758 773
759 } else if (section == 2) { 774 } else if (section == 2) {
760 if (self.dfyCoupons.count > 0) { 775 if (self.dfyCoupons.count > 0) {
761 - let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 68)) 776 + let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 65))
762 - view.backgroundColor = .clear 777 + view.backgroundColor = .clear
763 778
764 - let imageView = UIImageView(frame: CGRect(x: 20, y: 20, width: view.frame.width / 3.5, height: 38)) 779 + let imageView = UIImageView(frame: CGRect(x: 20, y: 30, width: view.frame.width / 2, height: 25))
765 imageView.contentMode = .scaleAspectFit 780 imageView.contentMode = .scaleAspectFit
781 +// imageView.backgroundColor = .red
766 782
767 if let dfyHeaderImage = UIImage(named: "dfy_logo_colored", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) { 783 if let dfyHeaderImage = UIImage(named: "dfy_logo_colored", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) {
768 imageView.image = dfyHeaderImage 784 imageView.image = dfyHeaderImage
...@@ -783,10 +799,10 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{ ...@@ -783,10 +799,10 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
783 view.backgroundColor = .clear 799 view.backgroundColor = .clear
784 800
785 // let titleLabel = UILabel(frame: CGRect(x: 20, y: 40, width: view.frame.width - 40, height: 21)) 801 // let titleLabel = UILabel(frame: CGRect(x: 20, y: 40, width: view.frame.width - 40, height: 21))
786 - let titleLabel = UILabel(frame: CGRect(x: 20, y: 30, width: view.frame.width - 40, height: 21)) 802 + let titleLabel = UILabel(frame: CGRect(x: 20, y: 30, width: view.frame.width - 40, height: 20))
787 - titleLabel.font = UIFont(name: "PFSquareSansPro-Medium", size: 21) 803 + titleLabel.font = UIFont(name: "BTCosmo-Bold", size: 20)
788 - titleLabel.textColor = UIColor(rgb: 0xFFFFFF) 804 + titleLabel.textColor = UIColor(red: 0.13, green: 0.13, blue: 0.13, alpha: 1.00)
789 - titleLabel.text = "Τα δώρα μου" 805 + titleLabel.text = "GIFTS for YOU"
790 806
791 view.addSubview(titleLabel) 807 view.addSubview(titleLabel)
792 return view 808 return view
......