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
2024-02-07 20:48:21 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
085780ffea1ac1357cba892e777d79614afc5d5c
085780ff
1 parent
7d6bbab0
LoyaltyViewController part2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
3 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/FiltersCollectionViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/LoyaltyViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
SwiftWarplyFramework/SwiftWarplyFramework/ScreenCollectionViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
085780f
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/FiltersCollectionViewCell.swift
View file @
085780f
...
...
@@ -8,5 +8,12 @@
import
UIKit
@objc
public
class
FiltersCollectionViewCell
:
UICollectionViewCell
{
@IBOutlet
weak
var
filterLabel
:
UILabel
!
@IBOutlet
weak
var
borderView
:
UIView
!
func
configureCell
(
filterName
:
String
,
isSelected
:
Bool
)
{
filterLabel
.
text
=
filterName
borderView
.
backgroundColor
=
isSelected
?
UIColor
(
rgb
:
0xE8002A
)
:
.
clear
filterLabel
.
textColor
=
isSelected
?
UIColor
(
rgb
:
0x484848
)
:
UIColor
(
rgb
:
0xD3D3D3
)
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/LoyaltyViewController.swift
View file @
085780f
...
...
@@ -11,9 +11,11 @@ import UIKit
@IBOutlet
weak
var
headerView
:
UIView
!
@IBOutlet
weak
var
closeImage
:
UIImageView
!
@IBOutlet
weak
var
logoImage
:
UIImageView
!
@IBOutlet
weak
var
filtersView
:
UIView
!
@IBOutlet
weak
var
collectionView
:
UICollectionView
!
var
selectedScreen
:
String
=
""
var
filtersList
:
Array
<
String
>
=
[
"Όλα"
,
"Σπίτι"
,
"Έξοδος"
,
"Υγεία"
]
var
selectedScreen
:
String
=
"
Offers
"
var
filtersList
:
Array
<
String
>
=
[
"
Screen"
,
"
Όλα"
,
"Σπίτι"
,
"Έξοδος"
,
"Υγεία"
]
var
selectedFilter
:
String
=
"Όλα"
public
override
func
viewDidLoad
()
{
...
...
@@ -24,6 +26,15 @@ import UIKit
closeImage
.
image
=
UIImage
(
named
:
"close_btn_white"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
logoImage
.
image
=
UIImage
(
named
:
"epistrofi_logo"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
// Add shadow
filtersView
.
layer
.
shadowColor
=
UIColor
(
rgb
:
0x000000
)
.
cgColor
filtersView
.
layer
.
shadowOffset
=
CGSize
(
width
:
0.0
,
height
:
10.0
)
filtersView
.
layer
.
shadowOpacity
=
0.05
filtersView
.
layer
.
shadowRadius
=
6.0
collectionView
.
contentInset
.
left
=
20
collectionView
.
contentInset
.
right
=
20
}
}
...
...
@@ -38,8 +49,29 @@ extension LoyaltyViewController: UICollectionViewDataSource,UICollectionViewDele
}
public
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
if
(
indexPath
.
row
==
0
)
{
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
"ScreenCollectionViewCellId"
,
for
:
indexPath
)
as!
ScreenCollectionViewCell
// cell.myLabel.text = "ABCD"
cell
.
configureCell
(
screen
:
selectedScreen
)
return
cell
;
}
else
{
let
currentFilter
=
filtersList
[
indexPath
.
row
];
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
"FiltersCollectionViewCellId"
,
for
:
indexPath
)
as!
FiltersCollectionViewCell
cell
.
configureCell
(
filterName
:
currentFilter
,
isSelected
:
currentFilter
==
selectedFilter
)
return
cell
;
}
}
public
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
if
(
indexPath
.
row
==
0
)
{
let
offersSelected
=
selectedScreen
==
"Offers"
;
selectedScreen
=
offersSelected
?
"Map"
:
"Offers"
}
else
{
let
currentFilter
=
filtersList
[
indexPath
.
row
];
selectedFilter
=
currentFilter
;
}
collectionView
.
reloadData
();
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Main.storyboard
View file @
085780f
This diff is collapsed. Click to expand it.
SwiftWarplyFramework/SwiftWarplyFramework/ScreenCollectionViewCell.swift
View file @
085780f
...
...
@@ -8,5 +8,25 @@
import
UIKit
@objc
public
class
ScreenCollectionViewCell
:
UICollectionViewCell
{
@IBOutlet
weak
var
containerView
:
UIView
!
@IBOutlet
weak
var
filterImage
:
UIImageView
!
@IBOutlet
weak
var
filterLabel
:
UILabel
!
public
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
containerView
.
layer
.
cornerRadius
=
23.0
containerView
.
clipsToBounds
=
true
}
func
configureCell
(
screen
:
String
)
{
if
(
screen
==
"Offers"
)
{
filterImage
.
image
=
UIImage
(
named
:
"list"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
filterLabel
.
text
=
"Λίστα"
}
else
{
filterImage
.
image
=
UIImage
(
named
:
"map_pin"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
filterLabel
.
text
=
"Χάρτης"
}
}
}
...
...
Please
register
or
login
to post a comment