Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2023-04-05 17:24:59 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2fba2ec218e14afa69336556c7c4b46b6757778b
2fba2ec2
1 parent
b9877b89
refactor Wallet badges
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
83 additions
and
9 deletions
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/ActiveCodeTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponsTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletBadgesTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
2fba2ec
...
...
@@ -7,7 +7,7 @@
<key>
Pods-SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
0
</integer>
<integer>
1
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
2fba2ec
...
...
@@ -7,7 +7,7 @@
<key>
SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
1
</integer>
<integer>
0
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
2fba2ec
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/ActiveCodeTableViewCell.swift
View file @
2fba2ec
...
...
@@ -7,7 +7,7 @@
import
UIKit
class
ActiveCodeTableViewCell
:
UITableViewCell
{
@objc
public
class
ActiveCodeTableViewCell
:
UITableViewCell
{
@IBOutlet
weak
var
activeCodeView
:
UIView
!
@IBOutlet
weak
var
activeCodeViewHeight
:
NSLayoutConstraint
!
@IBOutlet
weak
var
activeCodesCountLabel
:
UILabel
!
...
...
@@ -21,7 +21,7 @@ class ActiveCodeTableViewCell: UITableViewCell {
public
var
dfyCoupons
:
Array
<
swiftApi
.
ActiveDFYCouponModel
>
=
swiftApi
()
.
getActiveDFYCoupons
()
override
func
awakeFromNib
()
{
public
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
// TODO: DELETE ===>
...
...
@@ -176,7 +176,7 @@ class ActiveCodeTableViewCell: UITableViewCell {
}
}
override
func
setSelected
(
_
selected
:
Bool
,
animated
:
Bool
)
{
public
override
func
setSelected
(
_
selected
:
Bool
,
animated
:
Bool
)
{
super
.
setSelected
(
selected
,
animated
:
animated
)
// Configure the view for the selected state
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
View file @
2fba2ec
This diff is collapsed. Click to expand it.
SwiftWarplyFramework/SwiftWarplyFramework/UnifiedCouponsTableViewCell.swift
View file @
2fba2ec
...
...
@@ -8,7 +8,7 @@
import
Foundation
import
UIKit
class
UnifiedCouponsTableViewCell
:
UITableViewCell
{
@objc
public
class
UnifiedCouponsTableViewCell
:
UITableViewCell
{
@IBOutlet
weak
var
couponBgImage
:
UIImageView
!
@IBOutlet
weak
var
couponImage
:
UIImageView
!
@IBOutlet
weak
var
borderView
:
UIView
!
...
...
SwiftWarplyFramework/SwiftWarplyFramework/WalletBadgesTableViewCell.swift
View file @
2fba2ec
...
...
@@ -7,17 +7,91 @@
import
UIKit
class
WalletBadgesTableViewCell
:
UITableViewCell
{
@objc
public
class
WalletBadgesTableViewCell
:
UITableViewCell
{
@IBOutlet
weak
var
rewardsLabel
:
UILabel
!
@IBOutlet
weak
var
badgeLinesImage
:
UIImageView
!
@IBOutlet
weak
var
sumBadgeImage
:
UIImageView
!
@IBOutlet
weak
var
sumBadgeLabel
:
UILabel
!
@IBOutlet
weak
var
dfyBadgeImage
:
UIImageView
!
@IBOutlet
weak
var
dfyBadgeLabel
:
UILabel
!
@IBOutlet
weak
var
couponBadgeImage
:
UIImageView
!
@IBOutlet
weak
var
couponBadgeLabel
:
UILabel
!
@IBOutlet
weak
var
marketBadgeImage
:
UIImageView
!
@IBOutlet
weak
var
marketBadgeLabel
:
UILabel
!
override
func
awakeFromNib
()
{
public
var
loyaltyBadge
:
swiftApi
.
LoyaltyBadgeModel
=
swiftApi
()
.
getLoyaltyBadge
()
public
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
// Initialization code
sumBadgeImage
.
image
=
UIImage
(
named
:
"wallet_summary"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
badgeLinesImage
.
image
=
UIImage
(
named
:
"wallet_badge_lines"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
rewardsLabel
.
text
=
"COSMOTE Επιβράβευση"
}
override
func
setSelected
(
_
selected
:
Bool
,
animated
:
Bool
)
{
public
override
func
setSelected
(
_
selected
:
Bool
,
animated
:
Bool
)
{
super
.
setSelected
(
selected
,
animated
:
animated
)
// Configure the view for the selected state
}
func
configureCell
(
totalCouponValue
:
Float
,
totalCouponDiscount
:
Float
,
unifiedCouponsDiscount
:
Float
)
{
let
sumRewards
=
totalCouponValue
+
totalCouponDiscount
+
unifiedCouponsDiscount
// sumRewards = Float(round(100 * sumRewards) / 100)
var
sumRewardsString
=
"0"
sumRewardsString
=
String
(
format
:
"%.2f"
,
sumRewards
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
sumBadgeLabel
.
text
=
sumRewardsString
+
"€"
// ===
if
(
totalCouponValue
==
0.0
)
{
dfyBadgeImage
.
image
=
UIImage
(
named
:
"wallet_dfy_empty"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
dfyBadgeLabel
.
isHidden
=
true
}
else
{
dfyBadgeImage
.
image
=
UIImage
(
named
:
"wallet_dfy_2"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
dfyBadgeLabel
.
isHidden
=
false
}
let
totalCouponValueFixed
=
Float
(
round
(
100
*
totalCouponValue
)
/
100
)
var
totalCouponValueString
=
"0"
totalCouponValueString
=
String
(
format
:
"%.2f"
,
totalCouponValueFixed
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
dfyBadgeLabel
.
text
=
totalCouponValueString
+
"€"
// ===
if
(
loyaltyBadge
.
_couponCount
==
0
)
{
couponBadgeImage
.
image
=
UIImage
(
named
:
"wallet_coupons_empty"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
couponBadgeLabel
.
isHidden
=
true
}
else
{
couponBadgeImage
.
image
=
UIImage
(
named
:
"wallet_coupons_3"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
couponBadgeLabel
.
isHidden
=
false
}
var
totalCouponDiscountString
=
"0"
totalCouponDiscountString
=
String
(
format
:
"%.2f"
,
totalCouponDiscount
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
couponBadgeLabel
.
text
=
totalCouponDiscountString
+
"€"
// ===
let
marketDiscount
=
Float
(
round
(
100
*
unifiedCouponsDiscount
)
/
100
)
var
marketDiscountString
=
"0"
marketDiscountString
=
String
(
format
:
"%.2f"
,
marketDiscount
)
.
replacingOccurrences
(
of
:
"."
,
with
:
","
,
options
:
.
literal
,
range
:
nil
)
self
.
marketBadgeLabel
.
text
=
marketDiscountString
+
"€"
if
(
unifiedCouponsDiscount
==
0.0
)
{
marketBadgeImage
.
image
=
UIImage
(
named
:
"wallet_market_empty"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
marketBadgeLabel
.
isHidden
=
true
}
else
{
marketBadgeImage
.
image
=
UIImage
(
named
:
"wallet_market"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
marketBadgeLabel
.
isHidden
=
false
}
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
View file @
2fba2ec
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment