Merge branch 'develop' into feature/vds_batch_three

This commit is contained in:
Matt Bruce 2024-02-27 10:09:07 -06:00
commit a487d41b56
2 changed files with 26 additions and 20 deletions

View File

@ -87,8 +87,26 @@ open class Loader: View {
}
invalidateIntrinsicContentSize()
}
open override func updateAccessibility() {
super.updateAccessibility()
// check to make sure VoiceOver is running
guard UIAccessibility.isVoiceOverRunning, isActive else {
loadingTimer?.invalidate()
loadingTimer = nil
return
}
// Focus VoiceOver on this view
UIAccessibility.post(notification: .layoutChanged, argument: self)
// setup timer for post
loadingTimer = Timer.scheduledTimer(withTimeInterval: 60, repeats: true) { [weak self] _ in
guard let self, self.isActive, self.isVisibleOnScreen else { return }
self.accessibilityLabel = "Still Loading"
UIAccessibility.post(notification: .announcement, argument: "Still Loading")
}
}
//--------------------------------------------------
@ -107,23 +125,6 @@ open class Loader: View {
rotation.duration = 0.5
rotation.repeatCount = .infinity
icon.layer.add(rotation, forKey: rotationLayerName)
// check to make sure VoiceOver is running
guard UIAccessibility.isVoiceOverRunning else {
loadingTimer?.invalidate()
loadingTimer = nil
return
}
// Focus VoiceOver on this view
UIAccessibility.post(notification: .layoutChanged, argument: self)
// setup timer for post
loadingTimer = Timer.scheduledTimer(withTimeInterval: 60, repeats: true) { [weak self] _ in
guard let self, self.isActive, self.isVisibleOnScreen else { return }
self.accessibilityLabel = "Still Loading"
UIAccessibility.post(notification: .announcement, argument: "Still Loading")
}
}
private func stopAnimating() {

View File

@ -398,13 +398,18 @@ open class Notification: View {
}
private func setConstraints() {
maxWidthConstraint?.deactivate()
labelViewAndButtonViewConstraint?.deactivate()
labelViewBottomConstraint?.deactivate()
buttonGroupCenterYConstraint?.deactivate()
buttonGroupBottomConstraint?.deactivate()
maxWidthConstraint?.constant = maxViewWidth
maxWidthConstraint?.isActive = UIDevice.isIPad
labelViewAndButtonViewConstraint?.isActive = layout == .vertical && !buttonGroup.buttons.isEmpty
typeIconWidthConstraint?.constant = typeIcon.size.dimensions.width
closeIconWidthConstraint?.constant = closeButton.size.dimensions.width
labelViewBottomConstraint?.isActive = layout == .horizontal || buttonGroup.buttons.isEmpty
buttonGroupCenterYConstraint?.isActive = layout == .horizontal
buttonGroupBottomConstraint?.isActive = layout == .vertical
typeIconWidthConstraint?.constant = typeIcon.size.dimensions.width
closeIconWidthConstraint?.constant = closeButton.size.dimensions.width
}
}