From 5633d564a33646036669ee9d1cc338926ec8e45d Mon Sep 17 00:00:00 2001 From: Keerthy Date: Wed, 2 Aug 2023 22:12:40 +0530 Subject: [PATCH 01/13] Commented logic for focus stuck issue --- MVMCoreUI/Atomic/Organisms/Stack.swift | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Atomic/Organisms/Stack.swift b/MVMCoreUI/Atomic/Organisms/Stack.swift index 1f35e34d..524635ec 100644 --- a/MVMCoreUI/Atomic/Organisms/Stack.swift +++ b/MVMCoreUI/Atomic/Organisms/Stack.swift @@ -48,13 +48,14 @@ open class Stack: Container where T: (StackModelProtocol & MoleculeModelProto } isAccessibilityElement = false - var accessibleViews: [Any] = [] - - for (index, view) in stackItems.enumerated() where !stackModel.molecules[index].gone { - accessibleViews.append(view) - } - - accessibilityElements = accessibleViews + // TO DO need more investigation +// var accessibleViews: [Any] = [] +// +// for (index, view) in stackItems.enumerated() where !stackModel.molecules[index].gone { +// accessibleViews.append(view) +// } +// +// accessibilityElements = accessibleViews } /// Removes all stack items views from the view. From 94d6787d3b8138b6dc4d806d51d2d44ec1095de8 Mon Sep 17 00:00:00 2001 From: Keerthy Date: Wed, 2 Aug 2023 22:39:17 +0530 Subject: [PATCH 02/13] refactoring --- MVMCoreUI/Atomic/Organisms/Stack.swift | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Atomic/Organisms/Stack.swift b/MVMCoreUI/Atomic/Organisms/Stack.swift index 524635ec..a2a07953 100644 --- a/MVMCoreUI/Atomic/Organisms/Stack.swift +++ b/MVMCoreUI/Atomic/Organisms/Stack.swift @@ -48,14 +48,15 @@ open class Stack: Container where T: (StackModelProtocol & MoleculeModelProto } isAccessibilityElement = false - // TO DO need more investigation -// var accessibleViews: [Any] = [] -// -// for (index, view) in stackItems.enumerated() where !stackModel.molecules[index].gone { -// accessibleViews.append(view) -// } -// -// accessibilityElements = accessibleViews + // TODO: need more investigation + /* var accessibleViews: [Any] = [] + + for (index, view) in stackItems.enumerated() where !stackModel.molecules[index].gone { + accessibleViews.append(view) + } + + accessibilityElements = accessibleViews + */ } /// Removes all stack items views from the view. From 939ee1ec7abba49a8425a57f88fb4e611218e3be Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Fri, 15 Sep 2023 15:44:42 +0530 Subject: [PATCH 03/13] Adding option to show a label to loading overlay --- .../BaseControllers/MFLoadingViewController.m | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/BaseControllers/MFLoadingViewController.m b/MVMCoreUI/BaseControllers/MFLoadingViewController.m index 56ad6d3b..567790aa 100644 --- a/MVMCoreUI/BaseControllers/MFLoadingViewController.m +++ b/MVMCoreUI/BaseControllers/MFLoadingViewController.m @@ -12,11 +12,13 @@ #import "UIColor+MFConvenience.h" #import "MFStyler.h" #import "MVMCoreUICommonViewsUtility.h" +#import @interface MFLoadingViewController () @property (nullable, weak, nonatomic) MFLoadingSpinner *activityIndicator; @property (nullable, weak, nonatomic) UIView *transparentBackgroundView; +@property (nullable, weak, nonatomic) Label *indicatorText; @end @@ -27,23 +29,40 @@ view.backgroundColor = [UIColor clearColor]; self.view = view; + UIStackView *loadingStack = [[UIStackView alloc] initWithFrame:CGRectZero]; + loadingStack.axis = UILayoutConstraintAxisVertical; + loadingStack.alignment = UIStackViewAlignmentCenter; + loadingStack.spacing = 20; + // Sets up the loading view. MFLoadingSpinner *activityIndicatorView = [[MFLoadingSpinner alloc] initWithFrame:CGRectMake(0, 0, 36, 36)]; activityIndicatorView.backgroundColor = [UIColor clearColor]; activityIndicatorView.translatesAutoresizingMaskIntoConstraints = NO; - [view addSubview:activityIndicatorView]; self.activityIndicator = activityIndicatorView; self.activityIndicator.accessibilityIdentifier = @"Loader"; [activityIndicatorView pinWidthAndHeight]; + Label *infoLabel = [Label commonLabelH3:YES]; + infoLabel.textAlignment = NSTextAlignmentCenter; + infoLabel.translatesAutoresizingMaskIntoConstraints = NO; + self.indicatorText = infoLabel; + + [loadingStack addArrangedSubview:activityIndicatorView]; + [loadingStack addArrangedSubview:infoLabel]; + + loadingStack.translatesAutoresizingMaskIntoConstraints = NO; + [view addSubview:loadingStack]; // Sets the constraints for the activityIndicatorView - [NSLayoutConstraint constraintPinSubview:activityIndicatorView pinCenterX:YES pinCenterY:YES]; + + [NSLayoutConstraint constraintWithItem:infoLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationGreaterThanOrEqual toItem:nil attribute:NSLayoutAttributeHeight multiplier:1.0 constant:1.0]; + [NSLayoutConstraint constraintPinSubview:loadingStack pinCenterX:YES pinCenterY:YES]; + [NSLayoutConstraint constraintPinSubview:loadingStack pinTop:NO topConstant:0 pinBottom:NO bottomConstant:0 pinLeft:YES leftConstant:0 pinRight:YES rightConstant:0]; // Sets up the transparent background view. UIView *transparentBackground = [MVMCoreUICommonViewsUtility commonView]; transparentBackground.backgroundColor = [UIColor mfBackgroundGray]; transparentBackground.alpha = 0.9; - [view insertSubview:transparentBackground belowSubview:activityIndicatorView]; + [view insertSubview:transparentBackground belowSubview:loadingStack]; self.transparentBackgroundView = transparentBackground; // Sets the constraints of the transparent background view to be the same as the activity indicator view. @@ -61,6 +80,14 @@ [self.activityIndicator resumeSpinner]; } +- (void)startLoadingWith:(nullable NSString *) text{ + if([text length] != 0){ + self.indicatorText.text = text; + self.indicatorText.accessibilityLabel = text; + } + [self.activityIndicator resumeSpinner]; +} + - (void)stopLoading { [self.activityIndicator pauseSpinner]; } From 20a4a2c87be4cf897d2f95d62f2adc9c811d4aa1 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Tue, 17 Oct 2023 14:57:25 +0530 Subject: [PATCH 04/13] Moving progress indicator below the text in the loading overlay screen --- MVMCoreUI/BaseControllers/MFLoadingViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/BaseControllers/MFLoadingViewController.m b/MVMCoreUI/BaseControllers/MFLoadingViewController.m index 567790aa..e573fcd8 100644 --- a/MVMCoreUI/BaseControllers/MFLoadingViewController.m +++ b/MVMCoreUI/BaseControllers/MFLoadingViewController.m @@ -47,8 +47,8 @@ infoLabel.translatesAutoresizingMaskIntoConstraints = NO; self.indicatorText = infoLabel; - [loadingStack addArrangedSubview:activityIndicatorView]; [loadingStack addArrangedSubview:infoLabel]; + [loadingStack addArrangedSubview:activityIndicatorView]; loadingStack.translatesAutoresizingMaskIntoConstraints = NO; [view addSubview:loadingStack]; From 0a42ebb032ccad02ab34f1211e3225a6a0f756f3 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Tue, 17 Oct 2023 20:14:19 +0530 Subject: [PATCH 05/13] Setting empty string to the text in the loading overlay --- MVMCoreUI/BaseControllers/MFLoadingViewController.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/BaseControllers/MFLoadingViewController.m b/MVMCoreUI/BaseControllers/MFLoadingViewController.m index e573fcd8..a2edee05 100644 --- a/MVMCoreUI/BaseControllers/MFLoadingViewController.m +++ b/MVMCoreUI/BaseControllers/MFLoadingViewController.m @@ -81,9 +81,12 @@ } - (void)startLoadingWith:(nullable NSString *) text{ - if([text length] != 0){ + if(text != nil){ self.indicatorText.text = text; self.indicatorText.accessibilityLabel = text; + } else { + self.indicatorText.text = @""; + self.indicatorText.accessibilityLabel = @""; } [self.activityIndicator resumeSpinner]; } From fdaa932c3b89812e96f28491e4268895d42f9403 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Thu, 19 Oct 2023 16:58:07 +0530 Subject: [PATCH 06/13] Enabling the loading overlay info text to take attributed string. --- MVMCoreUI/BaseControllers/MFLoadingViewController.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/BaseControllers/MFLoadingViewController.m b/MVMCoreUI/BaseControllers/MFLoadingViewController.m index a2edee05..fb7dd8f8 100644 --- a/MVMCoreUI/BaseControllers/MFLoadingViewController.m +++ b/MVMCoreUI/BaseControllers/MFLoadingViewController.m @@ -42,7 +42,7 @@ self.activityIndicator.accessibilityIdentifier = @"Loader"; [activityIndicatorView pinWidthAndHeight]; - Label *infoLabel = [Label commonLabelH3:YES]; + Label *infoLabel = [Label label]; infoLabel.textAlignment = NSTextAlignmentCenter; infoLabel.translatesAutoresizingMaskIntoConstraints = NO; self.indicatorText = infoLabel; @@ -80,12 +80,12 @@ [self.activityIndicator resumeSpinner]; } -- (void)startLoadingWith:(nullable NSString *) text{ +- (void)startLoadingWith:(nullable NSAttributedString *) text{ if(text != nil){ - self.indicatorText.text = text; - self.indicatorText.accessibilityLabel = text; + self.indicatorText.attributedText = text; + self.indicatorText.accessibilityLabel = text.string; } else { - self.indicatorText.text = @""; + self.indicatorText.attributedText = nil; self.indicatorText.accessibilityLabel = @""; } [self.activityIndicator resumeSpinner]; From 9be7fef53c2ae991c19bba1d8e97caf127e25182 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Tue, 31 Oct 2023 22:51:39 +0530 Subject: [PATCH 07/13] Showing/Hiding the text while starting/pausing the loading overlay --- MVMCoreUI/BaseControllers/MFLoadingViewController.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MVMCoreUI/BaseControllers/MFLoadingViewController.m b/MVMCoreUI/BaseControllers/MFLoadingViewController.m index fb7dd8f8..79565df2 100644 --- a/MVMCoreUI/BaseControllers/MFLoadingViewController.m +++ b/MVMCoreUI/BaseControllers/MFLoadingViewController.m @@ -45,6 +45,7 @@ Label *infoLabel = [Label label]; infoLabel.textAlignment = NSTextAlignmentCenter; infoLabel.translatesAutoresizingMaskIntoConstraints = NO; + infoLabel.hidden = true; self.indicatorText = infoLabel; [loadingStack addArrangedSubview:infoLabel]; @@ -84,15 +85,20 @@ if(text != nil){ self.indicatorText.attributedText = text; self.indicatorText.accessibilityLabel = text.string; + self.indicatorText.hidden = false; } else { self.indicatorText.attributedText = nil; self.indicatorText.accessibilityLabel = @""; + self.indicatorText.hidden = true; } [self.activityIndicator resumeSpinner]; } - (void)stopLoading { [self.activityIndicator pauseSpinner]; + self.indicatorText.hidden = true; + self.indicatorText.attributedText = nil; + self.indicatorText.accessibilityLabel = @""; } @end From 24c684d64ff99ee327f027c4cd398433b08134ae Mon Sep 17 00:00:00 2001 From: Keerthy Date: Wed, 1 Nov 2023 00:06:41 +0530 Subject: [PATCH 08/13] Updated accessibilityBehavior --- .../FormFields/TextFields/TextEntryField.swift | 2 +- .../Atomic/Atoms/Views/CheckboxLabel.swift | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift index 18749c8a..ad2187a1 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift @@ -379,7 +379,7 @@ import UIKit if let text = model.text, !text.isEmpty { regexTextFieldOutputIfAvailable() } - + setAccessibilityString(model.title ?? "") } } diff --git a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift index 88ee69be..2bfd7e28 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift @@ -14,6 +14,7 @@ public let checkbox = Checkbox() public let label = Label(fontStyle: .RegularBodySmall) + private var observation: NSKeyValueObservation? = nil //-------------------------------------------------- // MARK: - Properties @@ -63,6 +64,12 @@ bottomLabelConstraint.isActive = true alignCheckbox(.center) + isAccessibilityElement = true + accessibilityHint = checkbox.accessibilityHint + accessibilityTraits = checkbox.accessibilityTraits + observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in + self?.updateAccessibilityLabel() + } } @objc override open func updateView(_ size: CGFloat) { @@ -111,6 +118,7 @@ checkbox.set(with: checkBoxWithLabelModel.checkbox, delegateObject, additionalData) label.set(with: checkBoxWithLabelModel.label, delegateObject, additionalData) + updateAccessibilityLabel() } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { @@ -124,4 +132,13 @@ checkbox.reset() alignCheckbox(.center) } + + override open func accessibilityActivate() -> Bool { + checkbox.accessibilityActivate() + } + + open func updateAccessibilityLabel() { + checkbox.updateAccessibilityLabel() + accessibilityLabel = [label.text, checkbox.accessibilityLabel].compactMap { $0 }.joined(separator: ",") + } } From 96fa0bf31442dd028ab8774681772740d89a9b9d Mon Sep 17 00:00:00 2001 From: Keerthy Date: Wed, 1 Nov 2023 13:47:23 +0530 Subject: [PATCH 09/13] Removed accessibilityElements to resolve focus stuck issue --- MVMCoreUI/Atomic/Organisms/Stack.swift | 9 --------- 1 file changed, 9 deletions(-) diff --git a/MVMCoreUI/Atomic/Organisms/Stack.swift b/MVMCoreUI/Atomic/Organisms/Stack.swift index a2a07953..d5de925c 100644 --- a/MVMCoreUI/Atomic/Organisms/Stack.swift +++ b/MVMCoreUI/Atomic/Organisms/Stack.swift @@ -48,15 +48,6 @@ open class Stack: Container where T: (StackModelProtocol & MoleculeModelProto } isAccessibilityElement = false - // TODO: need more investigation - /* var accessibleViews: [Any] = [] - - for (index, view) in stackItems.enumerated() where !stackModel.molecules[index].gone { - accessibleViews.append(view) - } - - accessibilityElements = accessibleViews - */ } /// Removes all stack items views from the view. From 34dcc80f6782cb330924a52d6a77297a5b7ab444 Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Wed, 1 Nov 2023 14:09:55 +0530 Subject: [PATCH 10/13] Updated linkShowing logic for accessibility --- .../ListLeftVariableCheckboxAllTextAndLinks.swift | 5 +++-- .../List/LeftVariable/ListLeftVariableIconAllTextLinks.swift | 4 +++- .../ListLeftVariableIconWithRightCaretAllTextLinks.swift | 5 +++-- .../ListLeftVariableNumberedListAllTextAndLinks.swift | 4 +++- .../ListLeftVariableRadioButtonAllTextAndLinks.swift | 5 +++-- .../ListLeftVariableRadioButtonAndPaymentMethod.swift | 5 +++-- .../ListOneColumnFullWidthTextAllTextAndLinks.swift | 4 +++- .../ListRightVariablePriceChangeAllTextAndLinks.swift | 4 +++- .../ListRightVariableRightCaretAlltextAndLinks.swift | 4 +++- 9 files changed, 27 insertions(+), 13 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift index 1b5b0697..55ae3e02 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift @@ -20,7 +20,7 @@ //-------------------------------------------------- public var stack: Stack - + public var model: MoleculeModelProtocol? private var observation: NSKeyValueObservation? = nil //-------------------------------------------------- @@ -68,6 +68,7 @@ checkbox.set(with: model.checkbox, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -93,7 +94,7 @@ message += label } - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListLeftVariableCheckboxAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing if !linkShowing { // Make whole cell focusable if no link. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift index 728d8464..78b91f9f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconAllTextLinks.swift @@ -15,6 +15,7 @@ public let leftImage = LoadImageView(pinnedEdges: .all) public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() public var stack: Stack + public var model: MoleculeModelProtocol? //-------------------------------------------------- // MARK: - Initializers @@ -53,6 +54,7 @@ leftImage.set(with: model.image, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -75,7 +77,7 @@ func updateAccessibilityLabel() { - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListLeftVariableIconAllTextLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift index 0c09e9e3..683ef1ab 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableIconWithRightCaretAllTextLinks.swift @@ -14,7 +14,7 @@ public let leftImage = LoadImageView(pinnedEdges: .all) public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(spacing: 2.0) public let rightLabel = Label(fontStyle: .RegularBodySmall) - + public var model: MoleculeModelProtocol? public lazy var rightLabelStackItem: StackItem = { return StackItem(andContain: rightLabel) }() @@ -66,6 +66,7 @@ leftImage.set(with: model.image, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) rightLabel.set(with: model.rightLabel, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -97,7 +98,7 @@ } func updateAccessibilityLabel() { - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListLeftVariableIconWithRightCaretAllTextLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift index 75096854..f3afc623 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableNumberedListAllTextAndLinks.swift @@ -15,6 +15,7 @@ public let leftLabel = Label(fontStyle: .Title2XLarge) public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() public var stack: Stack + public var model: MoleculeModelProtocol? //-------------------------------------------------- // MARK: - Initializers @@ -54,6 +55,7 @@ leftLabel.text = String(model.number) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -85,7 +87,7 @@ func updateAccessibilityLabel() { - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListLeftVariableNumberedListAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift index 730f988f..cc3e57d6 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAllTextAndLinks.swift @@ -15,7 +15,7 @@ let radioButton = RadioButton() let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() var stack: Stack - + public var model: MoleculeModelProtocol? private var observation: NSKeyValueObservation? = nil //----------------------------------------------------- @@ -62,6 +62,7 @@ radioButton.set(with: model.radioButton, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -91,7 +92,7 @@ message += label } - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListLeftVariableRadioButtonAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing if !linkShowing { // Make whole cell focusable if no link. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift index 48e3c49c..b749355d 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift @@ -18,7 +18,7 @@ import UIKit let leftImage = LoadImageView(pinnedEdges: .all) let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() var stack: Stack - + public var model: MoleculeModelProtocol? private var observation: NSKeyValueObservation? = nil //----------------------------------------------------- @@ -79,6 +79,7 @@ import UIKit radioButton.set(with: model.radioButton, delegateObject, additionalData) leftImage.set(with: model.image, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -112,7 +113,7 @@ import UIKit message += label } - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListLeftVariableRadioButtonAndPaymentMethodModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing if !linkShowing { // Make whole cell focusable if no link. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift index 6e5a7245..c2c13089 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift @@ -20,6 +20,7 @@ import Foundation let subHeadline = Label(fontStyle: .BoldBodySmall) let body = Label(fontStyle: .RegularBodySmall) let link = Link() + public var model: MoleculeModelProtocol? //----------------------------------------------------- // MARK: - Initializers @@ -52,6 +53,7 @@ import Foundation stack.updateContainedMolecules(with: [model.eyebrow, model.headline, model.subHeadline, model.body, model.link], delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -102,7 +104,7 @@ import Foundation func updateAccessibilityLabel() { - let linkShowing = link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListOneColumnFullWidthTextAllTextAndLinksModel)?.link?.title != nil isAccessibilityElement = !linkShowing if !linkShowing { // Make whole cell focusable if no link. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift index d0b2ff70..4194d112 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariablePriceChangeAllTextAndLinks.swift @@ -18,6 +18,7 @@ private let stack: Stack private let arrowStackItem: StackItem private let rightLabelStackItem: StackItem + public var model: MoleculeModelProtocol? //----------------------------------------------------- // MARK: - Initializers @@ -73,6 +74,7 @@ eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) rightLabel.set(with: model.rightLabel, delegateObject, additionalData) arrow.set(with: model.arrow, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -98,7 +100,7 @@ func updateAccessibilityLabel() { - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListRightVariablePriceChangeAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableRightCaretAlltextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableRightCaretAlltextAndLinks.swift index 12f11b9e..7048a536 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableRightCaretAlltextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/RightVariable/ListRightVariableRightCaretAlltextAndLinks.swift @@ -15,6 +15,7 @@ public let rightLabel = Label(fontStyle: .RegularBodySmall) public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() public var stack: Stack + public var model: MoleculeModelProtocol? //-------------------------------------------------- // MARK: - Initializers @@ -65,6 +66,7 @@ guard let model = model as? ListRightVariableRightCaretAllTextAndLinksModel else { return } rightLabel.set(with: model.rightLabel, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) + self.model = model updateAccessibilityLabel() } @@ -95,7 +97,7 @@ func updateAccessibilityLabel() { - let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 + let linkShowing = (model as? ListRightVariableRightCaretAllTextAndLinksModel)?.eyebrowHeadlineBodyLink.link?.title != nil isAccessibilityElement = !linkShowing accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none From 848defaf39804b5a7152776205f6fe18e85b5619 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Wed, 1 Nov 2023 12:33:03 -0400 Subject: [PATCH 11/13] 32 -> 16 horizontal margin --- MVMCoreUI/Styles/MFStyler.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Styles/MFStyler.m b/MVMCoreUI/Styles/MFStyler.m index e65fddc5..c77e447d 100644 --- a/MVMCoreUI/Styles/MFStyler.m +++ b/MVMCoreUI/Styles/MFStyler.m @@ -17,7 +17,7 @@ #import CGFloat const PaddingDefault = 24; -CGFloat const PaddingDefaultHorizontalSpacing = 32; +CGFloat const PaddingDefaultHorizontalSpacing = 16; CGFloat const PaddingDefaultVerticalSpacing = 32; CGFloat const PaddingDefaultVerticalSpacing3 = 24; CGFloat const PaddingBetweenFields = 24; From 9fe6a4dfc1b904d64f67408e6991e51fb6502181 Mon Sep 17 00:00:00 2001 From: Keerthy Date: Wed, 1 Nov 2023 23:59:34 +0530 Subject: [PATCH 12/13] Updated accessibility behavior for TextEntryField, BaseItemPickerEntryField, CheckboxLabel --- .../Item Dropdown/BaseItemPickerEntryField.swift | 7 ++----- .../Atoms/FormFields/TextFields/TextEntryField.swift | 4 ---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/BaseItemPickerEntryField.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/BaseItemPickerEntryField.swift index fa880a50..65c4448b 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/BaseItemPickerEntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/Dropdown Fields/Item Dropdown/BaseItemPickerEntryField.swift @@ -75,11 +75,8 @@ extension BaseItemPickerEntryField { @objc open override func setAccessibilityString(_ accessibilityString: String?) { var accessibilityString = accessibilityString ?? "" - - if let textPickerItem = MVMCoreUIUtility.hardcodedString(withKey: "textfield_picker_item") { - accessibilityString += textPickerItem - } - + textField.accessibilityTraits = .staticText + textField.accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "textfield_picker_item") textField.accessibilityLabel = "\(accessibilityString) \(textField.isEnabled ? "" : MVMCoreUIUtility.hardcodedString(withKey: "textfield_disabled_state") ?? "")" } } diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift index ad2187a1..a40aa56f 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryField.swift @@ -399,10 +399,6 @@ extension TextEntryField { var accessibilityString = accessibilityString ?? "" - if let txtRegular = MVMCoreUIUtility.hardcodedString(withKey: "textfield_regular") { - accessibilityString += txtRegular - } - textField.accessibilityLabel = "\(accessibilityString) \(textField.isEnabled ? "" : MVMCoreUIUtility.hardcodedString(withKey: "textfield_disabled_state") ?? "")" } } From 5920bf3e50b4f52538982e085d9d1d4f6acdc6ba Mon Sep 17 00:00:00 2001 From: Keerthy Date: Thu, 2 Nov 2023 00:52:13 +0530 Subject: [PATCH 13/13] Order change --- MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift index 2bfd7e28..965656a6 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabel.swift @@ -139,6 +139,6 @@ open func updateAccessibilityLabel() { checkbox.updateAccessibilityLabel() - accessibilityLabel = [label.text, checkbox.accessibilityLabel].compactMap { $0 }.joined(separator: ",") + accessibilityLabel = [checkbox.accessibilityLabel, label.text].compactMap { $0 }.joined(separator: ",") } }