Merge branch 'bugfix/DOPMO-153745' into 'develop'

Added accessibilityText for ListOneColumnTextWithWhitespaceDividerTall

### Summary
Accessibility fix to provide custom accessibilityText for list1CTxtDiv3

### JIRA Ticket
https://onejira.verizon.com/browse/PRODDEF-1201

Co-authored-by: Keerthy <keerthy.marakanti@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/922
This commit is contained in:
Pfeil, Scott Robert 2022-12-23 19:07:56 +00:00
commit 40ea9182dd

View File

@ -41,7 +41,6 @@ import Foundation
addMolecule(stack) addMolecule(stack)
stack.restack() stack.restack()
isAccessibilityElement = true isAccessibilityElement = true
updateAccessibilityLabel()
} }
//-------------------------------------------------- //--------------------------------------------------
@ -53,7 +52,8 @@ import Foundation
guard let model = model as? ListOneColumnTextWithWhitespaceDividerTallModel else { return } guard let model = model as? ListOneColumnTextWithWhitespaceDividerTallModel else { return }
stack.updateContainedMolecules(with: [model.headline, model.body], delegateObject, additionalData) stack.updateContainedMolecules(with: [model.headline, model.body], delegateObject, additionalData)
updateAccessibilityLabel()
updateAccessibilityLabel(model: model)
} }
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
@ -64,21 +64,22 @@ import Foundation
super.reset() super.reset()
headline.setFontStyle(.BoldTitleMedium) headline.setFontStyle(.BoldTitleMedium)
body.setFontStyle(.RegularBodySmall) body.setFontStyle(.RegularBodySmall)
accessibilityLabel = nil
} }
//---------------------------------------------------- //----------------------------------------------------
// MARK: - Accessibility // MARK: - Accessibility
//---------------------------------------------------- //----------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel(model: ListOneColumnTextWithWhitespaceDividerTallModel) {
var message = "" var message = ""
if let headlineLabel = headline.text, !headlineLabel.isEmpty { if let headlineLabel = model.headline.accessibilityText ?? headline.text, !headlineLabel.isEmpty {
message += headlineLabel + ", " message += headlineLabel + ", "
} }
if let bodyLabel = body.text, !bodyLabel.isEmpty { if let bodyLabel = model.body?.accessibilityText ?? body.text, !bodyLabel.isEmpty {
message += bodyLabel message += bodyLabel
} }