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-11 16:41:44 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cf08401ce38a0e6435debac408b3b38697651705
cf08401c
1 parent
87dc3b18
redesign CouponBarcodeViewController
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
34 deletions
SwiftWarplyFramework/SwiftWarplyFramework/CouponBarcodeViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
SwiftWarplyFramework/SwiftWarplyFramework/CouponBarcodeViewController.swift
View file @
cf08401
...
...
@@ -77,22 +77,22 @@ import AVFoundation
// scrollView.layer.cornerRadius = 30
// scrollView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
let
image
=
UIImage
(
named
:
"top_border_line"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
!
var
aspectR
:
CGFloat
=
0.0
aspectR
=
image
.
size
.
width
/
image
.
size
.
height
topBorderLine
.
translatesAutoresizingMaskIntoConstraints
=
false
topBorderLine
.
image
=
image
topBorderLine
.
contentMode
=
.
scaleAspectFill
NSLayoutConstraint
.
activate
([
topBorderLine
.
topAnchor
.
constraint
(
equalTo
:
mainView
.
topAnchor
,
constant
:
0
),
topBorderLine
.
leadingAnchor
.
constraint
(
equalTo
:
mainView
.
leadingAnchor
,
constant
:
0
),
topBorderLine
.
trailingAnchor
.
constraint
(
equalTo
:
mainView
.
trailingAnchor
,
constant
:
0
),
topBorderLine
.
widthAnchor
.
constraint
(
equalToConstant
:
UIScreen
.
main
.
bounds
.
width
),
topBorderLine
.
heightAnchor
.
constraint
(
equalTo
:
topBorderLine
.
widthAnchor
,
multiplier
:
1
/
aspectR
)
])
//
let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
//
var aspectR: CGFloat = 0.0
//
//
aspectR = image.size.width/image.size.height
//
//
topBorderLine.translatesAutoresizingMaskIntoConstraints = false
//
topBorderLine.image = image
//
topBorderLine.contentMode = .scaleAspectFill
//
//
NSLayoutConstraint.activate([
//
topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
//
topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
//
topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
//
topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
//
topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
//
])
// COUPONSET: desc, img_preview, name, terms
// COUPON: coupon, expiration, discount, status
...
...
@@ -119,8 +119,8 @@ import AVFoundation
if
(
htmlMerchDescrText
!=
""
)
{
merchantDescrTextView
.
attributedText
=
htmlMerchDescrText
.
htmlToAttributedString
merchantDescrTextView
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Regular"
,
size
:
17
)
merchantDescrTextView
.
textColor
=
UIColor
(
red
:
0.
25
,
green
:
0.33
,
blue
:
0.39
,
alpha
:
1.00
)
merchantDescrTextView
.
font
=
UIFont
(
name
:
"P
eridotPE-Regular"
,
size
:
16
)
merchantDescrTextView
.
textColor
=
UIColor
(
red
:
0.
13
,
green
:
0.13
,
blue
:
0.13
,
alpha
:
1.00
)
merchantDescrTextView
.
textAlignment
=
.
center
merchantDescrTextView
.
isScrollEnabled
=
false
merchantDescrTextView
.
isUserInteractionEnabled
=
true
...
...
@@ -138,7 +138,7 @@ import AVFoundation
}
}
couponView
.
layer
.
cornerRadius
=
8
couponView
.
layer
.
cornerRadius
=
16
couponNumberLabel
.
text
=
coupon
?
.
coupon
??
""
couponView
.
frame
=
CGRect
(
x
:
0.0
,
y
:
0.0
,
width
:
couponView
.
intrinsicContentSize
.
width
,
height
:
55
)
...
...
@@ -182,23 +182,23 @@ import AVFoundation
showBarcodeButtonTopSpace
.
constant
=
0
// ===
showBarcodeButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Medium
"
,
size
:
16
)
showBarcodeButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-Bold
"
,
size
:
16
)
showBarcodeButton
.
setTitle
(
"Εμφάνιση barcode"
,
for
:
.
normal
)
showBarcodeButton
.
setTitleColor
(
UIColor
(
red
:
0.
25
,
green
:
0.33
,
blue
:
0.39
,
alpha
:
1.00
),
for
:
.
normal
)
showBarcodeButton
.
setTitleColor
(
UIColor
(
red
:
0.
13
,
green
:
0.13
,
blue
:
0.13
,
alpha
:
1.00
),
for
:
.
normal
)
showBarcodeButton
.
setImage
(
UIImage
(
named
:
"ic_down_dark_2.png"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
),
for
:
.
normal
)
showBarcodeButton
.
semanticContentAttribute
=
.
forceRightToLeft
showBarcodeButton
.
tintColor
=
UIColor
(
red
:
0.
21
,
green
:
0.32
,
blue
:
0.41
,
alpha
:
1.00
)
showBarcodeButton
.
tintColor
=
UIColor
(
red
:
0.
00
,
green
:
0.00
,
blue
:
0.00
,
alpha
:
1.00
)
showBarcodeButton
.
imageEdgeInsets
=
UIEdgeInsets
(
top
:
0
,
left
:
5
,
bottom
:
0
,
right
:
0
);
showBarcodeButton
.
titleEdgeInsets
=
UIEdgeInsets
(
top
:
0
,
left
:
0
,
bottom
:
0
,
right
:
5
);
showBarcodeButton
.
imageView
?
.
layer
.
transform
=
CATransform3DMakeScale
(
0.8
,
0.8
,
0.8
)
expirationLabel
.
text
=
"Το κουπόνι ισχύει έως "
+
(
coupon
?
.
expiration
??
""
)
redeemButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Medium
"
,
size
:
18
)
redeemButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-SemiBold
"
,
size
:
18
)
redeemButton
.
setTitle
(
"Δώρισέ το"
,
for
:
.
normal
)
redeemButton
.
setTitleColor
(
.
white
,
for
:
.
normal
)
redeemButton
.
backgroundColor
=
UIColor
(
red
:
0.
47
,
green
:
0.75
,
blue
:
0.08
,
alpha
:
1.00
)
redeemButton
.
layer
.
cornerRadius
=
8
.0
redeemButton
.
backgroundColor
=
UIColor
(
red
:
0.
05
,
green
:
0.65
,
blue
:
0.00
,
alpha
:
1.00
)
redeemButton
.
layer
.
cornerRadius
=
16
.0
redeemButton
.
frame
=
CGRect
(
x
:
0.0
,
y
:
0.0
,
width
:
redeemButton
.
intrinsicContentSize
.
width
,
height
:
44
)
redeemButton
.
contentEdgeInsets
=
UIEdgeInsets
(
top
:
1
,
left
:
16
,
bottom
:
0
,
right
:
16
)
// Fix width for ipad
...
...
@@ -210,13 +210,16 @@ import AVFoundation
// redeemButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
// }
mapButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Medium
"
,
size
:
18
)
mapButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-Bold
"
,
size
:
18
)
mapButton
.
setTitle
(
"Δες τα καταστήματα"
,
for
:
.
normal
)
mapButton
.
setTitleColor
(
UIColor
(
red
:
0.31
,
green
:
0.62
,
blue
:
0.18
,
alpha
:
1.00
),
for
:
.
normal
)
mapButton
.
backgroundColor
=
UIColor
(
red
:
0.90
,
green
:
0.90
,
blue
:
0.90
,
alpha
:
1.00
)
mapButton
.
layer
.
cornerRadius
=
8.0
mapButton
.
setTitleColor
(
UIColor
(
red
:
0.05
,
green
:
0.65
,
blue
:
0.00
,
alpha
:
1.00
),
for
:
.
normal
)
mapButton
.
layer
.
cornerRadius
=
15.0
mapButton
.
frame
=
CGRect
(
x
:
0.0
,
y
:
0.0
,
width
:
mapButton
.
intrinsicContentSize
.
width
,
height
:
44
)
mapButton
.
contentEdgeInsets
=
UIEdgeInsets
(
top
:
1
,
left
:
16
,
bottom
:
0
,
right
:
16
)
mapButton
.
backgroundColor
=
.
clear
mapButton
.
layer
.
borderWidth
=
2
mapButton
.
layer
.
borderColor
=
UIColor
(
red
:
0.05
,
green
:
0.65
,
blue
:
0.00
,
alpha
:
1.00
)
.
cgColor
// mapButton.isHidden = true
// mapButtonHeight.constant = 0
...
...
@@ -265,21 +268,21 @@ import AVFoundation
// mapButton.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.6).isActive = true
// }
termsButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
FSquareSansPro-Regular
"
,
size
:
16
)
termsButton
.
titleLabel
?
.
font
=
UIFont
(
name
:
"P
eridotPE-Bold
"
,
size
:
16
)
// termsButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
termsButton
.
setTitle
(
"Όροι χρήσης"
,
for
:
.
normal
)
termsButton
.
setTitleColor
(
UIColor
(
red
:
0.
25
,
green
:
0.33
,
blue
:
0.39
,
alpha
:
1.00
),
for
:
.
normal
)
termsButton
.
setTitleColor
(
UIColor
(
red
:
0.
13
,
green
:
0.13
,
blue
:
0.13
,
alpha
:
1.00
),
for
:
.
normal
)
termsButton
.
setImage
(
UIImage
(
named
:
"ic_down_dark_2.png"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
),
for
:
.
normal
)
termsButton
.
semanticContentAttribute
=
.
forceRightToLeft
termsButton
.
tintColor
=
UIColor
(
red
:
0.
21
,
green
:
0.32
,
blue
:
0.41
,
alpha
:
1.00
)
termsButton
.
tintColor
=
UIColor
(
red
:
0.
00
,
green
:
0.00
,
blue
:
0.00
,
alpha
:
1.00
)
termsButton
.
imageEdgeInsets
=
UIEdgeInsets
(
top
:
0
,
left
:
5
,
bottom
:
0
,
right
:
0
);
termsButton
.
titleEdgeInsets
=
UIEdgeInsets
(
top
:
0
,
left
:
0
,
bottom
:
0
,
right
:
5
);
termsButton
.
imageView
?
.
layer
.
transform
=
CATransform3DMakeScale
(
0.8
,
0.8
,
0.8
)
let
htmlText
=
couponSetData
?
.
terms
??
""
termsTextView
.
attributedText
=
htmlText
.
htmlToAttributedString
termsTextView
.
font
=
UIFont
(
name
:
"P
FSquareSansPro
-Regular"
,
size
:
15
)
termsTextView
.
textColor
=
UIColor
(
red
:
0.
25
,
green
:
0.33
,
blue
:
0.39
,
alpha
:
1.00
)
termsTextView
.
font
=
UIFont
(
name
:
"P
eridotPE
-Regular"
,
size
:
15
)
termsTextView
.
textColor
=
UIColor
(
red
:
0.
62
,
green
:
0.62
,
blue
:
0.61
,
alpha
:
1.00
)
termsTextView
.
textAlignment
=
.
center
termsTextView
.
isScrollEnabled
=
false
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
View file @
cf08401
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment