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>
......
......@@ -2401,14 +2401,14 @@
<color key="sectionIndexBackgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="UnifiedCouponBCHeaderTableViewCell" id="1eX-19-ysb" customClass="UnifiedCouponBCHeaderTableViewCell" customModule="SwiftWarplyFramework">
<rect key="frame" x="0.0" y="50" width="414" height="847.5"/>
<rect key="frame" x="0.0" y="50" width="414" height="842.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="1eX-19-ysb" id="izt-1Z-wey">
<rect key="frame" x="0.0" y="0.0" width="414" height="847.5"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="842.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zYD-ey-wun">
<rect key="frame" x="0.0" y="0.0" width="414" height="847.5"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="842.5"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="4Aj-WZ-M9m">
<rect key="frame" x="0.0" y="0.0" width="414" height="200"/>
......@@ -2485,14 +2485,14 @@
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="33M-UT-Ysb" userLabel="Border 2 View">
<rect key="frame" x="20" y="644.5" width="374" height="1"/>
<rect key="frame" x="20" y="639.5" width="374" height="1"/>
<color key="backgroundColor" red="0.90196078430000004" green="0.90196078430000004" blue="0.90196078430000004" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="6LJ-d0-AsC"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="UR2-dr-Wbn">
<rect key="frame" x="103.5" y="655.5" width="207" height="50"/>
<rect key="frame" x="103.5" y="650.5" width="207" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="AMS-Hv-WqS"/>
</constraints>
......@@ -2507,13 +2507,13 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Το κουπόνι ισχύει έως 05/12/2022" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SPU-J6-4re">
<rect key="frame" x="20" y="740.5" width="374" height="15"/>
<rect key="frame" x="20" y="735.5" width="374" height="15"/>
<fontDescription key="fontDescription" name="PFSquareSansPro-Regular" family="PF Square Sans Pro" pointSize="15"/>
<color key="textColor" red="0.25490196079999999" green="0.33333333329999998" blue="0.3921568627" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="52P-0b-ua5">
<rect key="frame" x="103.5" y="790.5" width="207" height="50"/>
<rect key="frame" x="103.5" y="785.5" width="207" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="W45-Tv-hXa"/>
</constraints>
......@@ -2570,7 +2570,7 @@
<constraint firstItem="4Aj-WZ-M9m" firstAttribute="leading" secondItem="zYD-ey-wun" secondAttribute="leading" id="rdH-Q3-LPg"/>
<constraint firstItem="M7m-4Y-3sb" firstAttribute="centerX" secondItem="zYD-ey-wun" secondAttribute="centerX" id="u6h-Gd-lQ0"/>
<constraint firstItem="KgC-mB-kHF" firstAttribute="leading" secondItem="zYD-ey-wun" secondAttribute="leading" constant="20" id="w4n-nG-Bmg"/>
<constraint firstItem="33M-UT-Ysb" firstAttribute="top" secondItem="iDt-Pz-bkd" secondAttribute="bottom" constant="15" id="z2q-JF-fHL"/>
<constraint firstItem="33M-UT-Ysb" firstAttribute="top" secondItem="iDt-Pz-bkd" secondAttribute="bottom" constant="10" id="z2q-JF-fHL"/>
</constraints>
</view>
</subviews>
......@@ -2611,7 +2611,7 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="CouponsTableViewCellId" id="TAK-Ug-AzU" customClass="CouponsTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="897.5" width="414" height="118"/>
<rect key="frame" x="0.0" y="892.5" width="414" height="118"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="TAK-Ug-AzU" id="LFe-Vj-kjJ">
<rect key="frame" x="0.0" y="0.0" width="414" height="118"/>
......@@ -2749,7 +2749,7 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="UnifiedCouponBCFooterTableViewCell" id="LD5-ES-J67" customClass="UnifiedCouponBCFooterTableViewCell" customModule="SwiftWarplyFramework">
<rect key="frame" x="0.0" y="1015.5" width="414" height="189"/>
<rect key="frame" x="0.0" y="1010.5" width="414" height="189"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="LD5-ES-J67" id="DmN-AA-8n5">
<rect key="frame" x="0.0" y="0.0" width="414" height="189"/>
......
......@@ -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)
......@@ -6909,9 +6909,14 @@ 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)
......