21957(iOS - List - Three Column - Bill History) initial commit.
This commit is contained in:
parent
63595f1093
commit
2e1e44c2a2
@ -236,6 +236,8 @@
|
||||
AA997252247530B100FC7472 /* ListLeftVariableIconAllTextLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA997251247530B100FC7472 /* ListLeftVariableIconAllTextLinks.swift */; };
|
||||
AAA74A172410C04600080241 /* HeadersH2NoButtonsBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */; };
|
||||
AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */; };
|
||||
AAA905DF24D1758700D1EFAB /* ListThreeColumnBillHistoryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA905DE24D1758700D1EFAB /* ListThreeColumnBillHistoryModel.swift */; };
|
||||
AAA905E124D1759A00D1EFAB /* ListThreeColumnBillHistory.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAA905E024D1759A00D1EFAB /* ListThreeColumnBillHistory.swift */; };
|
||||
AAB7EDEF246ADA1600E54929 /* ListProgressBarThinModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB7EDEE246ADA1600E54929 /* ListProgressBarThinModel.swift */; };
|
||||
AAB7EDF1246ADA2A00E54929 /* ListProgressBarThin.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB7EDF0246ADA2A00E54929 /* ListProgressBarThin.swift */; };
|
||||
AAB9C10824346F4B00151545 /* RadioSwatches.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB9C10724346F4B00151545 /* RadioSwatches.swift */; };
|
||||
@ -711,6 +713,8 @@
|
||||
AA997251247530B100FC7472 /* ListLeftVariableIconAllTextLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconAllTextLinks.swift; sourceTree = "<group>"; };
|
||||
AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyText.swift; sourceTree = "<group>"; };
|
||||
AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2NoButtonsBodyTextModel.swift; sourceTree = "<group>"; };
|
||||
AAA905DE24D1758700D1EFAB /* ListThreeColumnBillHistoryModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnBillHistoryModel.swift; sourceTree = "<group>"; };
|
||||
AAA905E024D1759A00D1EFAB /* ListThreeColumnBillHistory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnBillHistory.swift; sourceTree = "<group>"; };
|
||||
AAB7EDEE246ADA1600E54929 /* ListProgressBarThinModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListProgressBarThinModel.swift; sourceTree = "<group>"; };
|
||||
AAB7EDF0246ADA2A00E54929 /* ListProgressBarThin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListProgressBarThin.swift; sourceTree = "<group>"; };
|
||||
AAB9C10724346F4B00151545 /* RadioSwatches.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSwatches.swift; sourceTree = "<group>"; };
|
||||
@ -1154,6 +1158,8 @@
|
||||
8DDD6C1C244D90B8006A2232 /* ListThreeColumnDataUsage.swift */,
|
||||
323AC96924C837F000F8E4C4 /* ListThreeColumnBillChangesModel.swift */,
|
||||
323AC96B24C837FF00F8E4C4 /* ListThreeColumnBillChanges.swift */,
|
||||
AAA905DE24D1758700D1EFAB /* ListThreeColumnBillHistoryModel.swift */,
|
||||
AAA905E024D1759A00D1EFAB /* ListThreeColumnBillHistory.swift */,
|
||||
);
|
||||
path = ThreeColumn;
|
||||
sourceTree = "<group>";
|
||||
@ -2263,6 +2269,7 @@
|
||||
BBAA4F04243D8E3B005AAD5F /* RadioBoxModel.swift in Sources */,
|
||||
D28A838B23CCDA6B00DFE4FC /* ButtonModel.swift in Sources */,
|
||||
D21B7F71243BAC1600051ABF /* CollectionViewCell.swift in Sources */,
|
||||
AAA905E124D1759A00D1EFAB /* ListThreeColumnBillHistory.swift in Sources */,
|
||||
C7F8012323E846C300396FBD /* ListRVWheelModel.swift in Sources */,
|
||||
D29DF27621E79E81003B2FB9 /* MVMCoreUILoggingHandler.m in Sources */,
|
||||
C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */,
|
||||
@ -2350,6 +2357,7 @@
|
||||
D260105323CEA61600764D80 /* ToggleModel.swift in Sources */,
|
||||
014AA72523C501E2006F3E93 /* ContainerModel.swift in Sources */,
|
||||
0A7EF86523D8AFFF00B2AAD1 /* ItemDropdownEntryFieldModel.swift in Sources */,
|
||||
AAA905DF24D1758700D1EFAB /* ListThreeColumnBillHistoryModel.swift in Sources */,
|
||||
D29DF2EF21ECEAE1003B2FB9 /* MFFonts.m in Sources */,
|
||||
D22479942316AE5E003FCCF9 /* NSLayoutConstraintExtension.swift in Sources */,
|
||||
D2B18B94236214AD00A9AEDC /* NavigationController.swift in Sources */,
|
||||
|
||||
@ -193,6 +193,7 @@ import Foundation
|
||||
MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnInternationalData.self, viewModelClass: ListThreeColumnInternationalDataModel.self)
|
||||
MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnDataUsage.self, viewModelClass: ListThreeColumnDataUsageModel.self)
|
||||
MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnBillChanges.self, viewModelClass: ListThreeColumnBillChangesModel.self)
|
||||
MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnBillHistory.self, viewModelClass: ListThreeColumnBillHistoryModel.self)
|
||||
MoleculeObjectMapping.shared()?.register(viewClass: ListFourColumnDataUsageListItem.self, viewModelClass: ListFourColumnDataUsageListItemModel.self)
|
||||
MoleculeObjectMapping.shared()?.register(viewClass: ListProgressBarThin.self, viewModelClass: ListProgressBarThinModel.self)
|
||||
|
||||
|
||||
@ -0,0 +1,84 @@
|
||||
//
|
||||
// ListThreeColumnBillHistory.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Lekshmi S on 29/07/20.
|
||||
// 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)
|
||||
var stack: Stack<StackModel>
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
//------------------------------------------------------
|
||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 37, horizontalAlignment: .leading)), (view: centerLabel, model: StackItemModel(percent: 40, horizontalAlignment: .leading)), (view: rightLabel, model: StackItemModel(percent: 23, horizontalAlignment: .leading))], axis: .horizontal)
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
}
|
||||
|
||||
public required init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - Lifecycle
|
||||
//------------------------------------------------------
|
||||
open override func setupView() {
|
||||
super.setupView()
|
||||
leftLabel.numberOfLines = 1
|
||||
centerLabel.numberOfLines = 1
|
||||
rightLabel.numberOfLines = 1
|
||||
addMolecule(stack)
|
||||
stack.restack()
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// 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 }
|
||||
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
|
||||
centerLabel.set(with: model.centerLabel, delegateObject, additionalData)
|
||||
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
||||
updateAccessibilityLabel()
|
||||
}
|
||||
|
||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||
return 121
|
||||
}
|
||||
|
||||
open override func reset() {
|
||||
super.reset()
|
||||
leftLabel.setFontStyle(.RegularBodySmall)
|
||||
centerLabel.setFontStyle(.RegularBodySmall)
|
||||
rightLabel.setFontStyle(.RegularBodySmall)
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// 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
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
//
|
||||
// ListThreeColumnBillHistoryModel.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Lekshmi S on 29/07/20.
|
||||
// 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
|
||||
public var rightLabel: LabelModel
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializer
|
||||
//--------------------------------------------------
|
||||
public init(leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) {
|
||||
self.leftLabel = leftLabel
|
||||
self.centerLabel = centerLabel
|
||||
self.rightLabel = rightLabel
|
||||
super.init()
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Keys
|
||||
//--------------------------------------------------
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case moleculeName
|
||||
case leftLabel
|
||||
case centerLabel
|
||||
case rightLabel
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// 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)
|
||||
centerLabel = try typeContainer.decode(LabelModel.self, forKey: .centerLabel)
|
||||
rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel)
|
||||
try super.init(from: decoder)
|
||||
}
|
||||
|
||||
public override func encode(to encoder: Encoder) throws {
|
||||
try super.encode(to: encoder)
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(moleculeName, forKey: .moleculeName)
|
||||
try container.encode(leftLabel, forKey: .leftLabel)
|
||||
try container.encode(centerLabel, forKey: .centerLabel)
|
||||
try container.encode(rightLabel, forKey: .rightLabel)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user