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