arrow and component fix and cleanup.
This commit is contained in:
parent
08bcd545a2
commit
906fcf9d01
@ -164,5 +164,6 @@ open class Arrow: View {
|
||||
guard let model = model as? ArrowModel else { return }
|
||||
|
||||
isEnabled = model.enabled
|
||||
pinHeightAndWidth(constant: max(model.height, model.width))
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers public class ListFourColumnDataUsageListItem: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
@ -19,7 +17,7 @@ import Foundation
|
||||
let label2 = Label(fontStyle: .RegularBodySmall)
|
||||
let label3 = Label(fontStyle: .RegularBodySmall)
|
||||
let label4 = Label(fontStyle: .RegularBodySmall)
|
||||
let arrow = Arrow(frame: .zero)
|
||||
let arrow = Arrow()
|
||||
let arrowAndLabel2Stack: Stack<StackModel>
|
||||
|
||||
//-----------------------------------------------------
|
||||
@ -90,6 +88,7 @@ import Foundation
|
||||
//-----------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListFourColumnDataUsageListItemModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListLeftVariableCheckboxAllTextAndLinks: TableViewCell {
|
||||
//--------------------------------------------------
|
||||
@ -55,6 +53,7 @@ import Foundation
|
||||
observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in
|
||||
self?.updateAccessibilityLabel()
|
||||
}
|
||||
|
||||
updateAccessibilityLabel()
|
||||
}
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
open class ListLeftVariableCheckboxAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
@ -17,6 +15,7 @@ open class ListLeftVariableCheckboxAllTextAndLinksModel: ListItemModel, Molecule
|
||||
open class var identifier: String {
|
||||
return "listLVCB"
|
||||
}
|
||||
|
||||
public var checkbox: CheckboxModel
|
||||
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListLeftVariableCheckboxBodyText: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
@ -55,6 +53,7 @@ import Foundation
|
||||
observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in
|
||||
self?.updateAccessibilityLabel()
|
||||
}
|
||||
|
||||
updateAccessibilityLabel()
|
||||
}
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
open class ListLeftVariableCheckboxBodyTextModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
@ -21,6 +19,7 @@ open class ListLeftVariableCheckboxBodyTextModel: ListItemModel, MoleculeModelPr
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializer
|
||||
//--------------------------------------------------
|
||||
|
||||
public init(checkbox: CheckboxModel, headlineBody: HeadlineBodyModel) {
|
||||
self.checkbox = checkbox
|
||||
self.headlineBody = headlineBody
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListLeftVariableIconAllTextLinks: TableViewCell {
|
||||
//--------------------------------------------------
|
||||
@ -63,12 +61,15 @@ import Foundation
|
||||
}
|
||||
|
||||
func getAccessibilityMessage() -> String? {
|
||||
|
||||
guard let leftImageLabel = leftImage.imageView.accessibilityLabel else {
|
||||
return eyebrowHeadlineBodyLink.getAccessibilityMessage()
|
||||
}
|
||||
|
||||
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
|
||||
return leftImageLabel
|
||||
}
|
||||
|
||||
return leftImageLabel + ", " + label
|
||||
}
|
||||
|
||||
@ -76,7 +77,8 @@ import Foundation
|
||||
|
||||
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
|
||||
isAccessibilityElement = !linkShowing
|
||||
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
|
||||
|
||||
if !linkShowing {
|
||||
// Make whole cell focusable if no link.
|
||||
accessibilityLabel = getAccessibilityMessage()
|
||||
@ -87,12 +89,15 @@ import Foundation
|
||||
} else {
|
||||
// Only link. Manually add accessibility elements to ensure they are read in the right order.
|
||||
var elements: [Any] = []
|
||||
|
||||
if let leftImageLabel = leftImage.imageView.accessibilityLabel, !leftImageLabel.isEmpty {
|
||||
elements.append(leftImage.imageView)
|
||||
}
|
||||
|
||||
if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() {
|
||||
elements.append(otherElements)
|
||||
}
|
||||
|
||||
accessibilityElements = elements
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListLeftVariableIconAllTextLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
|
||||
@objcMembers open class ListLeftVariableIconWithRightCaret: TableViewCell {
|
||||
//--------------------------------------------------
|
||||
@ -76,6 +74,7 @@ import UIKit
|
||||
}
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListLeftVariableIconWithRightCaretBodyText: TableViewCell {
|
||||
//--------------------------------------------------
|
||||
@ -91,6 +89,7 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListLeftVariableIconWithRightCaretBodyTextModel: ListItemModel, MoleculeModelProtocol {
|
||||
//-----------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListLeftVariableIconWithRightCaretModel: ListItemModel, MoleculeModelProtocol {
|
||||
//-----------------------------------------------------
|
||||
|
||||
@ -6,15 +6,14 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListLeftVariableNumberedListAllTextAndLinks: TableViewCell {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//-----------------------------------------------------
|
||||
|
||||
public let leftLabel = Label(fontStyle: .Title2XLarge)
|
||||
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero)
|
||||
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink()
|
||||
public var stack: Stack<StackModel>
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -72,12 +71,15 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
|
||||
func getAccessibilityMessage() -> String? {
|
||||
|
||||
guard let leftLabel = leftLabel.text else {
|
||||
return eyebrowHeadlineBodyLink.getAccessibilityMessage()
|
||||
}
|
||||
|
||||
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
|
||||
return leftLabel
|
||||
}
|
||||
|
||||
return leftLabel + ", " + label
|
||||
}
|
||||
|
||||
@ -86,6 +88,7 @@ import Foundation
|
||||
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
|
||||
isAccessibilityElement = !linkShowing
|
||||
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
|
||||
|
||||
if !linkShowing {
|
||||
// Make whole cell focusable if no link.
|
||||
accessibilityLabel = getAccessibilityMessage()
|
||||
@ -96,12 +99,15 @@ import Foundation
|
||||
} else {
|
||||
// Only link. Manually add accessibility elements to ensure they are read in the right order.
|
||||
var elements: [Any] = []
|
||||
|
||||
if let leftLabelText = leftLabel.text, !leftLabelText.isEmpty {
|
||||
elements.append(leftLabel)
|
||||
}
|
||||
|
||||
if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() {
|
||||
elements.append(otherElements)
|
||||
}
|
||||
|
||||
accessibilityElements = elements
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListLeftVariableNumberedListAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||
//-----------------------------------------------------
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers open class ListLeftVariableNumberedListBodyText: TableViewCell {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//-----------------------------------------------------
|
||||
//----------------------------------------------------
|
||||
|
||||
public let leftLabel = Label(fontStyle: .Title2XLarge)
|
||||
public let headlineBody = HeadlineBody()
|
||||
public var stack: Stack<StackModel>
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public class ListLeftVariableNumberedListBodyTextModel: ListItemModel, MoleculeModelProtocol {
|
||||
//-----------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListLeftVariableRadioButtonAllTextAndLinks: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
open class ListLeftVariableRadioButtonAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -57,6 +57,7 @@ import UIKit
|
||||
observation = observe(\.radioButton.isSelected, options: [.new]) { [weak self] _, _ in
|
||||
self?.updateAccessibilityLabel()
|
||||
}
|
||||
|
||||
updateAccessibilityLabel()
|
||||
}
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListLeftVariableRadioButtonAndPaymentMethodModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
|
||||
open class ListLeftVariableRadioButtonBodyText: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
open class ListLeftVariableRadioButtonBodyTextModel: ListItemModel, MoleculeModelProtocol {
|
||||
//-----------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListProgressBarThin: TableViewCell {
|
||||
//--------------------------------------------------
|
||||
@ -113,6 +111,7 @@ import Foundation
|
||||
//------------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListProgressBarThinModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,10 +6,12 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListRVWheel: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//-----------------------------------------------------
|
||||
|
||||
let wheel = Wheel(frame: .zero)
|
||||
let leftLabel = Label(fontStyle: .BoldBodySmall)
|
||||
let rightLabel = Label(fontStyle: .RegularBodySmall)
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListRVWheelModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListRightVariableButtonAllTextAndLinks: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
@ -75,17 +73,22 @@ import Foundation
|
||||
//----------------------------------------------------
|
||||
|
||||
func getAccessibilityMessage() -> String? {
|
||||
|
||||
guard let buttonText = button.titleLabel?.text else {
|
||||
return eyebrowHeadlineBodyLink.getAccessibilityMessage()
|
||||
}
|
||||
|
||||
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
|
||||
return buttonText
|
||||
}
|
||||
|
||||
return label + ", " + buttonText
|
||||
}
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
|
||||
|
||||
if !linkShowing && accessoryView == nil {
|
||||
// Make whole cell focusable if one action
|
||||
isAccessibilityElement = true
|
||||
@ -94,16 +97,20 @@ import Foundation
|
||||
// Make buttons focusable.
|
||||
isAccessibilityElement = false
|
||||
var elements: [Any] = []
|
||||
|
||||
if let accessoryView = accessoryView {
|
||||
accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage()
|
||||
elements.append(accessoryView)
|
||||
} else {
|
||||
button.accessibilityLabel = getAccessibilityMessage()
|
||||
}
|
||||
|
||||
elements.append(button)
|
||||
|
||||
if linkShowing {
|
||||
elements.append(eyebrowHeadlineBodyLink.link)
|
||||
}
|
||||
|
||||
accessibilityElements = elements
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListRightVariableButtonAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,13 +6,12 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListRightVariablePayments: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//-------------------------------------------------------
|
||||
|
||||
let leftLabel = Label(fontStyle: .BoldBodySmall)
|
||||
let rightImage = LoadImageView(pinnedEdges: .all)
|
||||
var stack: Stack<StackModel>
|
||||
@ -20,6 +19,7 @@ import Foundation
|
||||
//-----------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
//-----------------------------------------------------
|
||||
|
||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .leading)),
|
||||
(view: rightImage, model: StackItemModel(horizontalAlignment: .fill))],
|
||||
@ -70,6 +70,7 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListRightVariablePaymentsModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListRightVariablePriceChangeAllTextAndLinks: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
@ -88,19 +86,24 @@ import Foundation
|
||||
// MARK: - Accessibility
|
||||
//--------------------------------------------------
|
||||
func getAccessibilityMessage() -> String? {
|
||||
|
||||
guard let rightLabelText = rightLabel.text else {
|
||||
return eyebrowHeadlineBodyLink.getAccessibilityMessage()
|
||||
}
|
||||
|
||||
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
|
||||
return rightLabelText
|
||||
}
|
||||
|
||||
return label + ", " + rightLabelText
|
||||
}
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
|
||||
isAccessibilityElement = !linkShowing
|
||||
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
|
||||
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
|
||||
|
||||
if !linkShowing {
|
||||
// Make whole cell focusable if no link.
|
||||
accessibilityLabel = getAccessibilityMessage()
|
||||
@ -111,12 +114,15 @@ import Foundation
|
||||
} else {
|
||||
// Only link. Manually add accessibility elements to ensure they are read in the right order.
|
||||
var elements: [Any] = []
|
||||
|
||||
if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() {
|
||||
elements.append(otherElements)
|
||||
}
|
||||
|
||||
if let rightLabelText = rightLabel.text, !rightLabelText.isEmpty {
|
||||
elements.append(rightLabel)
|
||||
}
|
||||
|
||||
accessibilityElements = elements
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListRightVariablePriceChangeAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListRightVariablePriceChangeBodyText: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
@ -85,6 +83,7 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers open class ListRightVariableRightCaretAllTextAndLinks: TableViewCell {
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//--------------------------------------------------
|
||||
|
||||
public let rightLabel = Label(fontStyle: .RegularBodySmall)
|
||||
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink()
|
||||
public var stack: Stack<StackModel>
|
||||
@ -19,6 +19,7 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
//--------------------------------------------------
|
||||
|
||||
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)
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
@ -31,6 +32,7 @@ import Foundation
|
||||
//-----------------------------------------------------
|
||||
// MARK: - Lifecycle
|
||||
//-----------------------------------------------------
|
||||
|
||||
open override func setupView() {
|
||||
super.setupView()
|
||||
rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal)
|
||||
@ -54,9 +56,12 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
// MARK: - Molecular
|
||||
//--------------------------------------------------
|
||||
|
||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
|
||||
guard let model = model as? ListRightVariableRightCaretAllTextAndLinksModel else { return }
|
||||
|
||||
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
||||
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
||||
updateAccessibilityLabel()
|
||||
@ -75,19 +80,24 @@ import Foundation
|
||||
// MARK: - Accessibility
|
||||
//--------------------------------------------------
|
||||
func getAccessibilityMessage() -> String? {
|
||||
|
||||
guard let rightLabelText = rightLabel.text else {
|
||||
return eyebrowHeadlineBodyLink.getAccessibilityMessage()
|
||||
}
|
||||
|
||||
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
|
||||
return rightLabelText
|
||||
}
|
||||
|
||||
return label + ", " + rightLabelText
|
||||
}
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
|
||||
isAccessibilityElement = !linkShowing
|
||||
accessibilityTraits = (isAccessibilityElement && accessoryView != nil) ? .button : .none
|
||||
|
||||
if !linkShowing {
|
||||
// Make whole cell focusable if no link.
|
||||
accessibilityLabel = getAccessibilityMessage()
|
||||
@ -98,12 +108,15 @@ import Foundation
|
||||
} else {
|
||||
// Only link. Manually add accessibility elements to ensure they are read in the right order.
|
||||
var elements: [Any] = []
|
||||
|
||||
if let otherElements = eyebrowHeadlineBodyLink.getAccessibilityElements() {
|
||||
elements.append(otherElements)
|
||||
}
|
||||
|
||||
if let rightLabelText = rightLabel.text, !rightLabelText.isEmpty {
|
||||
elements.append(rightLabel)
|
||||
}
|
||||
|
||||
accessibilityElements = elements
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,13 +6,12 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public class ListRightVariableRightCaretAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//--------------------------------------------------
|
||||
|
||||
public static var identifier: String = "listRVCaretAll"
|
||||
public var rightLabel: LabelModel
|
||||
public var eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel
|
||||
@ -20,6 +19,7 @@ public class ListRightVariableRightCaretAllTextAndLinksModel: ListItemModel, Mol
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializer
|
||||
//--------------------------------------------------
|
||||
|
||||
public init(rightLabel: LabelModel, eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel) {
|
||||
self.rightLabel = rightLabel
|
||||
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
|
||||
@ -29,6 +29,7 @@ public class ListRightVariableRightCaretAllTextAndLinksModel: ListItemModel, Mol
|
||||
//--------------------------------------------------
|
||||
// MARK: - Keys
|
||||
//--------------------------------------------------
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case moleculeName
|
||||
case rightLabel
|
||||
@ -38,6 +39,7 @@ public class ListRightVariableRightCaretAllTextAndLinksModel: ListItemModel, Mol
|
||||
//--------------------------------------------------
|
||||
// MARK: - Codec
|
||||
//--------------------------------------------------
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel)
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListRightVariableTextLinkAllTextAndLinks: TableViewCell {
|
||||
//--------------------------------------------------
|
||||
@ -72,18 +70,23 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
|
||||
func getAccessibilityMessage() -> String? {
|
||||
|
||||
guard let linkText = link.titleLabel?.text else {
|
||||
return eyebrowHeadlineBodyLink.getAccessibilityMessage()
|
||||
}
|
||||
|
||||
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
|
||||
return linkText
|
||||
}
|
||||
|
||||
return label + ", " + linkText
|
||||
}
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
|
||||
accessibilityTraits = .button
|
||||
|
||||
if !linkShowing && accessoryView == nil {
|
||||
// Make whole cell focusable if one action
|
||||
isAccessibilityElement = true
|
||||
@ -92,16 +95,20 @@ import Foundation
|
||||
// Make buttons focusable.
|
||||
isAccessibilityElement = false
|
||||
var elements: [Any] = []
|
||||
|
||||
if let accessoryView = accessoryView {
|
||||
accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage()
|
||||
elements.append(accessoryView)
|
||||
} else {
|
||||
link.accessibilityLabel = getAccessibilityMessage()
|
||||
}
|
||||
|
||||
elements.append(link)
|
||||
|
||||
if linkShowing {
|
||||
elements.append(eyebrowHeadlineBodyLink.link)
|
||||
}
|
||||
|
||||
accessibilityElements = elements
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListRightVariableTextLinkAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers open class ListRightVariableToggleAllTextAndLinks: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
@ -54,7 +53,9 @@ import Foundation
|
||||
|
||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
|
||||
guard let model = model as? ListRightVariableToggleAllTextAndLinksModel else { return }
|
||||
|
||||
toggle.set(with: model.toggle, delegateObject, additionalData)
|
||||
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
|
||||
updateAccessibilityLabel()
|
||||
@ -69,20 +70,25 @@ import Foundation
|
||||
//----------------------------------------------------
|
||||
|
||||
func getAccessibilityMessage() -> String? {
|
||||
|
||||
guard let toggleMessage = toggle.accessibilityLabel else {
|
||||
return eyebrowHeadlineBodyLink.getAccessibilityMessage()
|
||||
}
|
||||
|
||||
guard let label = eyebrowHeadlineBodyLink.getAccessibilityMessage() else {
|
||||
return toggleMessage
|
||||
}
|
||||
|
||||
return label + ", " + toggleMessage
|
||||
}
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
accessibilityHint = toggle.accessibilityHint
|
||||
accessibilityTraits = toggle.accessibilityTraits
|
||||
accessibilityValue = toggle.accessibilityValue
|
||||
let linkShowing = eyebrowHeadlineBodyLink.link.titleLabel?.text?.count ?? 0 > 0
|
||||
|
||||
if !linkShowing && accessoryView == nil {
|
||||
// Make whole cell focusable if one action
|
||||
isAccessibilityElement = true
|
||||
@ -91,6 +97,7 @@ import Foundation
|
||||
// Make buttons focusable.
|
||||
isAccessibilityElement = false
|
||||
var elements: [Any] = []
|
||||
|
||||
if let accessoryView = accessoryView {
|
||||
accessoryView.accessibilityLabel = eyebrowHeadlineBodyLink.getAccessibilityMessage()
|
||||
elements.append(accessoryView)
|
||||
@ -102,6 +109,7 @@ import Foundation
|
||||
if linkShowing {
|
||||
elements.append(eyebrowHeadlineBodyLink.link)
|
||||
}
|
||||
|
||||
accessibilityElements = elements
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public class ListRightVariableToggleAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListRightVariableTotalData: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
@ -84,6 +82,7 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
@ -27,6 +25,7 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc
|
||||
super.setDefaults()
|
||||
rightLabel.hero = 0
|
||||
bar.type = .heavy
|
||||
|
||||
if bar.backgroundColor == nil {
|
||||
bar.backgroundColor = Color(uiColor: .mvmBlue)
|
||||
}
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers open class ListThreeColumnBillChanges: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//-------------------------------------------------------
|
||||
|
||||
public let leftLabel = Label(fontStyle: .RegularBodySmall)
|
||||
public let centerLabel = Label(fontStyle: .RegularBodySmall)
|
||||
public let rightLabel = Label(fontStyle: .RegularBodySmall)
|
||||
@ -75,6 +75,7 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public class ListThreeColumnBillChangesModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers open class ListThreeColumnBillHistory: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//-------------------------------------------------------
|
||||
|
||||
public let leftLabel = Label(fontStyle: .RegularBodySmall)
|
||||
public let centerLabel = Label(fontStyle: .RegularBodySmall)
|
||||
public let rightLabel = Label(fontStyle: .RegularBodySmall)
|
||||
@ -35,6 +35,7 @@ import Foundation
|
||||
//------------------------------------------------------
|
||||
// MARK: - Lifecycle
|
||||
//------------------------------------------------------
|
||||
|
||||
open override func setupView() {
|
||||
super.setupView()
|
||||
addMolecule(stack)
|
||||
@ -44,6 +45,7 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
// MARK: - ModelMoleculeViewProtocol
|
||||
//--------------------------------------------------
|
||||
|
||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
guard let model = model as? ListThreeColumnBillHistoryModel else { return }
|
||||
@ -67,18 +69,24 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
// MARK: - Accessibility
|
||||
//--------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
if let leftText = leftLabel.text, !leftText.isEmpty {
|
||||
message += leftText + ", "
|
||||
}
|
||||
|
||||
if let centerText = centerLabel.text, !centerText.isEmpty {
|
||||
message += centerText + ", "
|
||||
}
|
||||
|
||||
if let rightText = rightLabel.text, !rightText.isEmpty {
|
||||
message += rightText
|
||||
}
|
||||
|
||||
accessibilityLabel = message
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public class ListThreeColumnBillHistoryModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//--------------------------------------------------
|
||||
|
||||
public static var identifier: String = "list3CBillHst"
|
||||
public var leftLabel: LabelModel
|
||||
public var centerLabel: LabelModel
|
||||
@ -20,6 +20,7 @@ public class ListThreeColumnBillHistoryModel: ListItemModel, MoleculeModelProtoc
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializer
|
||||
//--------------------------------------------------
|
||||
|
||||
public init(leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) {
|
||||
self.leftLabel = leftLabel
|
||||
self.centerLabel = centerLabel
|
||||
@ -30,6 +31,7 @@ public class ListThreeColumnBillHistoryModel: ListItemModel, MoleculeModelProtoc
|
||||
//--------------------------------------------------
|
||||
// MARK: - Keys
|
||||
//--------------------------------------------------
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case moleculeName
|
||||
case leftLabel
|
||||
@ -40,6 +42,7 @@ public class ListThreeColumnBillHistoryModel: ListItemModel, MoleculeModelProtoc
|
||||
//--------------------------------------------------
|
||||
// MARK: - Codec
|
||||
//--------------------------------------------------
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
|
||||
|
||||
@ -6,13 +6,12 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListThreeColumnDataUsage: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//-------------------------------------------------------
|
||||
|
||||
public let leftLabel = Label(fontStyle: .RegularBodySmall)
|
||||
public let centerLabel = Label(fontStyle: .RegularBodySmall)
|
||||
public let rightLabel = Label(fontStyle: .RegularBodySmall)
|
||||
@ -75,6 +74,7 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListThreeColumnDataUsageModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers public class ListThreeColumnInternationalData: TableViewCell {
|
||||
|
||||
@ -19,7 +17,7 @@ import Foundation
|
||||
public let leftLabel = Label(fontStyle: .RegularBodySmall)
|
||||
public let centerLabel = Label(fontStyle: .RegularBodySmall)
|
||||
public let rightLabel = Label(fontStyle: .RegularBodySmall)
|
||||
public let arrow = Arrow(frame: .zero)
|
||||
public let arrow = Arrow()
|
||||
public let arrowAndLabel2Stack: Stack<StackModel>
|
||||
|
||||
//-----------------------------------------------------
|
||||
@ -85,6 +83,7 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListThreeColumnInternationalDataModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers open class ListThreeColumnSpeedTest: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//-------------------------------------------------------
|
||||
|
||||
public var title = Label(fontStyle: .RegularMicro)
|
||||
public var topLeftHeadlineBody = HeadlineBody()
|
||||
public var topCenterHeadlineBody = HeadlineBody()
|
||||
@ -26,6 +26,7 @@ import Foundation
|
||||
//------------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
//------------------------------------------------------
|
||||
|
||||
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)
|
||||
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
|
||||
//--------------------------------------------------
|
||||
|
||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
|
||||
guard let model = model as? ListThreeColumnSpeedTestModel else { return }
|
||||
|
||||
title.set(with: model.title, delegateObject, additionalData)
|
||||
topHorizontalStack.updateContainedMolecules(with: [model.topLeftHeadlineBody, model.topCenterHeadlineBody, model.topRightHeadlineBody], delegateObject, additionalData)
|
||||
bottomHorizontalStack.updateContainedMolecules(with: [model.bottomLeftHeadlineBody, model.bottomCenterHeadlineBody, model.bottomRightHeadlineBody], delegateObject, additionalData)
|
||||
@ -78,41 +82,55 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
// MARK: - Accessibility
|
||||
//--------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
if let title = title.text, !title.isEmpty {
|
||||
message += title + ", "
|
||||
}
|
||||
|
||||
if let topLeftHeadlineBodyText = accessibilityTextOfHeadlineBody(topLeftHeadlineBody), !topLeftHeadlineBodyText.isEmpty {
|
||||
message += topLeftHeadlineBodyText + ", "
|
||||
}
|
||||
|
||||
if let topCenterHeadlineBodyText = accessibilityTextOfHeadlineBody(topCenterHeadlineBody), !topCenterHeadlineBodyText.isEmpty {
|
||||
message += topCenterHeadlineBodyText + ", "
|
||||
}
|
||||
|
||||
if let topRightHeadlineBodyText = accessibilityTextOfHeadlineBody(topRightHeadlineBody), !topRightHeadlineBodyText.isEmpty {
|
||||
message += topRightHeadlineBodyText + ", "
|
||||
}
|
||||
|
||||
if let bottomLeftHeadlineBodyText = accessibilityTextOfHeadlineBody(bottomLeftHeadlineBody), !bottomLeftHeadlineBodyText.isEmpty {
|
||||
message += bottomLeftHeadlineBodyText + ", "
|
||||
}
|
||||
|
||||
if let bottomCenterHeadlineBodyText = accessibilityTextOfHeadlineBody(bottomCenterHeadlineBody), !bottomCenterHeadlineBodyText.isEmpty {
|
||||
message += bottomCenterHeadlineBodyText + ", "
|
||||
}
|
||||
|
||||
if let bottomRightHeadlineBodyText = accessibilityTextOfHeadlineBody(bottomRightHeadlineBody), !bottomRightHeadlineBodyText.isEmpty {
|
||||
message += bottomRightHeadlineBodyText
|
||||
}
|
||||
|
||||
accessibilityLabel = message
|
||||
}
|
||||
|
||||
func accessibilityTextOfHeadlineBody(_ headlineBody: HeadlineBody) -> String? {
|
||||
|
||||
var message = ""
|
||||
|
||||
if let headlineLabel = headlineBody.headlineLabel.text {
|
||||
message += headlineLabel + ", "
|
||||
}
|
||||
|
||||
if let messageLabel = headlineBody.messageLabel.text {
|
||||
message += messageLabel
|
||||
}
|
||||
|
||||
return message
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//--------------------------------------------------
|
||||
|
||||
public static var identifier: String = "list3CSpdTst"
|
||||
public var title: LabelModel
|
||||
public var topLeftHeadlineBody: HeadlineBodyModel
|
||||
@ -24,6 +24,7 @@ public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializer
|
||||
//--------------------------------------------------
|
||||
|
||||
public init(title: LabelModel, topLeftHeadlineBody: HeadlineBodyModel, topCenterHeadlineBody: HeadlineBodyModel, topRightHeadlineBody: HeadlineBodyModel, bottomLeftHeadlineBody: HeadlineBodyModel, bottomCenterHeadlineBody: HeadlineBodyModel, bottomRightHeadlineBody: HeadlineBodyModel) {
|
||||
self.title = title
|
||||
self.topLeftHeadlineBody = topLeftHeadlineBody
|
||||
@ -38,6 +39,7 @@ public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol
|
||||
//------------------------------------------------------
|
||||
// MARK: - Method
|
||||
//------------------------------------------------------
|
||||
|
||||
override public func setDefaults() {
|
||||
styleHeadlineBody(topLeftHeadlineBody, true)
|
||||
styleHeadlineBody(bottomLeftHeadlineBody, false)
|
||||
@ -50,8 +52,10 @@ public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol
|
||||
|
||||
//Method to style headline and body of HeadlineBody
|
||||
func styleHeadlineBody(_ headlineBodyModel: HeadlineBodyModel, _ isBodyMicro: Bool) {
|
||||
|
||||
headlineBodyModel.headline?.fontStyle = .RegularMicro
|
||||
headlineBodyModel.headline?.textColor = Color(uiColor: .mvmCoolGray6)
|
||||
|
||||
if isBodyMicro {
|
||||
headlineBodyModel.body?.fontStyle = .RegularMicro
|
||||
headlineBodyModel.body?.textColor = Color(uiColor: .mvmCoolGray6)
|
||||
@ -63,6 +67,7 @@ public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol
|
||||
//--------------------------------------------------
|
||||
// MARK: - Keys
|
||||
//--------------------------------------------------
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case moleculeName
|
||||
case title
|
||||
@ -77,6 +82,7 @@ public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol
|
||||
//--------------------------------------------------
|
||||
// MARK: - Codec
|
||||
//--------------------------------------------------
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
title = try typeContainer.decode(LabelModel.self, forKey: .title)
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListTwoColumnCompareChanges: TableViewCell {
|
||||
//-------------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListTwoColumnCompareChangesModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers public class ListTwoColumnDropdownSelectors: TableViewCell {
|
||||
//-------------------------------------------------------
|
||||
@ -60,4 +58,3 @@ import Foundation
|
||||
return 121
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListTwoColumnDropdownSelectorsModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -6,13 +6,12 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
@objcMembers open class ListTwoColumnPriceDescription: TableViewCell {
|
||||
//-----------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//-------------------------------------------------------
|
||||
|
||||
public let leftHeadline = Label(fontStyle: .BoldBodySmall)
|
||||
public let leftBody = Label(fontStyle: .RegularBodySmall)
|
||||
public let rightLabel = Label(fontStyle: .RegularBodySmall)
|
||||
@ -33,6 +32,7 @@ import Foundation
|
||||
rightVerticalStack = UIStackView(arrangedSubviews: [rightLabel, rightSubLabel])
|
||||
rightVerticalStack.axis = .vertical
|
||||
rightVerticalStack.alignment = .trailing
|
||||
rightVerticalStack.setContentCompressionResistancePriority(.required, for: .horizontal)
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
}
|
||||
|
||||
@ -48,6 +48,16 @@ import Foundation
|
||||
super.updateView(size)
|
||||
leftVerticalStack.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() {
|
||||
@ -104,7 +114,9 @@ import Foundation
|
||||
//----------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
|
||||
var message = ""
|
||||
|
||||
if let leftHeadline = leftHeadline.text, !leftHeadline.isEmpty {
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListTwoColumnPriceDescriptionModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
@ -85,6 +83,3 @@ public class ListTwoColumnPriceDescriptionModel: ListItemModel, MoleculeModelPro
|
||||
try container.encode(rightSubLabel, forKey: .rightSubLabel)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
|
||||
@objcMembers open class ListTwoColumnPriceDetails: TableViewCell {
|
||||
//--------------------------------------------------
|
||||
@ -70,6 +68,7 @@ import UIKit
|
||||
//----------------------------------------------------
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
var message = ""
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user