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-07 12:53:40 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ae03f4f83b96e91e633abb54afa1d0cda5dea05d
ae03f4f8
1 parent
c2308f71
CouponViewController accessibilities
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
3 deletions
SwiftWarplyFramework/SwiftWarplyFramework/CouponViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/CouponViewController.swift
View file @
ae03f4f
...
...
@@ -49,10 +49,15 @@ import SwiftEventBus
setBackButton
()
setNavigationTitle
(
"Εκπτωτικό κουπόνι"
)
// Temporarily disable the table view's accessibility to prevent immediate focus shift
// self.mainView.accessibilityElementsHidden = true
// if ((profile != nil) && (profile?._nonTelco == true)) {
if
(
swiftApi
()
.
getUserNonTelco
()
==
true
)
{
nonTelcoDialog
(
"Αδυναμία ενεργοποίησης"
,
"Πρόσθεσε σύνδεση COSMOTE σταθερής, κινητής ή TV για να έχεις πρόσβαση στις προσφορές."
);
}
// if (swiftApi().getUserNonTelco() == true) {
// nonTelcoDialog("Αδυναμία ενεργοποίησης", "Πρόσθεσε σύνδεση COSMOTE σταθερής, κινητής ή TV για να έχεις πρόσβαση στις προσφορές.");
// } else {
// UIAccessibility.post(notification: .screenChanged, argument: self.navigationItem.titleView)
// }
backgroundImage
.
image
=
UIImage
(
named
:
"coupons_scrollview_white"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
...
...
@@ -138,6 +143,7 @@ import SwiftEventBus
toggleTerms
()
setupAccessibilty
()
}
public
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
...
...
@@ -147,6 +153,22 @@ import SwiftEventBus
self
.
navigationController
?
.
hideHairline
()
}
public
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
// if ((profile != nil) && (profile?._nonTelco == true)) {
if
(
swiftApi
()
.
getUserNonTelco
()
==
true
)
{
nonTelcoDialog
(
"Αδυναμία ενεργοποίησης"
,
"Πρόσθεσε σύνδεση COSMOTE σταθερής, κινητής ή TV για να έχεις πρόσβαση στις προσφορές."
);
}
else
{
UIAccessibility
.
post
(
notification
:
.
screenChanged
,
argument
:
self
.
navigationItem
.
titleView
)
}
// Re-enable table view accessibility after the announcement
// DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
// self.mainView.accessibilityElementsHidden = false
// }
}
public
func
textView
(
_
textView
:
UITextView
,
shouldInteractWith
URL
:
URL
,
in
characterRange
:
NSRange
,
interaction
:
UITextItemInteraction
)
->
Bool
{
UIApplication
.
shared
.
open
(
URL
)
...
...
@@ -156,6 +178,23 @@ import SwiftEventBus
}
// MARK: - Functions
func
setupAccessibilty
()
{
couponImage
.
isAccessibilityElement
=
true
couponImage
.
accessibilityLabel
=
"Φωτογραφία εκπτωτικού κουπονιού"
couponImage
.
accessibilityTraits
=
.
image
redeemButton
.
isAccessibilityElement
=
true
redeemButton
.
accessibilityLabel
=
redeemButton
.
title
(
for
:
.
normal
)
redeemButton
.
accessibilityHint
=
"Διπλό πάτημα για άνοιγμα"
redeemButton
.
accessibilityTraits
=
.
button
termsButton
.
isAccessibilityElement
=
true
termsButton
.
accessibilityLabel
=
termsButton
.
title
(
for
:
.
normal
)
termsButton
.
accessibilityHint
=
"Διπλό πάτημα για εμφάνιση"
termsButton
.
accessibilityTraits
=
.
button
termsButton
.
accessibilityValue
=
"Συμπτυγμένο"
}
func
nonTelcoDialog
(
_
alertTitle
:
String
,
_
alertSubTitle
:
String
)
->
Void
{
let
alert
=
UIAlertController
(
title
:
alertTitle
,
message
:
alertSubTitle
,
preferredStyle
:
.
alert
)
...
...
@@ -183,11 +222,17 @@ import SwiftEventBus
termsTextViewHeight
.
constant
=
termsTextView
.
sizeThatFits
(
targetSize
)
.
height
termsButton
.
setImage
(
UIImage
(
named
:
"ic_up_dark_2.png"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
),
for
:
.
normal
)
termsButton
.
accessibilityValue
=
"Ανεπτυγμένο"
termsButton
.
accessibilityHint
=
"Διπλό πάτημα για απόκρυψη"
}
else
{
termsTextView
.
isHidden
=
true
termsTextViewHeight
.
constant
=
CGFloat
(
0
)
termsButton
.
setImage
(
UIImage
(
named
:
"ic_down_dark_2.png"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
),
for
:
.
normal
)
termsButton
.
accessibilityValue
=
"Συμπτυγμένο"
termsButton
.
accessibilityHint
=
"Διπλό πάτημα για εμφάνιση"
}
}
...
...
Please
register
or
login
to post a comment