Merge branch 'bugfix/CXTDT-518373' into 'develop'
CXTDT-518373 - Accessibility on Loader See merge request BPHV_MIPS/vds_ios!146
This commit is contained in:
commit
5c9e0aad47
@ -120,11 +120,12 @@ open class Loader: View {
|
||||
|
||||
// setup timer for post
|
||||
loadingTimer = Timer.scheduledTimer(withTimeInterval: 60, repeats: true) { [weak self] _ in
|
||||
self?.accessibilityLabel = "Still Loading"
|
||||
guard let self, self.isActive, self.isVisibleOnScreen else { return }
|
||||
self.accessibilityLabel = "Still Loading"
|
||||
UIAccessibility.post(notification: .announcement, argument: "Still Loading")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private func stopAnimating() {
|
||||
isAccessibilityElement = false
|
||||
icon.isHidden = true
|
||||
@ -132,7 +133,7 @@ open class Loader: View {
|
||||
loadingTimer?.invalidate()
|
||||
loadingTimer = nil
|
||||
}
|
||||
|
||||
|
||||
deinit {
|
||||
stopAnimating()
|
||||
}
|
||||
|
||||
@ -24,4 +24,30 @@ extension UIView {
|
||||
public func setAccessibilityLabel(for views: [UIView]) {
|
||||
accessibilityLabel = combineAccessibilityLabel(for: views)
|
||||
}
|
||||
|
||||
/// Will tell if the view is actually visibile on screen, also it will check the hierarchy above this view.
|
||||
public var isVisibleOnScreen: Bool {
|
||||
// Ensure the view has a window, meaning it's part of the view hierarchy
|
||||
guard let window = self.window, !self.isHidden, self.alpha > 0 else {
|
||||
return false
|
||||
}
|
||||
|
||||
// Check if the view's frame intersects with the window's bounds
|
||||
let viewFrameInWindow = self.convert(self.bounds, to: window)
|
||||
var isIntersecting = viewFrameInWindow.intersects(window.bounds)
|
||||
|
||||
// Check parent views for visibility
|
||||
var currentView: UIView? = self
|
||||
while let view = currentView, isIntersecting {
|
||||
// If any parent has a constraint making it effectively invisible, set isIntersecting to false
|
||||
if view.bounds.size.width == 0 || view.bounds.size.height == 0 {
|
||||
isIntersecting = false
|
||||
break
|
||||
}
|
||||
currentView = view.superview
|
||||
}
|
||||
|
||||
return isIntersecting
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
1.0.54
|
||||
----------------
|
||||
- CXTDT-518373 Accessibility Voiceover is reading “Still Loading” after waiting for a short time in all the screens.
|
||||
|
||||
1.0.53
|
||||
----------------
|
||||
- ONEAPP-4683 - Updated to accesibilityValue for the tabs position.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user