arrow and component fix and cleanup.

This commit is contained in:
Kevin G Christiano 2020-08-24 16:45:02 -04:00
parent 08bcd545a2
commit 906fcf9d01
61 changed files with 155 additions and 118 deletions

View File

@ -164,5 +164,6 @@ open class Arrow: View {
guard let model = model as? ArrowModel else { return } guard let model = model as? ArrowModel else { return }
isEnabled = model.enabled isEnabled = model.enabled
pinHeightAndWidth(constant: max(model.height, model.width))
} }
} }

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers public class ListFourColumnDataUsageListItem: TableViewCell { @objcMembers public class ListFourColumnDataUsageListItem: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
@ -19,7 +17,7 @@ import Foundation
let label2 = Label(fontStyle: .RegularBodySmall) let label2 = Label(fontStyle: .RegularBodySmall)
let label3 = Label(fontStyle: .RegularBodySmall) let label3 = Label(fontStyle: .RegularBodySmall)
let label4 = Label(fontStyle: .RegularBodySmall) let label4 = Label(fontStyle: .RegularBodySmall)
let arrow = Arrow(frame: .zero) let arrow = Arrow()
let arrowAndLabel2Stack: Stack<StackModel> let arrowAndLabel2Stack: Stack<StackModel>
//----------------------------------------------------- //-----------------------------------------------------
@ -90,6 +88,7 @@ import Foundation
//----------------------------------------------------- //-----------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListFourColumnDataUsageListItemModel: ListItemModel, MoleculeModelProtocol { public class ListFourColumnDataUsageListItemModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListLeftVariableCheckboxAllTextAndLinks: TableViewCell { @objcMembers open class ListLeftVariableCheckboxAllTextAndLinks: TableViewCell {
//-------------------------------------------------- //--------------------------------------------------
@ -55,6 +53,7 @@ import Foundation
observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in
self?.updateAccessibilityLabel() self?.updateAccessibilityLabel()
} }
updateAccessibilityLabel() updateAccessibilityLabel()
} }

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
open class ListLeftVariableCheckboxAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { open class ListLeftVariableCheckboxAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------
@ -17,6 +15,7 @@ open class ListLeftVariableCheckboxAllTextAndLinksModel: ListItemModel, Molecule
open class var identifier: String { open class var identifier: String {
return "listLVCB" return "listLVCB"
} }
public var checkbox: CheckboxModel public var checkbox: CheckboxModel
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListLeftVariableCheckboxBodyText: TableViewCell { @objcMembers open class ListLeftVariableCheckboxBodyText: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
@ -55,6 +53,7 @@ import Foundation
observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in
self?.updateAccessibilityLabel() self?.updateAccessibilityLabel()
} }
updateAccessibilityLabel() updateAccessibilityLabel()
} }

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
open class ListLeftVariableCheckboxBodyTextModel: ListItemModel, MoleculeModelProtocol { open class ListLeftVariableCheckboxBodyTextModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------
@ -21,6 +19,7 @@ open class ListLeftVariableCheckboxBodyTextModel: ListItemModel, MoleculeModelPr
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initializer // MARK: - Initializer
//-------------------------------------------------- //--------------------------------------------------
public init(checkbox: CheckboxModel, headlineBody: HeadlineBodyModel) { public init(checkbox: CheckboxModel, headlineBody: HeadlineBodyModel) {
self.checkbox = checkbox self.checkbox = checkbox
self.headlineBody = headlineBody self.headlineBody = headlineBody

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListLeftVariableIconAllTextLinks: TableViewCell { @objcMembers open class ListLeftVariableIconAllTextLinks: TableViewCell {
//-------------------------------------------------- //--------------------------------------------------
@ -63,12 +61,15 @@ import Foundation
} }
func getAccessibilityMessage() -> String? { func getAccessibilityMessage() -> String? {
guard let leftImageLabel = leftImage.imageView.accessibilityLabel else { guard let leftImageLabel = leftImage.imageView.accessibilityLabel else {
return eyebrowHeadlineBodyLink.getAccessibilityMessage() return eyebrowHeadlineBodyLink.getAccessibilityMessage()
} }
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
return leftImageLabel return leftImageLabel
} }
return leftImageLabel + ", " + label return leftImageLabel + ", " + label
} }
@ -76,7 +77,8 @@ import Foundation
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
isAccessibilityElement = !linkShowing isAccessibilityElement = !linkShowing
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
if !linkShowing { if !linkShowing {
// Make whole cell focusable if no link. // Make whole cell focusable if no link.
accessibilityLabel = getAccessibilityMessage() accessibilityLabel = getAccessibilityMessage()
@ -87,12 +89,15 @@ import Foundation
} else { } else {
// Only link. Manually add accessibility elements to ensure they are read in the right order. // Only link. Manually add accessibility elements to ensure they are read in the right order.
var elements: [Any] = [] var elements: [Any] = []
if let leftImageLabel = leftImage.imageView.accessibilityLabel, !leftImageLabel.isEmpty { if let leftImageLabel = leftImage.imageView.accessibilityLabel, !leftImageLabel.isEmpty {
elements.append(leftImage.imageView) elements.append(leftImage.imageView)
} }
if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() { if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() {
elements.append(otherElements) elements.append(otherElements)
} }
accessibilityElements = elements accessibilityElements = elements
} }
} }

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListLeftVariableIconAllTextLinksModel: ListItemModel, MoleculeModelProtocol { public class ListLeftVariableIconAllTextLinksModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import UIKit
@objcMembers open class ListLeftVariableIconWithRightCaret: TableViewCell { @objcMembers open class ListLeftVariableIconWithRightCaret: TableViewCell {
//-------------------------------------------------- //--------------------------------------------------
@ -76,6 +74,7 @@ import UIKit
} }
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListLeftVariableIconWithRightCaretBodyText: TableViewCell { @objcMembers open class ListLeftVariableIconWithRightCaretBodyText: TableViewCell {
//-------------------------------------------------- //--------------------------------------------------
@ -91,6 +89,7 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListLeftVariableIconWithRightCaretBodyTextModel: ListItemModel, MoleculeModelProtocol { public class ListLeftVariableIconWithRightCaretBodyTextModel: ListItemModel, MoleculeModelProtocol {
//----------------------------------------------------- //-----------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListLeftVariableIconWithRightCaretModel: ListItemModel, MoleculeModelProtocol { public class ListLeftVariableIconWithRightCaretModel: ListItemModel, MoleculeModelProtocol {
//----------------------------------------------------- //-----------------------------------------------------

View File

@ -6,15 +6,14 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListLeftVariableNumberedListAllTextAndLinks: TableViewCell { @objcMembers open class ListLeftVariableNumberedListAllTextAndLinks: TableViewCell {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Outlets // MARK: - Outlets
//----------------------------------------------------- //-----------------------------------------------------
public let leftLabel = Label(fontStyle: .Title2XLarge) public let leftLabel = Label(fontStyle: .Title2XLarge)
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero) public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink()
public var stack: Stack<StackModel> public var stack: Stack<StackModel>
//-------------------------------------------------- //--------------------------------------------------
@ -72,12 +71,15 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
func getAccessibilityMessage() -> String? { func getAccessibilityMessage() -> String? {
guard let leftLabel = leftLabel.text else { guard let leftLabel = leftLabel.text else {
return eyebrowHeadlineBodyLink.getAccessibilityMessage() return eyebrowHeadlineBodyLink.getAccessibilityMessage()
} }
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
return leftLabel return leftLabel
} }
return leftLabel + ", " + label return leftLabel + ", " + label
} }
@ -86,6 +88,7 @@ import Foundation
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
isAccessibilityElement = !linkShowing isAccessibilityElement = !linkShowing
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
if !linkShowing { if !linkShowing {
// Make whole cell focusable if no link. // Make whole cell focusable if no link.
accessibilityLabel = getAccessibilityMessage() accessibilityLabel = getAccessibilityMessage()
@ -96,12 +99,15 @@ import Foundation
} else { } else {
// Only link. Manually add accessibility elements to ensure they are read in the right order. // Only link. Manually add accessibility elements to ensure they are read in the right order.
var elements: [Any] = [] var elements: [Any] = []
if let leftLabelText = leftLabel.text, !leftLabelText.isEmpty { if let leftLabelText = leftLabel.text, !leftLabelText.isEmpty {
elements.append(leftLabel) elements.append(leftLabel)
} }
if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() { if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() {
elements.append(otherElements) elements.append(otherElements)
} }
accessibilityElements = elements accessibilityElements = elements
} }
} }

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListLeftVariableNumberedListAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { public class ListLeftVariableNumberedListAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
//----------------------------------------------------- //-----------------------------------------------------

View File

@ -6,12 +6,12 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListLeftVariableNumberedListBodyText: TableViewCell { @objcMembers open class ListLeftVariableNumberedListBodyText: TableViewCell {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Outlets // MARK: - Outlets
//----------------------------------------------------- //----------------------------------------------------
public let leftLabel = Label(fontStyle: .Title2XLarge) public let leftLabel = Label(fontStyle: .Title2XLarge)
public let headlineBody = HeadlineBody() public let headlineBody = HeadlineBody()
public var stack: Stack<StackModel> public var stack: Stack<StackModel>

View File

@ -6,7 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListLeftVariableNumberedListBodyTextModel: ListItemModel, MoleculeModelProtocol { public class ListLeftVariableNumberedListBodyTextModel: ListItemModel, MoleculeModelProtocol {
//----------------------------------------------------- //-----------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListLeftVariableRadioButtonAllTextAndLinks: TableViewCell { @objcMembers open class ListLeftVariableRadioButtonAllTextAndLinks: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
open class ListLeftVariableRadioButtonAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { open class ListLeftVariableRadioButtonAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -57,6 +57,7 @@ import UIKit
observation = observe(\.radioButton.isSelected, options: [.new]) { [weak self] _, _ in observation = observe(\.radioButton.isSelected, options: [.new]) { [weak self] _, _ in
self?.updateAccessibilityLabel() self?.updateAccessibilityLabel()
} }
updateAccessibilityLabel() updateAccessibilityLabel()
} }

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListLeftVariableRadioButtonAndPaymentMethodModel: ListItemModel, MoleculeModelProtocol { public class ListLeftVariableRadioButtonAndPaymentMethodModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import UIKit
open class ListLeftVariableRadioButtonBodyText: TableViewCell { open class ListLeftVariableRadioButtonBodyText: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
open class ListLeftVariableRadioButtonBodyTextModel: ListItemModel, MoleculeModelProtocol { open class ListLeftVariableRadioButtonBodyTextModel: ListItemModel, MoleculeModelProtocol {
//----------------------------------------------------- //-----------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListProgressBarThin: TableViewCell { @objcMembers open class ListProgressBarThin: TableViewCell {
//-------------------------------------------------- //--------------------------------------------------
@ -113,6 +111,7 @@ import Foundation
//------------------------------------------------------ //------------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListProgressBarThinModel: ListItemModel, MoleculeModelProtocol { public class ListProgressBarThinModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,10 +6,12 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListRVWheel: TableViewCell { @objcMembers open class ListRVWheel: TableViewCell {
//-----------------------------------------------------
// MARK: - Properties
//-----------------------------------------------------
let wheel = Wheel(frame: .zero) let wheel = Wheel(frame: .zero)
let leftLabel = Label(fontStyle: .BoldBodySmall) let leftLabel = Label(fontStyle: .BoldBodySmall)
let rightLabel = Label(fontStyle: .RegularBodySmall) let rightLabel = Label(fontStyle: .RegularBodySmall)

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListRVWheelModel: ListItemModel, MoleculeModelProtocol { public class ListRVWheelModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListRightVariableButtonAllTextAndLinks: TableViewCell { @objcMembers open class ListRightVariableButtonAllTextAndLinks: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
@ -75,17 +73,22 @@ import Foundation
//---------------------------------------------------- //----------------------------------------------------
func getAccessibilityMessage() -> String? { func getAccessibilityMessage() -> String? {
guard let buttonText = button.titleLabel?.text else { guard let buttonText = button.titleLabel?.text else {
return eyebrowHeadlineBodyLink.getAccessibilityMessage() return eyebrowHeadlineBodyLink.getAccessibilityMessage()
} }
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
return buttonText return buttonText
} }
return label + ", " + buttonText return label + ", " + buttonText
} }
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
if !linkShowing && accessoryView == nil { if !linkShowing && accessoryView == nil {
// Make whole cell focusable if one action // Make whole cell focusable if one action
isAccessibilityElement = true isAccessibilityElement = true
@ -94,16 +97,20 @@ import Foundation
// Make buttons focusable. // Make buttons focusable.
isAccessibilityElement = false isAccessibilityElement = false
var elements: [Any] = [] var elements: [Any] = []
if let accessoryView = accessoryView { if let accessoryView = accessoryView {
accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage() accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage()
elements.append(accessoryView) elements.append(accessoryView)
} else { } else {
button.accessibilityLabel = getAccessibilityMessage() button.accessibilityLabel = getAccessibilityMessage()
} }
elements.append(button) elements.append(button)
if linkShowing { if linkShowing {
elements.append(eyebrowHeadlineBodyLink.link) elements.append(eyebrowHeadlineBodyLink.link)
} }
accessibilityElements = elements accessibilityElements = elements
} }
} }

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListRightVariableButtonAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { public class ListRightVariableButtonAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,13 +6,12 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListRightVariablePayments: TableViewCell { @objcMembers open class ListRightVariablePayments: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
// MARK: - Outlets // MARK: - Outlets
//------------------------------------------------------- //-------------------------------------------------------
let leftLabel = Label(fontStyle: .BoldBodySmall) let leftLabel = Label(fontStyle: .BoldBodySmall)
let rightImage = LoadImageView(pinnedEdges: .all) let rightImage = LoadImageView(pinnedEdges: .all)
var stack: Stack<StackModel> var stack: Stack<StackModel>
@ -20,6 +19,7 @@ import Foundation
//----------------------------------------------------- //-----------------------------------------------------
// MARK: - Initializers // MARK: - Initializers
//----------------------------------------------------- //-----------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .leading)), stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .leading)),
(view: rightImage, model: StackItemModel(horizontalAlignment: .fill))], (view: rightImage, model: StackItemModel(horizontalAlignment: .fill))],
@ -70,6 +70,7 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListRightVariablePaymentsModel: ListItemModel, MoleculeModelProtocol { public class ListRightVariablePaymentsModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListRightVariablePriceChangeAllTextAndLinks: TableViewCell { @objcMembers open class ListRightVariablePriceChangeAllTextAndLinks: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
@ -88,19 +86,24 @@ import Foundation
// MARK: - Accessibility // MARK: - Accessibility
//-------------------------------------------------- //--------------------------------------------------
func getAccessibilityMessage() -> String? { func getAccessibilityMessage() -> String? {
guard let rightLabelText = rightLabel.text else { guard let rightLabelText = rightLabel.text else {
return eyebrowHeadlineBodyLink.getAccessibilityMessage() return eyebrowHeadlineBodyLink.getAccessibilityMessage()
} }
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
return rightLabelText return rightLabelText
} }
return label + ", " + rightLabelText return label + ", " + rightLabelText
} }
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
isAccessibilityElement = !linkShowing isAccessibilityElement = !linkShowing
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
if !linkShowing { if !linkShowing {
// Make whole cell focusable if no link. // Make whole cell focusable if no link.
accessibilityLabel = getAccessibilityMessage() accessibilityLabel = getAccessibilityMessage()
@ -111,12 +114,15 @@ import Foundation
} else { } else {
// Only link. Manually add accessibility elements to ensure they are read in the right order. // Only link. Manually add accessibility elements to ensure they are read in the right order.
var elements: [Any] = [] var elements: [Any] = []
if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() { if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() {
elements.append(otherElements) elements.append(otherElements)
} }
if let rightLabelText = rightLabel.text, !rightLabelText.isEmpty { if let rightLabelText = rightLabel.text, !rightLabelText.isEmpty {
elements.append(rightLabel) elements.append(rightLabel)
} }
accessibilityElements = elements accessibilityElements = elements
} }
} }

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListRightVariablePriceChangeAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { public class ListRightVariablePriceChangeAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListRightVariablePriceChangeBodyText: TableViewCell { @objcMembers open class ListRightVariablePriceChangeBodyText: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
@ -85,6 +83,7 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeModelProtocol { public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,12 +6,12 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListRightVariableRightCaretAllTextAndLinks: TableViewCell { @objcMembers open class ListRightVariableRightCaretAllTextAndLinks: TableViewCell {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Outlets // MARK: - Outlets
//-------------------------------------------------- //--------------------------------------------------
public let rightLabel = Label(fontStyle: .RegularBodySmall) public let rightLabel = Label(fontStyle: .RegularBodySmall)
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink() public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink()
public var stack: Stack<StackModel> public var stack: Stack<StackModel>
@ -19,6 +19,7 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initializers // MARK: - Initializers
//-------------------------------------------------- //--------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: eyebrowHeadlineBodyLink, model: StackItemModel(horizontalAlignment: .leading, verticalAlignment: .top)), (view: rightLabel, model: StackItemModel(horizontalAlignment:.fill))], axis: .horizontal) stack = Stack<StackModel>.createStack(with: [(view: eyebrowHeadlineBodyLink, model: StackItemModel(horizontalAlignment: .leading, verticalAlignment: .top)), (view: rightLabel, model: StackItemModel(horizontalAlignment:.fill))], axis: .horizontal)
super.init(style: style, reuseIdentifier: reuseIdentifier) super.init(style: style, reuseIdentifier: reuseIdentifier)
@ -31,6 +32,7 @@ import Foundation
//----------------------------------------------------- //-----------------------------------------------------
// MARK: - Lifecycle // MARK: - Lifecycle
//----------------------------------------------------- //-----------------------------------------------------
open override func setupView() { open override func setupView() {
super.setupView() super.setupView()
rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal) rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal)
@ -54,9 +56,12 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Molecular // MARK: - Molecular
//-------------------------------------------------- //--------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData) super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListRightVariableRightCaretAllTextAndLinksModel else { return } guard let model = model as? ListRightVariableRightCaretAllTextAndLinksModel else { return }
rightLabel.set(with: model.rightLabel, delegateObject, additionalData) rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
updateAccessibilityLabel() updateAccessibilityLabel()
@ -75,19 +80,24 @@ import Foundation
// MARK: - Accessibility // MARK: - Accessibility
//-------------------------------------------------- //--------------------------------------------------
func getAccessibilityMessage() -> String? { func getAccessibilityMessage() -> String? {
guard let rightLabelText = rightLabel.text else { guard let rightLabelText = rightLabel.text else {
return eyebrowHeadlineBodyLink.getAccessibilityMessage() return eyebrowHeadlineBodyLink.getAccessibilityMessage()
} }
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
return rightLabelText return rightLabelText
} }
return label + ", " + rightLabelText return label + ", " + rightLabelText
} }
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
isAccessibilityElement = !linkShowing isAccessibilityElement = !linkShowing
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
if !linkShowing { if !linkShowing {
// Make whole cell focusable if no link. // Make whole cell focusable if no link.
accessibilityLabel = getAccessibilityMessage() accessibilityLabel = getAccessibilityMessage()
@ -98,12 +108,15 @@ import Foundation
} else { } else {
// Only link. Manually add accessibility elements to ensure they are read in the right order. // Only link. Manually add accessibility elements to ensure they are read in the right order.
var elements: [Any] = [] var elements: [Any] = []
if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() { if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() {
elements.append(otherElements) elements.append(otherElements)
} }
if let rightLabelText = rightLabel.text, !rightLabelText.isEmpty { if let rightLabelText = rightLabel.text, !rightLabelText.isEmpty {
elements.append(rightLabel) elements.append(rightLabel)
} }
accessibilityElements = elements accessibilityElements = elements
} }
} }

View File

@ -6,13 +6,12 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListRightVariableRightCaretAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { public class ListRightVariableRightCaretAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Properties // MARK: - Properties
//-------------------------------------------------- //--------------------------------------------------
public static var identifier: String = "listRVCaretAll" public static var identifier: String = "listRVCaretAll"
public var rightLabel: LabelModel public var rightLabel: LabelModel
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
@ -20,6 +19,7 @@ public class ListRightVariableRightCaretAllTextAndLinksModel: ListItemModel, Mol
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initializer // MARK: - Initializer
//-------------------------------------------------- //--------------------------------------------------
public init(rightLabel: LabelModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) { public init(rightLabel: LabelModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) {
self.rightLabel = rightLabel self.rightLabel = rightLabel
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
@ -29,6 +29,7 @@ public class ListRightVariableRightCaretAllTextAndLinksModel: ListItemModel, Mol
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Keys // MARK: - Keys
//-------------------------------------------------- //--------------------------------------------------
private enum CodingKeys: String, CodingKey { private enum CodingKeys: String, CodingKey {
case moleculeName case moleculeName
case rightLabel case rightLabel
@ -38,6 +39,7 @@ public class ListRightVariableRightCaretAllTextAndLinksModel: ListItemModel, Mol
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Codec // MARK: - Codec
//-------------------------------------------------- //--------------------------------------------------
required public init(from decoder: Decoder) throws { required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self) let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel) rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel)

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListRightVariableTextLinkAllTextAndLinks: TableViewCell { @objcMembers open class ListRightVariableTextLinkAllTextAndLinks: TableViewCell {
//-------------------------------------------------- //--------------------------------------------------
@ -72,18 +70,23 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
func getAccessibilityMessage() -> String? { func getAccessibilityMessage() -> String? {
guard let linkText = link.titleLabel?.text else { guard let linkText = link.titleLabel?.text else {
return eyebrowHeadlineBodyLink.getAccessibilityMessage() return eyebrowHeadlineBodyLink.getAccessibilityMessage()
} }
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
return linkText return linkText
} }
return label + ", " + linkText return label + ", " + linkText
} }
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
accessibilityTraits = .button accessibilityTraits = .button
if !linkShowing && accessoryView == nil { if !linkShowing && accessoryView == nil {
// Make whole cell focusable if one action // Make whole cell focusable if one action
isAccessibilityElement = true isAccessibilityElement = true
@ -92,16 +95,20 @@ import Foundation
// Make buttons focusable. // Make buttons focusable.
isAccessibilityElement = false isAccessibilityElement = false
var elements: [Any] = [] var elements: [Any] = []
if let accessoryView = accessoryView { if let accessoryView = accessoryView {
accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage() accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage()
elements.append(accessoryView) elements.append(accessoryView)
} else { } else {
link.accessibilityLabel = getAccessibilityMessage() link.accessibilityLabel = getAccessibilityMessage()
} }
elements.append(link) elements.append(link)
if linkShowing { if linkShowing {
elements.append(eyebrowHeadlineBodyLink.link) elements.append(eyebrowHeadlineBodyLink.link)
} }
accessibilityElements = elements accessibilityElements = elements
} }
} }

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListRightVariableTextLinkAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { public class ListRightVariableTextLinkAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,7 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListRightVariableToggleAllTextAndLinks: TableViewCell { @objcMembers open class ListRightVariableToggleAllTextAndLinks: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
@ -54,7 +53,9 @@ import Foundation
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData) super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListRightVariableToggleAllTextAndLinksModel else { return } guard let model = model as? ListRightVariableToggleAllTextAndLinksModel else { return }
toggle.set(with: model.toggle, delegateObject, additionalData) toggle.set(with: model.toggle, delegateObject, additionalData)
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData) eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
updateAccessibilityLabel() updateAccessibilityLabel()
@ -69,20 +70,25 @@ import Foundation
//---------------------------------------------------- //----------------------------------------------------
func getAccessibilityMessage() -> String? { func getAccessibilityMessage() -> String? {
guard let toggleMessage = toggle.accessibilityLabel else { guard let toggleMessage = toggle.accessibilityLabel else {
return eyebrowHeadlineBodyLink.getAccessibilityMessage() return eyebrowHeadlineBodyLink.getAccessibilityMessage()
} }
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else { guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
return toggleMessage return toggleMessage
} }
return label + ", " + toggleMessage return label + ", " + toggleMessage
} }
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
accessibilityHint = toggle.accessibilityHint accessibilityHint = toggle.accessibilityHint
accessibilityTraits = toggle.accessibilityTraits accessibilityTraits = toggle.accessibilityTraits
accessibilityValue = toggle.accessibilityValue accessibilityValue = toggle.accessibilityValue
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0 let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
if !linkShowing && accessoryView == nil { if !linkShowing && accessoryView == nil {
// Make whole cell focusable if one action // Make whole cell focusable if one action
isAccessibilityElement = true isAccessibilityElement = true
@ -91,6 +97,7 @@ import Foundation
// Make buttons focusable. // Make buttons focusable.
isAccessibilityElement = false isAccessibilityElement = false
var elements: [Any] = [] var elements: [Any] = []
if let accessoryView = accessoryView { if let accessoryView = accessoryView {
accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage() accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage()
elements.append(accessoryView) elements.append(accessoryView)
@ -102,6 +109,7 @@ import Foundation
if linkShowing { if linkShowing {
elements.append(eyebrowHeadlineBodyLink.link) elements.append(eyebrowHeadlineBodyLink.link)
} }
accessibilityElements = elements accessibilityElements = elements
} }
} }

View File

@ -6,7 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListRightVariableToggleAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol { public class ListRightVariableToggleAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListRightVariableTotalData: TableViewCell { @objcMembers open class ListRightVariableTotalData: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
@ -84,6 +82,7 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtocol { public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------
@ -27,6 +25,7 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc
super.setDefaults() super.setDefaults()
rightLabel.hero = 0 rightLabel.hero = 0
bar.type = .heavy bar.type = .heavy
if bar.backgroundColor == nil { if bar.backgroundColor == nil {
bar.backgroundColor = Color(uiColor: .mvmBlue) bar.backgroundColor = Color(uiColor: .mvmBlue)
} }

View File

@ -6,12 +6,12 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListThreeColumnBillChanges: TableViewCell { @objcMembers open class ListThreeColumnBillChanges: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
// MARK: - Outlets // MARK: - Outlets
//------------------------------------------------------- //-------------------------------------------------------
public let leftLabel = Label(fontStyle: .RegularBodySmall) public let leftLabel = Label(fontStyle: .RegularBodySmall)
public let centerLabel = Label(fontStyle: .RegularBodySmall) public let centerLabel = Label(fontStyle: .RegularBodySmall)
public let rightLabel = Label(fontStyle: .RegularBodySmall) public let rightLabel = Label(fontStyle: .RegularBodySmall)
@ -75,6 +75,7 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""

View File

@ -6,7 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListThreeColumnBillChangesModel: ListItemModel, MoleculeModelProtocol { public class ListThreeColumnBillChangesModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,12 +6,12 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListThreeColumnBillHistory: TableViewCell { @objcMembers open class ListThreeColumnBillHistory: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
// MARK: - Outlets // MARK: - Outlets
//------------------------------------------------------- //-------------------------------------------------------
public let leftLabel = Label(fontStyle: .RegularBodySmall) public let leftLabel = Label(fontStyle: .RegularBodySmall)
public let centerLabel = Label(fontStyle: .RegularBodySmall) public let centerLabel = Label(fontStyle: .RegularBodySmall)
public let rightLabel = Label(fontStyle: .RegularBodySmall) public let rightLabel = Label(fontStyle: .RegularBodySmall)
@ -35,6 +35,7 @@ import Foundation
//------------------------------------------------------ //------------------------------------------------------
// MARK: - Lifecycle // MARK: - Lifecycle
//------------------------------------------------------ //------------------------------------------------------
open override func setupView() { open override func setupView() {
super.setupView() super.setupView()
addMolecule(stack) addMolecule(stack)
@ -44,6 +45,7 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
// MARK: - ModelMoleculeViewProtocol // MARK: - ModelMoleculeViewProtocol
//-------------------------------------------------- //--------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData) super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListThreeColumnBillHistoryModel else { return } guard let model = model as? ListThreeColumnBillHistoryModel else { return }
@ -67,18 +69,24 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Accessibility // MARK: - Accessibility
//-------------------------------------------------- //--------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""
if let leftText = leftLabel.text, !leftText.isEmpty { if let leftText = leftLabel.text, !leftText.isEmpty {
message += leftText + ", " message += leftText + ", "
} }
if let centerText = centerLabel.text, !centerText.isEmpty { if let centerText = centerLabel.text, !centerText.isEmpty {
message += centerText + ", " message += centerText + ", "
} }
if let rightText = rightLabel.text, !rightText.isEmpty { if let rightText = rightLabel.text, !rightText.isEmpty {
message += rightText message += rightText
} }
accessibilityLabel = message accessibilityLabel = message
} }
} }

View File

@ -6,12 +6,12 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListThreeColumnBillHistoryModel: ListItemModel, MoleculeModelProtocol { public class ListThreeColumnBillHistoryModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Properties // MARK: - Properties
//-------------------------------------------------- //--------------------------------------------------
public static var identifier: String = "list3CBillHst" public static var identifier: String = "list3CBillHst"
public var leftLabel: LabelModel public var leftLabel: LabelModel
public var centerLabel: LabelModel public var centerLabel: LabelModel
@ -20,6 +20,7 @@ public class ListThreeColumnBillHistoryModel: ListItemModel, MoleculeModelProtoc
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initializer // MARK: - Initializer
//-------------------------------------------------- //--------------------------------------------------
public init(leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) { public init(leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) {
self.leftLabel = leftLabel self.leftLabel = leftLabel
self.centerLabel = centerLabel self.centerLabel = centerLabel
@ -30,6 +31,7 @@ public class ListThreeColumnBillHistoryModel: ListItemModel, MoleculeModelProtoc
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Keys // MARK: - Keys
//-------------------------------------------------- //--------------------------------------------------
private enum CodingKeys: String, CodingKey { private enum CodingKeys: String, CodingKey {
case moleculeName case moleculeName
case leftLabel case leftLabel
@ -40,6 +42,7 @@ public class ListThreeColumnBillHistoryModel: ListItemModel, MoleculeModelProtoc
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Codec // MARK: - Codec
//-------------------------------------------------- //--------------------------------------------------
required public init(from decoder: Decoder) throws { required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self) let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel) leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)

View File

@ -6,13 +6,12 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListThreeColumnDataUsage: TableViewCell { @objcMembers open class ListThreeColumnDataUsage: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
// MARK: - Outlets // MARK: - Outlets
//------------------------------------------------------- //-------------------------------------------------------
public let leftLabel = Label(fontStyle: .RegularBodySmall) public let leftLabel = Label(fontStyle: .RegularBodySmall)
public let centerLabel = Label(fontStyle: .RegularBodySmall) public let centerLabel = Label(fontStyle: .RegularBodySmall)
public let rightLabel = Label(fontStyle: .RegularBodySmall) public let rightLabel = Label(fontStyle: .RegularBodySmall)
@ -75,6 +74,7 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListThreeColumnDataUsageModel: ListItemModel, MoleculeModelProtocol { public class ListThreeColumnDataUsageModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers public class ListThreeColumnInternationalData: TableViewCell { @objcMembers public class ListThreeColumnInternationalData: TableViewCell {
@ -19,7 +17,7 @@ import Foundation
public let leftLabel = Label(fontStyle: .RegularBodySmall) public let leftLabel = Label(fontStyle: .RegularBodySmall)
public let centerLabel = Label(fontStyle: .RegularBodySmall) public let centerLabel = Label(fontStyle: .RegularBodySmall)
public let rightLabel = Label(fontStyle: .RegularBodySmall) public let rightLabel = Label(fontStyle: .RegularBodySmall)
public let arrow = Arrow(frame: .zero) public let arrow = Arrow()
public let arrowAndLabel2Stack: Stack<StackModel> public let arrowAndLabel2Stack: Stack<StackModel>
//----------------------------------------------------- //-----------------------------------------------------
@ -85,6 +83,7 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListThreeColumnInternationalDataModel: ListItemModel, MoleculeModelProtocol { public class ListThreeColumnInternationalDataModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,12 +6,12 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListThreeColumnSpeedTest: TableViewCell { @objcMembers open class ListThreeColumnSpeedTest: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
// MARK: - Outlets // MARK: - Outlets
//------------------------------------------------------- //-------------------------------------------------------
public var title = Label(fontStyle: .RegularMicro) public var title = Label(fontStyle: .RegularMicro)
public var topLeftHeadlineBody = HeadlineBody() public var topLeftHeadlineBody = HeadlineBody()
public var topCenterHeadlineBody = HeadlineBody() public var topCenterHeadlineBody = HeadlineBody()
@ -26,6 +26,7 @@ import Foundation
//------------------------------------------------------ //------------------------------------------------------
// MARK: - Initializers // MARK: - Initializers
//------------------------------------------------------ //------------------------------------------------------
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
topHorizontalStack = Stack<StackModel>.createStack(with: [(view: topLeftHeadlineBody, model: StackItemModel(percent: 37, verticalAlignment: .top)), (view: topCenterHeadlineBody, model: StackItemModel(percent: 33, verticalAlignment: .top)), (view: topRightHeadlineBody, model: StackItemModel(percent: 30, verticalAlignment: .top))], axis: .horizontal) topHorizontalStack = Stack<StackModel>.createStack(with: [(view: topLeftHeadlineBody, model: StackItemModel(percent: 37, verticalAlignment: .top)), (view: topCenterHeadlineBody, model: StackItemModel(percent: 33, verticalAlignment: .top)), (view: topRightHeadlineBody, model: StackItemModel(percent: 30, verticalAlignment: .top))], axis: .horizontal)
bottomHorizontalStack = Stack<StackModel>.createStack(with: [(view: bottomLeftHeadlineBody, model: StackItemModel(percent: 37, verticalAlignment: .top)), (view: bottomCenterHeadlineBody, model: StackItemModel(percent: 33, verticalAlignment: .top)), (view: bottomRightHeadlineBody, model: StackItemModel(percent: 30, verticalAlignment: .top))], axis: .horizontal) bottomHorizontalStack = Stack<StackModel>.createStack(with: [(view: bottomLeftHeadlineBody, model: StackItemModel(percent: 37, verticalAlignment: .top)), (view: bottomCenterHeadlineBody, model: StackItemModel(percent: 33, verticalAlignment: .top)), (view: bottomRightHeadlineBody, model: StackItemModel(percent: 30, verticalAlignment: .top))], axis: .horizontal)
@ -51,9 +52,12 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
// MARK: - ModelMoleculeViewProtocol // MARK: - ModelMoleculeViewProtocol
//-------------------------------------------------- //--------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData) super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListThreeColumnSpeedTestModel else { return } guard let model = model as? ListThreeColumnSpeedTestModel else { return }
title.set(with: model.title, delegateObject, additionalData) title.set(with: model.title, delegateObject, additionalData)
topHorizontalStack.updateContainedMolecules(with: [model.topLeftHeadlineBody, model.topCenterHeadlineBody, model.topRightHeadlineBody], delegateObject, additionalData) topHorizontalStack.updateContainedMolecules(with: [model.topLeftHeadlineBody, model.topCenterHeadlineBody, model.topRightHeadlineBody], delegateObject, additionalData)
bottomHorizontalStack.updateContainedMolecules(with: [model.bottomLeftHeadlineBody, model.bottomCenterHeadlineBody, model.bottomRightHeadlineBody], delegateObject, additionalData) bottomHorizontalStack.updateContainedMolecules(with: [model.bottomLeftHeadlineBody, model.bottomCenterHeadlineBody, model.bottomRightHeadlineBody], delegateObject, additionalData)
@ -78,41 +82,55 @@ import Foundation
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Accessibility // MARK: - Accessibility
//-------------------------------------------------- //--------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""
if let title = title.text, !title.isEmpty { if let title = title.text, !title.isEmpty {
message += title + ", " message += title + ", "
} }
if let topLeftHeadlineBodyText = accessibilityTextOfHeadlineBody(topLeftHeadlineBody), !topLeftHeadlineBodyText.isEmpty { if let topLeftHeadlineBodyText = accessibilityTextOfHeadlineBody(topLeftHeadlineBody), !topLeftHeadlineBodyText.isEmpty {
message += topLeftHeadlineBodyText + ", " message += topLeftHeadlineBodyText + ", "
} }
if let topCenterHeadlineBodyText = accessibilityTextOfHeadlineBody(topCenterHeadlineBody), !topCenterHeadlineBodyText.isEmpty { if let topCenterHeadlineBodyText = accessibilityTextOfHeadlineBody(topCenterHeadlineBody), !topCenterHeadlineBodyText.isEmpty {
message += topCenterHeadlineBodyText + ", " message += topCenterHeadlineBodyText + ", "
} }
if let topRightHeadlineBodyText = accessibilityTextOfHeadlineBody(topRightHeadlineBody), !topRightHeadlineBodyText.isEmpty { if let topRightHeadlineBodyText = accessibilityTextOfHeadlineBody(topRightHeadlineBody), !topRightHeadlineBodyText.isEmpty {
message += topRightHeadlineBodyText + ", " message += topRightHeadlineBodyText + ", "
} }
if let bottomLeftHeadlineBodyText = accessibilityTextOfHeadlineBody(bottomLeftHeadlineBody), !bottomLeftHeadlineBodyText.isEmpty { if let bottomLeftHeadlineBodyText = accessibilityTextOfHeadlineBody(bottomLeftHeadlineBody), !bottomLeftHeadlineBodyText.isEmpty {
message += bottomLeftHeadlineBodyText + ", " message += bottomLeftHeadlineBodyText + ", "
} }
if let bottomCenterHeadlineBodyText = accessibilityTextOfHeadlineBody(bottomCenterHeadlineBody), !bottomCenterHeadlineBodyText.isEmpty { if let bottomCenterHeadlineBodyText = accessibilityTextOfHeadlineBody(bottomCenterHeadlineBody), !bottomCenterHeadlineBodyText.isEmpty {
message += bottomCenterHeadlineBodyText + ", " message += bottomCenterHeadlineBodyText + ", "
} }
if let bottomRightHeadlineBodyText = accessibilityTextOfHeadlineBody(bottomRightHeadlineBody), !bottomRightHeadlineBodyText.isEmpty { if let bottomRightHeadlineBodyText = accessibilityTextOfHeadlineBody(bottomRightHeadlineBody), !bottomRightHeadlineBodyText.isEmpty {
message += bottomRightHeadlineBodyText message += bottomRightHeadlineBodyText
} }
accessibilityLabel = message accessibilityLabel = message
} }
func accessibilityTextOfHeadlineBody(_ headlineBody: HeadlineBody) -> String? { func accessibilityTextOfHeadlineBody(_ headlineBody: HeadlineBody) -> String? {
var message = "" var message = ""
if let headlineLabel = headlineBody.headlineLabel.text { if let headlineLabel = headlineBody.headlineLabel.text {
message += headlineLabel + ", " message += headlineLabel + ", "
} }
if let messageLabel = headlineBody.messageLabel.text { if let messageLabel = headlineBody.messageLabel.text {
message += messageLabel message += messageLabel
} }
return message return message
} }
} }

View File

@ -6,12 +6,12 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol { public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Properties // MARK: - Properties
//-------------------------------------------------- //--------------------------------------------------
public static var identifier: String = "list3CSpdTst" public static var identifier: String = "list3CSpdTst"
public var title: LabelModel public var title: LabelModel
public var topLeftHeadlineBody: HeadlineBodyModel public var topLeftHeadlineBody: HeadlineBodyModel
@ -24,6 +24,7 @@ public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initializer // MARK: - Initializer
//-------------------------------------------------- //--------------------------------------------------
public init(title: LabelModel, topLeftHeadlineBody: HeadlineBodyModel, topCenterHeadlineBody: HeadlineBodyModel, topRightHeadlineBody: HeadlineBodyModel, bottomLeftHeadlineBody: HeadlineBodyModel, bottomCenterHeadlineBody: HeadlineBodyModel, bottomRightHeadlineBody: HeadlineBodyModel) { public init(title: LabelModel, topLeftHeadlineBody: HeadlineBodyModel, topCenterHeadlineBody: HeadlineBodyModel, topRightHeadlineBody: HeadlineBodyModel, bottomLeftHeadlineBody: HeadlineBodyModel, bottomCenterHeadlineBody: HeadlineBodyModel, bottomRightHeadlineBody: HeadlineBodyModel) {
self.title = title self.title = title
self.topLeftHeadlineBody = topLeftHeadlineBody self.topLeftHeadlineBody = topLeftHeadlineBody
@ -38,6 +39,7 @@ public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol
//------------------------------------------------------ //------------------------------------------------------
// MARK: - Method // MARK: - Method
//------------------------------------------------------ //------------------------------------------------------
override public func setDefaults() { override public func setDefaults() {
styleHeadlineBody(topLeftHeadlineBody, true) styleHeadlineBody(topLeftHeadlineBody, true)
styleHeadlineBody(bottomLeftHeadlineBody, false) styleHeadlineBody(bottomLeftHeadlineBody, false)
@ -50,8 +52,10 @@ public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol
//Method to style headline and body of HeadlineBody //Method to style headline and body of HeadlineBody
func styleHeadlineBody(_ headlineBodyModel: HeadlineBodyModel, _ isBodyMicro: Bool) { func styleHeadlineBody(_ headlineBodyModel: HeadlineBodyModel, _ isBodyMicro: Bool) {
headlineBodyModel.headline?.fontStyle = .RegularMicro headlineBodyModel.headline?.fontStyle = .RegularMicro
headlineBodyModel.headline?.textColor = Color(uiColor: .mvmCoolGray6) headlineBodyModel.headline?.textColor = Color(uiColor: .mvmCoolGray6)
if isBodyMicro { if isBodyMicro {
headlineBodyModel.body?.fontStyle = .RegularMicro headlineBodyModel.body?.fontStyle = .RegularMicro
headlineBodyModel.body?.textColor = Color(uiColor: .mvmCoolGray6) headlineBodyModel.body?.textColor = Color(uiColor: .mvmCoolGray6)
@ -63,6 +67,7 @@ public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Keys // MARK: - Keys
//-------------------------------------------------- //--------------------------------------------------
private enum CodingKeys: String, CodingKey { private enum CodingKeys: String, CodingKey {
case moleculeName case moleculeName
case title case title
@ -77,6 +82,7 @@ public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Codec // MARK: - Codec
//-------------------------------------------------- //--------------------------------------------------
required public init(from decoder: Decoder) throws { required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self) let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
title = try typeContainer.decode(LabelModel.self, forKey: .title) title = try typeContainer.decode(LabelModel.self, forKey: .title)

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListTwoColumnCompareChanges: TableViewCell { @objcMembers open class ListTwoColumnCompareChanges: TableViewCell {
//------------------------------------------------------- //-------------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListTwoColumnCompareChangesModel: ListItemModel, MoleculeModelProtocol { public class ListTwoColumnCompareChangesModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers public class ListTwoColumnDropdownSelectors: TableViewCell { @objcMembers public class ListTwoColumnDropdownSelectors: TableViewCell {
//------------------------------------------------------- //-------------------------------------------------------
@ -60,4 +58,3 @@ import Foundation
return 121 return 121
} }
} }

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListTwoColumnDropdownSelectorsModel: ListItemModel, MoleculeModelProtocol { public class ListTwoColumnDropdownSelectorsModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------

View File

@ -6,13 +6,12 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
@objcMembers open class ListTwoColumnPriceDescription: TableViewCell { @objcMembers open class ListTwoColumnPriceDescription: TableViewCell {
//----------------------------------------------------- //-----------------------------------------------------
// MARK: - Outlets // MARK: - Outlets
//------------------------------------------------------- //-------------------------------------------------------
public let leftHeadline = Label(fontStyle: .BoldBodySmall) public let leftHeadline = Label(fontStyle: .BoldBodySmall)
public let leftBody = Label(fontStyle: .RegularBodySmall) public let leftBody = Label(fontStyle: .RegularBodySmall)
public let rightLabel = Label(fontStyle: .RegularBodySmall) public let rightLabel = Label(fontStyle: .RegularBodySmall)
@ -33,6 +32,7 @@ import Foundation
rightVerticalStack = UIStackView(arrangedSubviews: [rightLabel, rightSubLabel]) rightVerticalStack = UIStackView(arrangedSubviews: [rightLabel, rightSubLabel])
rightVerticalStack.axis = .vertical rightVerticalStack.axis = .vertical
rightVerticalStack.alignment = .trailing rightVerticalStack.alignment = .trailing
rightVerticalStack.setContentCompressionResistancePriority(.required, for: .horizontal)
super.init(style: style, reuseIdentifier: reuseIdentifier) super.init(style: style, reuseIdentifier: reuseIdentifier)
} }
@ -48,6 +48,16 @@ import Foundation
super.updateView(size) super.updateView(size)
leftVerticalStack.updateView(size) leftVerticalStack.updateView(size)
rightVerticalStack.updateView(size) rightVerticalStack.updateView(size)
// Resolves text layout issues found between both dynamically sized labels, number is not exact but performs as required.
if leftBody.hasText && (rightLabel.hasText || rightSubLabel.hasText) {
let padding = MFStyler.defaultHorizontalPadding(forSize: size) * 2
let maximumTextWidth = (size - (padding + Padding.Four)) * 0.9 // This percent determines available width.
// Subtracting 10 resolves issues of SE and iPad
leftBody.preferredMaxLayoutWidth = round(maximumTextWidth) - 10
} else {
leftBody.preferredMaxLayoutWidth = 0
}
} }
override open func setupView() { override open func setupView() {
@ -104,7 +114,9 @@ import Foundation
//---------------------------------------------------- //----------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""
if let leftHeadline = leftHeadline.text, !leftHeadline.isEmpty { if let leftHeadline = leftHeadline.text, !leftHeadline.isEmpty {

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListTwoColumnPriceDescriptionModel: ListItemModel, MoleculeModelProtocol { public class ListTwoColumnPriceDescriptionModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------
@ -85,6 +83,3 @@ public class ListTwoColumnPriceDescriptionModel: ListItemModel, MoleculeModelPro
try container.encode(rightSubLabel, forKey: .rightSubLabel) try container.encode(rightSubLabel, forKey: .rightSubLabel)
} }
} }

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import UIKit
@objcMembers open class ListTwoColumnPriceDetails: TableViewCell { @objcMembers open class ListTwoColumnPriceDetails: TableViewCell {
//-------------------------------------------------- //--------------------------------------------------
@ -70,6 +68,7 @@ import UIKit
//---------------------------------------------------- //----------------------------------------------------
func updateAccessibilityLabel() { func updateAccessibilityLabel() {
isAccessibilityElement = true isAccessibilityElement = true
var message = "" var message = ""

View File

@ -6,8 +6,6 @@
// Copyright © 2020 Verizon Wireless. All rights reserved. // Copyright © 2020 Verizon Wireless. All rights reserved.
// //
import Foundation
public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtocol { public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtocol {
//-------------------------------------------------- //--------------------------------------------------