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-11-15 16:10:32 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2352f505385d2d2aec0a844c683db2854d7cc086
2352f505
1 parent
fdca785a
Added no vouchers UI in myRewards
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
13 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletVouchersBannerTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
2352f50
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
View file @
2352f50
This diff is collapsed. Click to expand it.
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
View file @
2352f50
...
...
@@ -93,6 +93,8 @@ import SwiftEventBus
self
.
coupons
=
swiftApi
()
.
getCouponList
()
self
.
totalCouponDiscount
=
Float
(
round
(
100
*
swiftApi
()
.
getLoyaltyBadge
()
.
_value
)
/
100
)
self
.
loyaltyBadge
=
swiftApi
()
.
getLoyaltyBadge
()
self
.
handleSpinnerAndEmptyView
()
self
.
tableView
.
reloadData
()
}
}
...
...
@@ -753,7 +755,7 @@ import SwiftEventBus
if
(
self
.
dfyCoupons
.
count
==
0
&&
self
.
unifiedCoupons
.
count
==
0
&&
self
.
coupons
.
count
==
0
)
{
self
.
showActiveCouponsBanners
=
false
if
(
swiftApi
()
.
getShowVouchersBanner
()
==
"
false
"
)
{
if
(
swiftApi
()
.
getShowVouchersBanner
()
==
"
null
"
)
{
self
.
emptyView
.
isHidden
=
false
self
.
emptyViewHeight
.
constant
=
self
.
emptyView
.
intrinsicContentSize
.
height
...
...
@@ -1058,7 +1060,7 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
return
0
}
}
else
if
(
section
==
1
)
{
if
(
swiftApi
()
.
getShowVouchersBanner
()
==
"true"
)
{
if
(
swiftApi
()
.
getShowVouchersBanner
()
==
"true"
||
swiftApi
()
.
getShowVouchersBanner
()
==
"false"
)
{
return
1
}
else
{
return
0
...
...
@@ -1112,7 +1114,7 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
return
0.0
}
}
else
if
(
indexPath
.
section
==
1
)
{
if
(
swiftApi
()
.
getShowVouchersBanner
()
==
"true"
)
{
if
(
swiftApi
()
.
getShowVouchersBanner
()
==
"true"
||
swiftApi
()
.
getShowVouchersBanner
()
==
"false"
)
{
return
UITableView
.
automaticDimension
}
else
{
return
0.0
...
...
@@ -1208,7 +1210,7 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
return
nil
}
}
else
if
(
section
==
1
)
{
// if (swiftApi().getShowVouchersBanner() == "true") {
// if (swiftApi().getShowVouchersBanner() == "true"
|| swiftApi().getShowVouchersBanner() == "false"
) {
// let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 70))
// view.backgroundColor = .clear
...
...
@@ -1268,7 +1270,7 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
return
0.0
}
}
else
if
(
section
==
1
)
{
// if (swiftApi().getShowVouchersBanner() == "true") {
// if (swiftApi().getShowVouchersBanner() == "true"
|| swiftApi().getShowVouchersBanner() == "false"
) {
// return 70.0
// } else {
return
0.0
...
...
@@ -1322,7 +1324,7 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
}
else
if
(
indexPath
.
section
==
1
)
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"WalletVouchersBannerTableViewCellId"
,
for
:
indexPath
)
as!
WalletVouchersBannerTableViewCell
cell
.
configureCell
(
showSeparator
:
self
.
showActiveCouponsBanners
)
cell
.
configureCell
(
showSeparator
:
self
.
showActiveCouponsBanners
,
active
:
swiftApi
()
.
getShowVouchersBanner
()
==
"true"
)
return
cell
}
else
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"WalletSpinnerTableViewCellId"
,
for
:
indexPath
)
as!
WalletSpinnerTableViewCell
...
...
SwiftWarplyFramework/SwiftWarplyFramework/WalletVouchersBannerTableViewCell.swift
View file @
2352f50
...
...
@@ -15,6 +15,7 @@ import UIKit
@IBOutlet
weak
var
voucherBannerIconImage
:
UIImageView
!
@IBOutlet
weak
var
voucherBannerLabel
:
UILabel
!
@IBOutlet
weak
var
voucherBannerArrowImage
:
UIImageView
!
@IBOutlet
weak
var
voucherCountView
:
UIView
!
public
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
...
...
@@ -35,7 +36,10 @@ import UIKit
voucherBannerIconImage
.
image
=
UIImage
(
named
:
"wallet_voucher"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
voucherBannerArrowImage
.
image
=
UIImage
(
named
:
"arrow_right_black"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
voucherBannerLabel
.
text
=
"Ενημερώσου για το υπόλοιπο επιδότησης"
// voucherBannerLabel.text = "Ενημερώσου για το υπόλοιπο επιδότησης"
voucherCountView
.
layer
.
cornerRadius
=
4.0
voucherCountView
.
backgroundColor
=
UIColor
(
red
:
0.92
,
green
:
0.75
,
blue
:
0.41
,
alpha
:
1.00
)
}
public
override
func
setSelected
(
_
selected
:
Bool
,
animated
:
Bool
)
{
...
...
@@ -44,7 +48,7 @@ import UIKit
// Configure the view for the selected state
}
func
configureCell
(
showSeparator
:
Bool
)
{
func
configureCell
(
showSeparator
:
Bool
,
active
:
Bool
)
{
if
(
showSeparator
==
true
)
{
separatorView
.
isHidden
=
false
separatorTopSpace
.
constant
=
25
...
...
@@ -53,6 +57,25 @@ import UIKit
separatorView
.
isHidden
=
true
separatorTopSpace
.
constant
=
0
}
if
(
active
==
true
)
{
voucherBannerView
.
backgroundColor
=
.
white
voucherBannerIconImage
.
image
=
voucherBannerIconImage
.
image
?
.
withRenderingMode
(
.
alwaysTemplate
)
voucherBannerIconImage
.
tintColor
=
UIColor
(
red
:
0.00
,
green
:
0.65
,
blue
:
0.89
,
alpha
:
1.00
)
voucherBannerLabel
.
text
=
"Ενημερώσου για το υπόλοιπο επιδότησης"
voucherBannerLabel
.
textColor
=
UIColor
(
red
:
0.13
,
green
:
0.13
,
blue
:
0.13
,
alpha
:
1.00
)
voucherBannerLabel
.
frame
.
size
.
width
=
voucherBannerLabel
.
intrinsicContentSize
.
width
voucherCountView
.
isHidden
=
true
}
else
{
voucherBannerView
.
backgroundColor
=
UIColor
(
red
:
0.95
,
green
:
0.95
,
blue
:
0.95
,
alpha
:
1.00
)
voucherBannerIconImage
.
image
=
voucherBannerIconImage
.
image
?
.
withRenderingMode
(
.
alwaysTemplate
)
voucherBannerIconImage
.
tintColor
=
UIColor
(
red
:
0.52
,
green
:
0.52
,
blue
:
0.52
,
alpha
:
1.00
)
voucherBannerLabel
.
text
=
"Διαθέσιμο υπόλοιπο"
voucherBannerLabel
.
textColor
=
UIColor
(
red
:
0.52
,
green
:
0.52
,
blue
:
0.52
,
alpha
:
1.00
)
voucherBannerLabel
.
frame
.
size
.
width
=
voucherBannerLabel
.
intrinsicContentSize
.
width
voucherCountView
.
isHidden
=
false
}
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
2352f50
...
...
@@ -183,11 +183,10 @@ public class swiftApi {
}
public
func
setVouchersFetched
(
_
success
:
Bool
)
->
Void
{
if
(
success
==
true
)
{
setShowVouchersBanner
(
"true"
)
}
else
{
setShowVouchersBanner
(
"false"
)
public
func
setVouchersFetched
(
_
success
:
String
)
->
Void
{
// Possible values "true", "false", "null"
if
(
success
==
"true"
||
success
==
"false"
||
success
==
"null"
)
{
setShowVouchersBanner
(
success
)
}
SwiftEventBus
.
post
(
"vouchers_fetched"
)
...
...
Please
register
or
login
to post a comment