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-13 17:12:47 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ea3e2ce8579ecaeefcac8c30f286479e2fec3ce5
ea3e2ce8
1 parent
b0fa29ac
redesign History
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
148 additions
and
43 deletions
SwiftWarplyFramework/SwiftWarplyFramework/AnalysisHeaderMessageViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/AnalysisItemViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/HistoryViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/LoyaltyAnalysisViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/AnalysisHeaderMessageViewCell.swift
View file @
ea3e2ce
...
...
@@ -11,9 +11,13 @@ class AnalysisHeaderMessageViewCell: UITableViewCell {
// attributes
@IBOutlet
weak
var
itemImage
:
UIImageView
!
@IBOutlet
weak
var
messageLabelView
:
UIView
!
@IBOutlet
weak
var
messageLabel
:
UILabel
!
@IBOutlet
weak
var
titleLabel
:
UILabel
!
@IBOutlet
weak
var
emptyLabel
:
UILabel
!
@IBOutlet
weak
var
emptyLabelHeight
:
NSLayoutConstraint
!
@IBOutlet
weak
var
emptyLabelTopSpace
:
NSLayoutConstraint
!
@IBOutlet
weak
var
emptyLabelBottomSpace
:
NSLayoutConstraint
!
public
var
loyaltyBadge
:
swiftApi
.
LoyaltyBadgeModel
=
swiftApi
()
.
getLoyaltyBadge
()
...
...
@@ -25,14 +29,15 @@ class AnalysisHeaderMessageViewCell: UITableViewCell {
// itemImage.image = UIImage(named: "ic_gift_circle_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
// title
titleLabel
.
textColor
=
UIColor
(
rgb
:
0x
435563
)
titleLabel
.
textColor
=
UIColor
(
rgb
:
0x
212121
)
titleLabel
.
text
=
"Αναλυτικά:"
// message
messageLabel
.
textColor
=
UIColor
(
rgb
:
0x435563
)
messageLabel
.
layer
.
borderWidth
=
1.0
messageLabel
.
layer
.
borderColor
=
UIColor
(
rgb
:
0x1DA6B9
)
.
cgColor
messageLabel
.
layer
.
cornerRadius
=
5
messageLabel
.
textColor
=
UIColor
(
rgb
:
0x212121
)
messageLabelView
.
layer
.
borderWidth
=
1.0
messageLabelView
.
layer
.
borderColor
=
UIColor
(
rgb
:
0xE6E6E6
)
.
cgColor
messageLabelView
.
layer
.
cornerRadius
=
16.5
messageLabelView
.
backgroundColor
=
.
white
// messageLabel.text = "Μέχρι τώρα έχεις κερδίσει " + totalCouponDiscountString + "€ σε προσφορές από " + String(loyaltyBadge._couponCount) + " κουπόνια!"
...
...
@@ -44,8 +49,14 @@ extension AnalysisHeaderMessageViewCell {
if
(
isEmpty
==
true
)
{
emptyLabel
.
isHidden
=
false
emptyLabelHeight
.
constant
=
18.5
emptyLabelTopSpace
.
constant
=
30.0
emptyLabelBottomSpace
.
constant
=
10.0
}
else
{
emptyLabel
.
isHidden
=
true
emptyLabelHeight
.
constant
=
0.0
emptyLabelTopSpace
.
constant
=
0.0
emptyLabelBottomSpace
.
constant
=
0.0
}
if
(
isMarket
==
true
)
{
...
...
@@ -71,8 +82,8 @@ extension AnalysisHeaderMessageViewCell {
let
coupBoldText2
=
String
(
oldUnifiedCouponListLength
)
let
coupNormalText3
=
" κουπόνια!"
let
attrRegular
=
[
NSAttributedString
.
Key
.
font
:
UIFont
(
name
:
"P
FSquareSansPro
-Regular"
,
size
:
17
)
??
UIFont
.
systemFont
(
ofSize
:
16
)]
let
attrBold
=
[
NSAttributedString
.
Key
.
font
:
UIFont
(
name
:
"P
FSquareSansPro
-Bold"
,
size
:
17
)
??
UIFont
.
boldSystemFont
(
ofSize
:
16
)]
let
attrRegular
=
[
NSAttributedString
.
Key
.
font
:
UIFont
(
name
:
"P
eridotPE
-Regular"
,
size
:
17
)
??
UIFont
.
systemFont
(
ofSize
:
16
)]
let
attrBold
=
[
NSAttributedString
.
Key
.
font
:
UIFont
(
name
:
"P
eridotPE
-Bold"
,
size
:
17
)
??
UIFont
.
boldSystemFont
(
ofSize
:
16
)]
let
coupAttributedString
=
NSMutableAttributedString
(
string
:
coupNormalText1
,
attributes
:
attrRegular
)
let
coupBoldString
=
NSMutableAttributedString
(
string
:
coupBoldText
,
attributes
:
attrBold
)
...
...
@@ -99,8 +110,8 @@ extension AnalysisHeaderMessageViewCell {
let
coupBoldText2
=
String
(
loyaltyBadge
.
_couponCount
)
let
coupNormalText3
=
" κουπόνια!"
let
attrRegular
=
[
NSAttributedString
.
Key
.
font
:
UIFont
(
name
:
"P
FSquareSansPro
-Regular"
,
size
:
17
)
??
UIFont
.
systemFont
(
ofSize
:
16
)]
let
attrBold
=
[
NSAttributedString
.
Key
.
font
:
UIFont
(
name
:
"P
FSquareSansPro
-Bold"
,
size
:
17
)
??
UIFont
.
boldSystemFont
(
ofSize
:
16
)]
let
attrRegular
=
[
NSAttributedString
.
Key
.
font
:
UIFont
(
name
:
"P
eridotPE
-Regular"
,
size
:
17
)
??
UIFont
.
systemFont
(
ofSize
:
16
)]
let
attrBold
=
[
NSAttributedString
.
Key
.
font
:
UIFont
(
name
:
"P
eridotPE
-Bold"
,
size
:
17
)
??
UIFont
.
boldSystemFont
(
ofSize
:
16
)]
let
coupAttributedString
=
NSMutableAttributedString
(
string
:
coupNormalText1
,
attributes
:
attrRegular
)
let
coupBoldString
=
NSMutableAttributedString
(
string
:
coupBoldText
,
attributes
:
attrBold
)
...
...
SwiftWarplyFramework/SwiftWarplyFramework/AnalysisItemViewCell.swift
View file @
ea3e2ce
...
...
@@ -38,16 +38,16 @@ class AnalysisItemViewCell: UITableViewCell {
super
.
awakeFromNib
()
// date
dateLabel
.
textColor
=
UIColor
(
rgb
:
0x
435563
)
dateLabel
.
textColor
=
UIColor
(
rgb
:
0x
212121
)
// title
titleLabel
.
textColor
=
UIColor
(
rgb
:
0x
435563
)
titleLabel
.
textColor
=
UIColor
(
rgb
:
0x
212121
)
// price
priceLabel
.
textColor
=
UIColor
(
rgb
:
0x
435563
)
priceLabel
.
textColor
=
UIColor
(
rgb
:
0x
212121
)
// subtitle
subtitleLabel
.
textColor
=
UIColor
(
rgb
:
0x
8B97A3
)
subtitleLabel
.
textColor
=
UIColor
(
rgb
:
0x
9D9D9C
)
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/HistoryViewController.swift
View file @
ea3e2ce
...
...
@@ -106,11 +106,13 @@ class HistoryViewController: AnalysisChildViewController {
}
override
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
if
(
indexPath
.
section
==
0
)
{
return
hasMessage
?
(
items
.
count
>
0
?
380.0
:
480.0
)
:
280
}
return
140.0
// if (indexPath.section == 0) {
//// return hasMessage ? (items.count > 0 ? 380.0 : 480.0) : 280
// return hasMessage ? UITableView.automaticDimension : 280
// }
//
//// return 140.0
return
UITableView
.
automaticDimension
}
override
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
...
...
@@ -147,4 +149,97 @@ class HistoryViewController: AnalysisChildViewController {
self
.
tableView
.
reloadData
()
}
}
override
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
if
(
section
==
0
){
return
nil
}
else
if
(
section
==
1
)
{
if
(
self
.
items
.
count
>
0
)
{
let
view
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
tableView
.
frame
.
width
,
height
:
50
))
let
viewBorder
=
UIView
(
frame
:
CGRect
(
x
:
10
,
y
:
0
,
width
:
view
.
frame
.
width
-
20
,
height
:
view
.
frame
.
height
))
viewBorder
.
backgroundColor
=
UIColor
(
red
:
0.90
,
green
:
0.90
,
blue
:
0.90
,
alpha
:
1.00
)
viewBorder
.
layer
.
cornerRadius
=
16.5
viewBorder
.
layer
.
maskedCorners
=
[
.
layerMinXMinYCorner
,
.
layerMaxXMinYCorner
]
// Top left, bottom right corner radius
let
viewInner
=
UIView
(
frame
:
CGRect
(
x
:
1
,
y
:
1
,
width
:
viewBorder
.
frame
.
width
-
2
,
height
:
viewBorder
.
frame
.
height
-
1
))
viewInner
.
backgroundColor
=
.
white
viewInner
.
layer
.
cornerRadius
=
16.5
viewInner
.
layer
.
maskedCorners
=
[
.
layerMinXMinYCorner
,
.
layerMaxXMinYCorner
]
// Top left, bottom right corner radius
let
titleLabel
=
UILabel
(
frame
:
CGRect
(
x
:
20
,
y
:
20
,
width
:
viewInner
.
frame
.
width
-
40
,
height
:
20
))
titleLabel
.
font
=
UIFont
(
name
:
"BTCosmo-Bold"
,
size
:
20
)
titleLabel
.
textColor
=
UIColor
(
red
:
0.13
,
green
:
0.13
,
blue
:
0.13
,
alpha
:
1.00
)
titleLabel
.
text
=
"Αναλυτικά"
view
.
addSubview
(
viewBorder
)
viewBorder
.
addSubview
(
viewInner
)
viewInner
.
addSubview
(
titleLabel
)
return
view
}
else
{
return
nil
}
}
else
{
return
nil
}
}
override
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
if
(
section
==
0
)
{
return
0.0
}
else
if
(
section
==
1
)
{
if
(
self
.
items
.
count
>
0
)
{
return
50.0
}
else
{
return
0.0
}
}
else
{
return
0.0
}
}
override
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
// return CGFloat.leastNormalMagnitude
if
(
section
==
1
&&
self
.
items
.
count
>
0
)
{
return
20.0
}
else
{
return
0.0
}
}
override
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
if
(
section
==
1
)
{
if
(
self
.
items
.
count
>
0
)
{
let
view
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
tableView
.
frame
.
width
,
height
:
30
))
let
viewBorder
=
UIView
(
frame
:
CGRect
(
x
:
10
,
y
:
0
,
width
:
view
.
frame
.
width
-
20
,
height
:
view
.
frame
.
height
))
viewBorder
.
backgroundColor
=
UIColor
(
red
:
0.90
,
green
:
0.90
,
blue
:
0.90
,
alpha
:
1.00
)
viewBorder
.
layer
.
cornerRadius
=
16.5
viewBorder
.
layer
.
maskedCorners
=
[
.
layerMinXMaxYCorner
,
.
layerMaxXMaxYCorner
]
// bottom left, bottom right corner radius
let
viewInner
=
UIView
(
frame
:
CGRect
(
x
:
1
,
y
:
0
,
width
:
viewBorder
.
frame
.
width
-
2
,
height
:
viewBorder
.
frame
.
height
-
1
))
viewInner
.
backgroundColor
=
.
white
viewInner
.
layer
.
cornerRadius
=
16.5
viewInner
.
layer
.
maskedCorners
=
[
.
layerMinXMaxYCorner
,
.
layerMaxXMaxYCorner
]
// bottom left, bottom right corner radius
view
.
addSubview
(
viewBorder
)
viewBorder
.
addSubview
(
viewInner
)
return
view
}
else
{
return
nil
}
}
else
{
return
nil
}
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/LoyaltyAnalysisViewController.swift
View file @
ea3e2ce
...
...
@@ -31,18 +31,18 @@ import SwiftEventBus
setNavigationTitle
(
"Ανάλυση"
)
// tab
leftButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Bold"
,
size
:
14
)
leftButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-Bold"
,
size
:
15
)
leftButton
.
setTitle
(
"Εξαργυρωμένα"
,
for
:
.
normal
)
leftButton
.
backgroundColor
=
.
clear
leftButton
.
setTitleColor
(
UIColor
(
rgb
:
0x2
EAFB9
),
for
:
.
normal
)
leftButton
.
setTitleColor
(
UIColor
(
rgb
:
0x2
12121
),
for
:
.
normal
)
rightButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Regular"
,
size
:
14
)
rightButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-SemiBold"
,
size
:
15
)
rightButton
.
setTitle
(
"Μοιρασμένα δώρα"
,
for
:
.
normal
)
rightButton
.
backgroundColor
=
.
clear
rightButton
.
setTitleColor
(
UIColor
(
rgb
:
0x
394A5B
),
for
:
.
normal
)
rightButton
.
setTitleColor
(
UIColor
(
rgb
:
0x
848484
),
for
:
.
normal
)
leftLineView
.
applyGradient
(
colours
:
[
UIColor
(
rgb
:
0x1DA6B9
),
UIColor
(
rgb
:
0xB2CE69
)],
gradient
:
GradientOrientation
.
horizontal
,
cornerRadius
:
0.0
)
rightLineView
.
applyGradient
(
colours
:
[
UIColor
(
rgb
:
0x1DA6B9
),
UIColor
(
rgb
:
0xB2CE69
)],
gradient
:
GradientOrientation
.
horizontal
,
cornerRadius
:
0.0
)
//
leftLineView.applyGradient(colours: [UIColor(rgb: 0x1DA6B9), UIColor(rgb: 0xB2CE69)], gradient: GradientOrientation.horizontal, cornerRadius: 0.0)
//
rightLineView.applyGradient(colours: [UIColor(rgb: 0x1DA6B9), UIColor(rgb: 0xB2CE69)], gradient: GradientOrientation.horizontal, cornerRadius: 0.0)
leftLineView
.
isHidden
=
false
rightLineView
.
isHidden
=
true
...
...
@@ -141,11 +141,11 @@ import SwiftEventBus
self
.
leftLineView
.
isHidden
=
false
self
.
rightLineView
.
isHidden
=
true
self
.
leftButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Bold"
,
size
:
14
)
self
.
rightButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Regular"
,
size
:
14
)
self
.
leftButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-Bold"
,
size
:
15
)
self
.
rightButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-SemiBold"
,
size
:
15
)
self
.
leftButton
.
setTitleColor
(
UIColor
(
rgb
:
0x2
EAFB9
),
for
:
.
normal
)
self
.
rightButton
.
setTitleColor
(
UIColor
(
rgb
:
0x
394A5B
),
for
:
.
normal
)
self
.
leftButton
.
setTitleColor
(
UIColor
(
rgb
:
0x2
12121
),
for
:
.
normal
)
self
.
rightButton
.
setTitleColor
(
UIColor
(
rgb
:
0x
848484
),
for
:
.
normal
)
}
let
analysisVC
=
self
.
viewControllerAt
(
0
)
pageController
.
setViewControllers
([
analysisVC
!
],
direction
:
.
reverse
,
animated
:
true
)
...
...
@@ -161,11 +161,11 @@ import SwiftEventBus
self
.
leftLineView
.
isHidden
=
true
self
.
rightLineView
.
isHidden
=
false
self
.
leftButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Regular"
,
size
:
14
)
self
.
rightButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Bold"
,
size
:
14
)
self
.
leftButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-SemiBold"
,
size
:
15
)
self
.
rightButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-Bold"
,
size
:
15
)
self
.
rightButton
.
setTitleColor
(
UIColor
(
rgb
:
0x2
EAFB9
),
for
:
.
normal
)
self
.
leftButton
.
setTitleColor
(
UIColor
(
rgb
:
0x
394A5B
),
for
:
.
normal
)
self
.
rightButton
.
setTitleColor
(
UIColor
(
rgb
:
0x2
12121
),
for
:
.
normal
)
self
.
leftButton
.
setTitleColor
(
UIColor
(
rgb
:
0x
848484
),
for
:
.
normal
)
}
let
analysisVC
=
self
.
viewControllerAt
(
1
)
pageController
.
setViewControllers
([
analysisVC
!
],
direction
:
.
forward
,
animated
:
true
)
...
...
@@ -213,23 +213,22 @@ extension LoyaltyAnalysisViewController: UIPageViewControllerDataSource, UIPageV
return
;
}
if
let
childVCs
=
pageViewController
.
viewControllers
as?
[
AnalysisChildViewController
]
{
let
currentIndex
=
childVCs
[
0
]
.
index
if
(
currentIndex
==
0
)
{
self
.
leftButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Bold"
,
size
:
14
)
self
.
rightButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Regular"
,
size
:
14
)
self
.
leftButton
.
setTitleColor
(
UIColor
(
rgb
:
0x2
EAFB9
),
for
:
.
normal
)
self
.
rightButton
.
setTitleColor
(
UIColor
(
rgb
:
0x
394A5B
),
for
:
.
normal
)
self
.
leftButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-Bold"
,
size
:
15
)
self
.
rightButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-SemiBold"
,
size
:
15
)
self
.
leftButton
.
setTitleColor
(
UIColor
(
rgb
:
0x2
12121
),
for
:
.
normal
)
self
.
rightButton
.
setTitleColor
(
UIColor
(
rgb
:
0x
848484
),
for
:
.
normal
)
self
.
tabSelected
=
0
self
.
leftLineView
.
isHidden
=
false
self
.
rightLineView
.
isHidden
=
true
}
else
{
self
.
leftButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Regular"
,
size
:
14
)
self
.
rightButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Bold"
,
size
:
14
)
self
.
rightButton
.
setTitleColor
(
UIColor
(
rgb
:
0x2
EAFB9
),
for
:
.
normal
)
self
.
leftButton
.
setTitleColor
(
UIColor
(
rgb
:
0x
394A5B
),
for
:
.
normal
)
self
.
leftButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-SemiBold"
,
size
:
15
)
self
.
rightButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-Bold"
,
size
:
15
)
self
.
rightButton
.
setTitleColor
(
UIColor
(
rgb
:
0x2
12121
),
for
:
.
normal
)
self
.
leftButton
.
setTitleColor
(
UIColor
(
rgb
:
0x
848484
),
for
:
.
normal
)
self
.
tabSelected
=
1
self
.
leftLineView
.
isHidden
=
true
self
.
rightLineView
.
isHidden
=
false
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
View file @
ea3e2ce
This diff is collapsed. Click to expand it.
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
ea3e2ce
...
...
@@ -5417,11 +5417,11 @@ public class swiftApi {
}
}
// Example "date": "
Thu, Jun 23 2022 16:24:44",
// Example "date": "
Mon, 28 Nov 2022 10:58:13 GMT"
let
dateString
=
dictionary
[
"date"
]
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
)
...
...
Please
register
or
login
to post a comment