Manos Chorianopoulos

ui fixes, unified barcode, sort unified by date

......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
......@@ -122,7 +122,8 @@ import AVFoundation
func configureCell(coupon: swiftApi.UnifiedCouponModel?, couponsVisible: Bool) {
couponView.layer.cornerRadius = 8
couponNumberLabel.text = ((coupon?._code != 0) ? String(coupon?._code ?? 0) : "")
// couponNumberLabel.text = ((coupon?._code != 0) ? String(coupon?._code ?? 0) : "")
couponNumberLabel.text = coupon?._barcode ?? ""
couponView.frame = CGRect(x: 0.0, y: 0.0, width: couponView.intrinsicContentSize.width, height: 55)
let barcodeString = constructBarcode(coupon: coupon) ?? ""
......@@ -150,15 +151,15 @@ import AVFoundation
// === Hide Barcode Section
// barcodeImage.isHidden = true
// barcodeImageHeight.constant = CGFloat(0)
// barcodeLabel.isHidden = true
// barcodeLabelHeight.constant = CGFloat(0)
barcodeLabel.isHidden = true
barcodeLabelHeight.constant = CGFloat(0)
//
// borderViewHeight.constant = CGFloat(0)
// borderView2Height.constant = CGFloat(0)
//
// border1TopSpace.constant = CGFloat(0) // 20
// barcodeImageTopSpace.constant = CGFloat(0) // 10
// barcodeLabelTopSpace.constant = CGFloat(0) // 10
barcodeLabelTopSpace.constant = CGFloat(0) // 10
// border2TopSpace.constant = CGFloat(0) // 15
//
showBarcodeButton.isHidden = true
......
......@@ -117,7 +117,7 @@ import SwiftEventBus
showDialog("Αδυναμία ενεργοποίησης", "Πρόσθεσε σύνδεση COSMOTE σταθερής, κινητής ή TV για να έχεις πρόσβαση στις προσφορές.");
}
headerImage.image = UIImage(named: "ic_background_circle", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
headerImage.image = UIImage(named: "ic_background_straight", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
dfyEarnImage.image = UIImage(named: "wallet_dfy_earn", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
couponEarnImage.image = UIImage(named: "wallet_coupons_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
dfyLogoImage.image = UIImage(named: "dfy_logo_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
......
......@@ -6819,7 +6819,7 @@ public class swiftApi {
let dateString = dictionary["created"] as? String? ?? ""
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSSIX")
dateFormatter.dateFormat = "E, MMM dd yyyy HH:mm:ss"
dateFormatter.dateFormat = "E, dd MMM yyyy HH:mm:ss 'GMT'"
if let date = dateFormatter.date(from: dateString ?? "") {
dateFormatter.dateFormat = "dd/MM/yyyy"
let resultString = dateFormatter.string(from: date)
......@@ -6908,10 +6908,15 @@ public class swiftApi {
}
}
}
swiftApi().setUnifiedCouponList(unifiedCouponsArray)
// Sort by date
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "dd/MM/yyyy"
let sortedUnifiedCouponsArray = unifiedCouponsArray.sorted(by: { dateFormatter.date(from:$0._created)?.compare(dateFormatter.date(from:$1._created)!) == .orderedDescending })
swiftApi().setUnifiedCouponList(sortedUnifiedCouponsArray)
swiftApi().setOldUnifiedCouponList(oldUnifiedCouponsArray)
successCallback(unifiedCouponsArray)
successCallback(sortedUnifiedCouponsArray)
}
} else {
successCallback(nil)
......