Manos Chorianopoulos

favorites ui changes

......@@ -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>
......
......@@ -12,6 +12,7 @@ import UIKit
@IBOutlet weak var allButtonView: UIView!
@IBOutlet weak var allButtonLabel: UILabel!
@IBOutlet weak var collectionView: UICollectionView!
@IBOutlet weak var collectionViewHeightConstraint: NSLayoutConstraint!
var data: SectionModel?
......@@ -72,6 +73,22 @@ import UIKit
func configureCell(data: SectionModel?) {
self.data = data
// Update collection view height based on section
if data?.title == "Αγαπημένα" {
collectionViewHeightConstraint.constant = 350 // Match cell height
} else {
collectionViewHeightConstraint.constant = 232 // Default height
}
// Configure layout based on section type
if let layout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout {
if data?.title == "Αγαπημένα" {
layout.minimumLineSpacing = 24
} else {
layout.minimumLineSpacing = 7
}
}
let catBoldText = (data?.title ?? "") + " "
let catRegText = "(" + String(data?.count ?? 0) + ")"
......@@ -115,13 +132,20 @@ extension MyRewardsOffersScrollTableViewCell: UICollectionViewDataSource, UICol
// MARK: - UICollectionViewDelegateFlowLayout
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
// let screenWidth = UIScreen.main.bounds.width
return CGSize(width: 257, height: 232)
if self.data?.title == "Αγαπημένα" {
return CGSize(width: 275, height: 350)
} else {
return CGSize(width: 257, height: 232)
}
}
// Distance Between Item Cells
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 7
if self.data?.title == "Αγαπημένα" {
return 24
} else {
return 7
}
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
......
......@@ -12,15 +12,15 @@
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="MyRewardsOffersScrollTableViewCell" rowHeight="265" id="KGk-i7-Jjw" customClass="MyRewardsOffersScrollTableViewCell" customModule="SwiftWarplyFramework" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="403" height="265"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="403" height="265"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3yR-f0-cq6" userLabel="Parent View">
<rect key="frame" x="0.0" y="-127" width="403" height="298"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3yR-f0-cq6" userLabel="Parent View">
<rect key="frame" x="0.0" y="0.0" width="403" height="335"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iQa-jk-pTS" userLabel="Top View">
<rect key="frame" x="24" y="60" width="355" height="35"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iQa-jk-pTS" userLabel="Top View">
<rect key="frame" x="24" y="50" width="355" height="35"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2GN-Th-7DN">
<rect key="frame" x="0.0" y="7" width="270" height="21"/>
......@@ -69,8 +69,8 @@
<constraint firstItem="2GN-Th-7DN" firstAttribute="leading" secondItem="iQa-jk-pTS" secondAttribute="leading" id="j55-YX-1uu"/>
</constraints>
</view>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="E9Q-uB-Uvd">
<rect key="frame" x="0.0" y="100" width="403" height="232"/>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="E9Q-uB-Uvd">
<rect key="frame" x="0.0" y="103" width="403" height="232"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="232" id="kSx-su-PE4"/>
......@@ -115,6 +115,7 @@
<outlet property="allButtonView" destination="9Qp-M4-KdO" id="dwb-fV-WAm"/>
<outlet property="categoryLabel" destination="2GN-Th-7DN" id="wGT-fB-Ktd"/>
<outlet property="collectionView" destination="E9Q-uB-Uvd" id="qi5-nL-UzB"/>
<outlet property="collectionViewHeightConstraint" destination="kSx-su-PE4" id="1To-dW-00H"/>
</connections>
<point key="canvasLocation" x="-69.465648854961827" y="-23.591549295774648"/>
</tableViewCell>
......
......@@ -101,7 +101,7 @@ struct OfferModel {
discountType: "price",
bannerImage: "dominos_banner",
merchantLogo: "dominos_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0xEE417D,
isFavorite: true
),
......@@ -113,7 +113,7 @@ struct OfferModel {
discountType: "percentage",
bannerImage: "dominos_banner",
merchantLogo: "dominos_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0xEE417D,
isFavorite: false
),
......@@ -127,7 +127,7 @@ struct OfferModel {
// discountType: "percentage",
// bannerImage: "car_rental_banner",
// merchantLogo: "avis_logo",
// expirationDate: "έως 30/09",
// expirationDate: "έως 30-09",
// color: 0xEE417D,
// isFavorite: true
// ),
......@@ -139,7 +139,7 @@ struct OfferModel {
// discountType: "amount",
// bannerImage: "hotel_banner",
// merchantLogo: "booking_logo",
// expirationDate: "έως 30/09",
// expirationDate: "έως 30-09",
// color: 0xEE417D,
// isFavorite: true
// ),
......@@ -153,7 +153,7 @@ struct OfferModel {
discountType: "percentage",
bannerImage: "musa_banner",
merchantLogo: "musa_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0x09914E,
isFavorite: false
),
......@@ -165,7 +165,7 @@ struct OfferModel {
discountType: "percentage",
bannerImage: "musa_banner",
merchantLogo: "musa_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0x09914E,
isFavorite: true
),
......@@ -179,7 +179,7 @@ struct OfferModel {
discountType: "percentage",
bannerImage: "ranch_banner",
merchantLogo: "ranch_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0xFC9F25,
isFavorite: false
),
......@@ -191,7 +191,7 @@ struct OfferModel {
discountType: "buyOneGetOne",
bannerImage: "ranch_banner",
merchantLogo: "ranch_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0xFC9F25,
isFavorite: false
),
......@@ -205,7 +205,7 @@ struct OfferModel {
discountType: "amount",
bannerImage: "coffeeisland_banner",
merchantLogo: "coffeeisland_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0xEE417D,
isFavorite: false
),
......@@ -217,7 +217,7 @@ struct OfferModel {
discountType: "percentage",
bannerImage: "coffeeisland_banner",
merchantLogo: "coffeeisland_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0xEE417D,
isFavorite: false
),
......@@ -231,7 +231,7 @@ struct OfferModel {
discountType: "percentage",
bannerImage: "ninemia_banner",
merchantLogo: "ninemia_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0xEE417D,
isFavorite: true
),
......@@ -243,7 +243,7 @@ struct OfferModel {
discountType: "percentage",
bannerImage: "ninemia_banner",
merchantLogo: "ninemia_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0xEE417D,
isFavorite: false
),
......@@ -257,7 +257,7 @@ struct OfferModel {
discountType: "percentage",
bannerImage: "moustakas_banner",
merchantLogo: "moustakas_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0xEE417D,
isFavorite: false
),
......@@ -269,7 +269,7 @@ struct OfferModel {
discountType: "buyOneGetOne",
bannerImage: "moustakas_banner",
merchantLogo: "moustakas_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0xEE417D,
isFavorite: false
),
......@@ -283,7 +283,7 @@ struct OfferModel {
discountType: "amount",
bannerImage: "migato_banner",
merchantLogo: "migato_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0xEE417D,
isFavorite: false
),
......@@ -295,7 +295,7 @@ struct OfferModel {
discountType: "percentage",
bannerImage: "migato_banner",
merchantLogo: "migato_logo",
expirationDate: "έως 30/09",
expirationDate: "έως 30-09",
color: 0xEE417D,
isFavorite: false
)
......