From 3d303e6c0788611ba7a9cd34516b745b37fb1451 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 15 Feb 2024 10:54:42 -0600 Subject: [PATCH 1/4] allow overriding Signed-off-by: Matt Bruce --- VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift index 113d19f5..ddb5d617 100644 --- a/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift +++ b/VDS/Components/Buttons/ButtonGroup/ButtonGroup.swift @@ -198,7 +198,7 @@ extension ButtonGroup: UICollectionViewDataSource, UICollectionViewDelegate { return buttons.count } - public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + open func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let button = buttons[indexPath.row] guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "collectionViewCell", for: indexPath) as? ButtonGroupCollectionViewCell else { return UICollectionViewCell() } cell.contentView.subviews.forEach { $0.removeFromSuperview() } From abb94257da8d8045e1d88f92e10c4195dd43fac1 Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Mon, 26 Feb 2024 13:28:24 +0530 Subject: [PATCH 2/4] fixed conflicting constraints --- VDS/Components/Notification/Notification.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/VDS/Components/Notification/Notification.swift b/VDS/Components/Notification/Notification.swift index 2ed84116..126f83f0 100644 --- a/VDS/Components/Notification/Notification.swift +++ b/VDS/Components/Notification/Notification.swift @@ -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 } } From 11c8ed87565c85e2c4979ff5962c6e461b902d62 Mon Sep 17 00:00:00 2001 From: "Bandaru, Krishna Kishore" Date: Mon, 26 Feb 2024 21:10:53 +0000 Subject: [PATCH 3/4] Fixed conflicting constraints while displaying Notifications --- VDS/Components/Notification/Notification.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/VDS/Components/Notification/Notification.swift b/VDS/Components/Notification/Notification.swift index 2ed84116..126f83f0 100644 --- a/VDS/Components/Notification/Notification.swift +++ b/VDS/Components/Notification/Notification.swift @@ -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 } } From f4f6a005e40e99bb8b620cbeaada917d0be4a792 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 27 Feb 2024 09:47:50 -0600 Subject: [PATCH 4/4] put accessibility changes to method. Signed-off-by: Matt Bruce --- VDS/Components/Loader/Loader.swift | 37 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/VDS/Components/Loader/Loader.swift b/VDS/Components/Loader/Loader.swift index 90d589be..baf6ecdb 100644 --- a/VDS/Components/Loader/Loader.swift +++ b/VDS/Components/Loader/Loader.swift @@ -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() {