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
2025-02-04 11:14:25 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
dc65aba04cb05c23b77524c6297e5b4243c04ac0
dc65aba0
1 parent
1e20bb60
MyRewards Accessibilities
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
11 deletions
SwiftWarplyFramework/SwiftWarplyFramework/WalletActiveCouponCollectionViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletActiveCouponsScrollTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletQuestionnaireBannerTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletVouchersBannerTableViewCell.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletActiveCouponCollectionViewCell.swift
View file @
dc65aba
...
...
@@ -58,5 +58,15 @@ import UIKit
}
badgeCountLabel
.
text
=
String
(
badgeCount
)
setupAccessibilty
(
badgeText
:
badgeLabel
.
text
??
""
,
badgeCount
:
badgeCount
,
showBadgeCount
:
!
badgeCountView
.
isHidden
)
}
func
setupAccessibilty
(
badgeText
:
String
,
badgeCount
:
Int
,
showBadgeCount
:
Bool
)
{
self
.
isAccessibilityElement
=
true
self
.
accessibilityLabel
=
badgeText
+
", "
+
(
showBadgeCount
?
String
(
badgeCount
)
:
""
)
self
.
accessibilityHint
=
"Διπλό πάτημα για άνοιγμα"
self
.
accessibilityTraits
=
.
button
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/WalletActiveCouponsScrollTableViewCell.swift
View file @
dc65aba
...
...
@@ -11,6 +11,7 @@ import SwiftEventBus
@objc
public
class
WalletActiveCouponsScrollTableViewCell
:
UITableViewCell
{
@IBOutlet
weak
var
sectionTitleLabel
:
UILabel
!
@IBOutlet
weak
var
historyButtonImage
:
UIImageView
!
@IBOutlet
weak
var
historyButton
:
UIButton
!
@IBOutlet
weak
var
collectionView
:
UICollectionView
!
@IBOutlet
weak
var
dotLeft
:
UIView
!
...
...
@@ -54,6 +55,19 @@ import SwiftEventBus
func
configureCell
(
dfyCount
:
Int
,
smCount
:
Int
,
gfyCount
:
Int
,
boxCount
:
Int
)
{
sortBadges
(
dfyCount
,
smCount
,
gfyCount
,
boxCount
)
setupAccessibilty
()
}
func
setupAccessibilty
()
{
// Disable accessibility for the whole cell
self
.
isAccessibilityElement
=
false
sectionTitleLabel
.
isAccessibilityElement
=
true
historyButton
.
isAccessibilityElement
=
true
historyButton
.
accessibilityLabel
=
"Ιστορικό"
historyButton
.
accessibilityHint
=
"Διπλό πάτημα για άνοιγμα"
historyButton
.
accessibilityTraits
=
.
button
}
func
sortBadges
(
_
dfyCount
:
Int
,
_
smCount
:
Int
,
_
gfyCount
:
Int
,
_
boxCount
:
Int
)
{
...
...
SwiftWarplyFramework/SwiftWarplyFramework/WalletQuestionnaireBannerTableViewCell.swift
View file @
dc65aba
...
...
@@ -97,6 +97,23 @@ import UIKit
bannerView
.
isHidden
=
false
bannerCenteredView
.
isHidden
=
true
}
setupAccessibilty
(
buttonTitle
:
(
isCentered
?
bannerCenteredLabel
.
text
:
bannerLabel
.
text
)
??
""
)
}
func
setupAccessibilty
(
buttonTitle
:
String
)
{
// Disable accessibility for the whole cell
self
.
isAccessibilityElement
=
false
bannerView
.
isAccessibilityElement
=
true
bannerView
.
accessibilityLabel
=
buttonTitle
bannerView
.
accessibilityHint
=
"Διπλό πάτημα για άνοιγμα"
bannerView
.
accessibilityTraits
=
.
button
bannerCenteredView
.
isAccessibilityElement
=
true
bannerCenteredView
.
accessibilityLabel
=
buttonTitle
bannerCenteredView
.
accessibilityHint
=
"Διπλό πάτημα για άνοιγμα"
bannerCenteredView
.
accessibilityTraits
=
.
button
}
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
View file @
dc65aba
...
...
@@ -595,6 +595,17 @@ import SwiftEventBus
}
}
// Auto focus Accessibility
// public override func viewDidAppear(_ animated: Bool) {
// super.viewDidAppear(animated)
//
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
// if let firstCell = self.tableView.visibleCells.first as? WalletActiveCouponsScrollTableViewCell {
// UIAccessibility.post(notification: .layoutChanged, argument: firstCell.sectionTitleLabel)
// }
// }
// }
public
override
func
viewDidLayoutSubviews
()
{
super
.
viewDidLayoutSubviews
()
...
...
@@ -857,6 +868,23 @@ import SwiftEventBus
swiftApi
()
.
openQuestionnaire
(
self
);
}
@IBAction
func
questionnaireBannerButtonAction
(
_
sender
:
Any
)
{
swiftApi
()
.
logTrackersEvent
(
"click"
,
(
"LoyaltyWalletScreen:"
+
"Questionnaire"
))
swiftApi
()
.
openQuestionnaire
(
self
);
}
@IBAction
func
vouchersBannerButtonAction
(
_
sender
:
Any
)
{
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"did_tap_vouchers_badge"
firebaseEvent
.
setParameter
=
(
"screen"
,
"Loyalty Wallet"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
swiftApi
()
.
logTrackersEvent
(
"click"
,
(
"LoyaltyWalletScreen:"
+
"VouchersBadge"
))
SwiftEventBus
.
post
(
"vouchers_banner_pressed"
)
}
@IBAction
func
historyButtonAction
(
_
sender
:
Any
)
{
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"did_tap_history_badge"
...
...
@@ -1482,9 +1510,10 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
}
else
if
(
indexPath
.
section
==
1
)
{
// Do nothing
}
else
if
(
indexPath
.
section
==
2
)
{
swiftApi
()
.
logTrackersEvent
(
"click"
,
(
"LoyaltyWalletScreen:"
+
"Questionnaire"
))
swiftApi
()
.
openQuestionnaire
(
self
);
// Do nothing - action transfered to questionnaireBannerButtonAction
// swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "Questionnaire"))
//
// swiftApi().openQuestionnaire(self);
}
// else if (indexPath.section == 2) {
...
...
@@ -1501,14 +1530,15 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
//
// }
else
if
(
indexPath
.
section
==
3
)
{
let
firebaseEvent
=
swiftApi
.
LoyaltySDKFirebaseEventModel
()
firebaseEvent
.
_eventName
=
"did_tap_vouchers_badge"
firebaseEvent
.
setParameter
=
(
"screen"
,
"Loyalty Wallet"
)
SwiftEventBus
.
post
(
"firebase"
,
sender
:
firebaseEvent
)
swiftApi
()
.
logTrackersEvent
(
"click"
,
(
"LoyaltyWalletScreen:"
+
"VouchersBadge"
))
SwiftEventBus
.
post
(
"vouchers_banner_pressed"
)
// // Do nothing - action transfered to vouchersBannerButtonAction
// let firebaseEvent = swiftApi.LoyaltySDKFirebaseEventModel()
// firebaseEvent._eventName = "did_tap_vouchers_badge"
// firebaseEvent.setParameter = ("screen", "Loyalty Wallet")
// SwiftEventBus.post("firebase", sender: firebaseEvent)
//
// swiftApi().logTrackersEvent("click", ("LoyaltyWalletScreen:" + "VouchersBadge"))
//
// SwiftEventBus.post("vouchers_banner_pressed")
}
else
if
(
indexPath
.
section
==
4
)
{
// Do nothing
...
...
SwiftWarplyFramework/SwiftWarplyFramework/WalletVouchersBannerTableViewCell.swift
View file @
dc65aba
...
...
@@ -6,6 +6,7 @@
//
import
UIKit
import
SwiftEventBus
@objc
public
class
WalletVouchersBannerTableViewCell
:
UITableViewCell
{
@IBOutlet
weak
var
separatorView
:
UIView
!
...
...
@@ -78,6 +79,20 @@ import UIKit
voucherBannerLabel
.
frame
.
size
.
width
=
voucherBannerLabel
.
intrinsicContentSize
.
width
voucherCountView
.
isHidden
=
false
}
setupAccessibilty
(
active
:
active
,
buttonTitle
:
voucherBannerLabel
.
text
??
""
)
}
func
setupAccessibilty
(
active
:
Bool
,
buttonTitle
:
String
)
{
// Disable accessibility for the whole cell
self
.
isAccessibilityElement
=
false
sectionTitleLabel
.
isAccessibilityElement
=
true
voucherBannerView
.
isAccessibilityElement
=
true
voucherBannerView
.
accessibilityLabel
=
buttonTitle
+
(
!
active
?
", 0"
:
""
)
+
(
!
active
?
", Ανενεργό"
:
""
)
voucherBannerView
.
accessibilityHint
=
"Διπλό πάτημα για άνοιγμα"
voucherBannerView
.
accessibilityTraits
=
.
button
}
}
...
...
Please
register
or
login
to post a comment