From b62ad4fe3cc61ad8e523e0717ce0f64246df0b55 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Mon, 25 Jul 2022 11:25:26 +0530 Subject: [PATCH 1/7] Fix for DOPMO-182687, Retaining the voice over focus on the selected tab rather than resetting to the top. --- .../Atomic/Molecules/HorizontalCombinationViews/Tabs.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift index 4e424549..bb3db689 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift @@ -258,6 +258,9 @@ extension Tabs: UICollectionViewDelegateFlowLayout { } else if let action = tabsModel.tabs[selectedIndex].action { MVMCoreActionHandler.shared()?.asyncHandleAction(with: action, additionalData: [KeySourceModel: tabsModel], delegateObject:delegateObject) } + if UIAccessibility.isVoiceOverRunning { + UIAccessibility.post(notification: .layoutChanged, argument: tabCell) + } } } From cb29c35080d6ce29a171389ee90acefef1b4eb10 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Mon, 25 Jul 2022 17:13:49 -0400 Subject: [PATCH 2/7] Line color set for tabs --- .../Atomic/Molecules/HorizontalCombinationViews/Tabs.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift index 4e424549..7c5485be 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift @@ -155,6 +155,9 @@ import VDSColorTokens self.additionalData = additionalData selectedIndex = tabsModel?.selectedIndex ?? 0 selectionLine.backgroundColor = tabsModel?.selectedBarColor.uiColor + let lineModel = bottomLine.lineModel ?? LineModel(type: .secondary) + lineModel.inverted = tabsModel?.style == .dark + bottomLine.set(with: lineModel, delegateObject, additionalData) reloadData() } } From a241265bab2e294aaa4be927bb0784366c3ae233 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Wed, 3 Aug 2022 15:17:25 +0530 Subject: [PATCH 3/7] VDS radio button of size and color changes as per 3.0 design --- .../Atomic/Atoms/Selectors/RadioButton.swift | 19 +++++++++++-------- .../Atoms/Selectors/RadioButtonModel.swift | 6 ++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift index 1854f943..e3b3a2c0 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift @@ -7,14 +7,14 @@ // import UIKit - +import VDSColorTokens @objcMembers open class RadioButton: Control, MFButtonProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- - public var diameter: CGFloat = 30 { + public var diameter: CGFloat = 20 { didSet { widthConstraint?.constant = diameter } } @@ -24,9 +24,12 @@ import UIKit updateAccessibilityLabel() } } - - public var enabledColor: UIColor = .mvmBlack - public var disabledColor: UIColor = .mvmCoolGray3 + public var enabledColor: UIColor { + return radioModel?.inverted ?? false ? VDSColor.elementsPrimaryOndark : VDSColor.elementsPrimaryOnlight + } + public var disabledColor: UIColor { + return radioModel?.inverted ?? false ? VDSColor.interactiveDisabledOndark : VDSColor.interactiveDisabledOnlight + } public var delegateObject: MVMCoreUIDelegateObject? var additionalData: [AnyHashable: Any]? @@ -141,9 +144,9 @@ import UIKit open override func setupView() { super.setupView() - backgroundColor = .mvmWhite + backgroundColor = .clear clipsToBounds = true - widthConstraint = widthAnchor.constraint(equalToConstant: 30) + widthConstraint = widthAnchor.constraint(equalToConstant: 20) widthConstraint?.isActive = true heightConstraint = heightAnchor.constraint(equalTo: widthAnchor, multiplier: 1) heightConstraint?.isActive = true @@ -169,6 +172,6 @@ import UIKit public override func reset() { super.reset() - backgroundColor = .mvmWhite + backgroundColor = .clear } } diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButtonModel.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButtonModel.swift index 8db46032..86eb36e9 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButtonModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButtonModel.swift @@ -28,6 +28,7 @@ open class RadioButtonModel: MoleculeModelProtocol, FormFieldProtocol { public var groupName: String = FormValidator.defaultGroupName public var fieldKey: String? public var action: ActionModelProtocol? + public var inverted: Bool = false //-------------------------------------------------- // MARK: - Keys @@ -44,6 +45,7 @@ open class RadioButtonModel: MoleculeModelProtocol, FormFieldProtocol { case groupName case action case readOnly + case inverted } //-------------------------------------------------- @@ -94,6 +96,9 @@ open class RadioButtonModel: MoleculeModelProtocol, FormFieldProtocol { } fieldValue = try typeContainer.decodeIfPresent(String.self, forKey: .fieldValue) action = try typeContainer.decodeModelIfPresent(codingKey: .action) + if let inverted = try typeContainer.decodeIfPresent(Bool.self, forKey: .inverted) { + self.inverted = inverted + } } public func encode(to encoder: Encoder) throws { @@ -108,5 +113,6 @@ open class RadioButtonModel: MoleculeModelProtocol, FormFieldProtocol { try container.encodeIfPresent(groupName, forKey: .groupName) try container.encodeIfPresent(fieldValue, forKey: .fieldValue) try container.encodeModelIfPresent(action, forKey: .action) + try container.encodeIfPresent(inverted, forKey: .inverted) } } From 747f951b1b298d5241b58b8e96c79f54e455743d Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Wed, 3 Aug 2022 23:11:45 +0530 Subject: [PATCH 4/7] Updating the border color for radio button --- MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift index e3b3a2c0..1f82a63c 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift @@ -8,6 +8,7 @@ import UIKit import VDSColorTokens +import VDSFormControlsTokens @objcMembers open class RadioButton: Control, MFButtonProtocol { //-------------------------------------------------- @@ -25,7 +26,7 @@ import VDSColorTokens } } public var enabledColor: UIColor { - return radioModel?.inverted ?? false ? VDSColor.elementsPrimaryOndark : VDSColor.elementsPrimaryOnlight + return radioModel?.inverted ?? false ? VDSFormControlsColor.borderOndark : VDSFormControlsColor.borderOnlight } public var disabledColor: UIColor { return radioModel?.inverted ?? false ? VDSColor.interactiveDisabledOndark : VDSColor.interactiveDisabledOnlight From 8ec7669bba969e42296224efeb3f7982d1f0d355 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Wed, 3 Aug 2022 23:47:49 +0530 Subject: [PATCH 5/7] Updating the font style for nav bar title --- .../NavigationController/UINavigationController+Extension.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift b/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift index e1c7f6a3..e63028d4 100644 --- a/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift +++ b/MVMCoreUI/Containers/NavigationController/UINavigationController+Extension.swift @@ -66,7 +66,7 @@ public extension UINavigationController { /// Convenience function for setting the navigation bar ui func setNavigationBarUI(with model: NavigationItemModelProtocol) { let navigationBar = navigationBar - let font = MFStyler.fontBoldBodyLarge(false) + let font = Styler.Font.BoldTitleSmall.getFont(false) let backgroundColor = model.backgroundColor?.uiColor let tint = model.tintColor.uiColor navigationBar.tintColor = tint From d1b1db196731efe482254b170835f81cc87cfe89 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Thu, 4 Aug 2022 22:19:20 +0530 Subject: [PATCH 6/7] Updating logic to read style params from context, JSON and default --- MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift index 7c6f9ef6..3c702d49 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift @@ -206,15 +206,14 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat title = try typeContainer.decode(String.self, forKey: .title) action = try typeContainer.decodeModel(codingKey: .action) + ///Reading the style param from context which is set is molecules, ex: TwoButtonView if let style = decoder.context?.value(forKey: CodingKeys.style.stringValue) as? Styler.Button.Style{ self.style = style setFacade(by: style) - } - - if let style = try typeContainer.decodeIfPresent(Styler.Button.Style.self, forKey: .style) { + } else if let style = try typeContainer.decodeIfPresent(Styler.Button.Style.self, forKey: .style) { ///Style captured from the JSON self.style = style setFacade(by: style) - } else { + } else { ///Default style setFacade(by: .primary) } From 4f4d9a126e331f5ed54cf7f85c992d49342ee612 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Fri, 5 Aug 2022 22:02:47 +0530 Subject: [PATCH 7/7] Reordering the conditions for button style update. --- MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift index 3c702d49..4f4801c6 100644 --- a/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Buttons/ButtonModel.swift @@ -206,11 +206,11 @@ open class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupWat title = try typeContainer.decode(String.self, forKey: .title) action = try typeContainer.decodeModel(codingKey: .action) - ///Reading the style param from context which is set is molecules, ex: TwoButtonView - if let style = decoder.context?.value(forKey: CodingKeys.style.stringValue) as? Styler.Button.Style{ + ///Style captured from the JSON + if let style = try typeContainer.decodeIfPresent(Styler.Button.Style.self, forKey: .style){ self.style = style setFacade(by: style) - } else if let style = try typeContainer.decodeIfPresent(Styler.Button.Style.self, forKey: .style) { ///Style captured from the JSON + } else if let style = decoder.context?.value(forKey: CodingKeys.style.stringValue) as? Styler.Button.Style { ///Reading the style param from context which is set is molecules, ex: TwoButtonView self.style = style setFacade(by: style) } else { ///Default style