Merge branch 'feature/list_twocolumn_price_details' into 'develop'

Feature/list twocolumn price details

See merge request BPHV_MIPS/mvm_core_ui!303
This commit is contained in:
Pfeil, Scott Robert 2020-03-16 12:53:39 -04:00
commit c760564eec
6 changed files with 133 additions and 9 deletions

View File

@ -121,6 +121,8 @@
525019DE2406430800EED91C /* ListProgressBarData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019DC2406430800EED91C /* ListProgressBarData.swift */; };
525019E52406852100EED91C /* ListFourColumnDataUsageDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019E42406852100EED91C /* ListFourColumnDataUsageDividerModel.swift */; };
525019E72406853600EED91C /* ListFourColumnDataUsageDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525019E62406853600EED91C /* ListFourColumnDataUsageDivider.swift */; };
525239C02407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525239BF2407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift */; };
525239C22407BD1000454969 /* ListTwoColumnPriceDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525239C12407BD1000454969 /* ListTwoColumnPriceDetails.swift */; };
526A265C240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526A265B240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift */; };
526A265E240D200500B0D828 /* ListTwoColumnCompareChanges.swift in Sources */ = {isa = PBXBuildFile; fileRef = 526A265D240D200500B0D828 /* ListTwoColumnCompareChanges.swift */; };
52B201D224081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B201D024081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift */; };
@ -489,6 +491,8 @@
525019DC2406430800EED91C /* ListProgressBarData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListProgressBarData.swift; sourceTree = "<group>"; };
525019E42406852100EED91C /* ListFourColumnDataUsageDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListFourColumnDataUsageDividerModel.swift; sourceTree = "<group>"; };
525019E62406853600EED91C /* ListFourColumnDataUsageDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListFourColumnDataUsageDivider.swift; sourceTree = "<group>"; };
525239BF2407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDetailsModel.swift; sourceTree = "<group>"; };
525239C12407BD1000454969 /* ListTwoColumnPriceDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnPriceDetails.swift; sourceTree = "<group>"; };
526A265B240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnCompareChangesModel.swift; sourceTree = "<group>"; };
526A265D240D200500B0D828 /* ListTwoColumnCompareChanges.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTwoColumnCompareChanges.swift; sourceTree = "<group>"; };
52B201D024081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAndPaymentMethod.swift; sourceTree = "<group>"; };
@ -889,15 +893,6 @@
path = FourColumn;
sourceTree = "<group>";
};
526A265A240D1FCE00B0D828 /* TwoColumn */ = {
isa = PBXGroup;
children = (
526A265B240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift */,
526A265D240D200500B0D828 /* ListTwoColumnCompareChanges.swift */,
);
path = TwoColumn;
sourceTree = "<group>";
};
525239C32407FFCC00454969 /* LockUps */ = {
isa = PBXGroup;
children = (
@ -907,6 +902,13 @@
path = LockUps;
sourceTree = "<group>";
};
526A265A240D1FCE00B0D828 /* TwoColumn */ = {
isa = PBXGroup;
children = (
);
path = TwoColumn;
sourceTree = "<group>";
};
94C2D9822386F3E30006CF46 /* Label */ = {
isa = PBXGroup;
children = (
@ -1123,6 +1125,7 @@
D22B38EA23F4E08B00490EF6 /* List */ = {
isa = PBXGroup;
children = (
D22D8396241FDE4700D3DF69 /* TwoColumn */,
52267A0523FFE0A900906CBA /* OneColumn */,
AA4FC2A323F4F69600E251DB /* RightVariable */,
D22B38EB23F4E0AE00490EF6 /* LeftVariable */,
@ -1171,6 +1174,17 @@
path = Legacy;
sourceTree = "<group>";
};
D22D8396241FDE4700D3DF69 /* TwoColumn */ = {
isa = PBXGroup;
children = (
526A265B240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift */,
526A265D240D200500B0D828 /* ListTwoColumnCompareChanges.swift */,
525239BF2407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift */,
525239C12407BD1000454969 /* ListTwoColumnPriceDetails.swift */,
);
path = TwoColumn;
sourceTree = "<group>";
};
D260105723CF9CC500764D80 /* Doughnut */ = {
isa = PBXGroup;
children = (
@ -1864,6 +1878,7 @@
94C2D9AB23872EB50006CF46 /* LabelAttributeActionModel.swift in Sources */,
D22D8395241FB41200D3DF69 /* UIStackView+Extension.swift in Sources */,
52B201D324081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift in Sources */,
525239C02407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift in Sources */,
D2E2A99A23D8D6B4000B42E6 /* HeadlineBodyButtonModel.swift in Sources */,
8D084AD22410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift in Sources */,
014AA73123C5059B006F3E93 /* ListPageTemplateModel.swift in Sources */,
@ -2026,6 +2041,7 @@
011D95892404249B000E3791 /* FormProtocol.swift in Sources */,
948DB67E2326DCD90011F916 /* MultiProgress.swift in Sources */,
013F801923FB4A8E00AD8013 /* UIContentMode+Extension.swift in Sources */,
525239C22407BD1000454969 /* ListTwoColumnPriceDetails.swift in Sources */,
D2A5146122121FBF00345BFB /* MoleculeStackTemplate.swift in Sources */,
D2E2A9A323E096B1000B42E6 /* DisableableModelProtocol.swift in Sources */,
D29DF11821E6805F003B2FB9 /* NSLayoutConstraint+MFConvenience.m in Sources */,

View File

@ -0,0 +1,53 @@
//
// ListTwoColumnPriceDetails.swift
// MVMCoreUI
//
// Created by Lekshmi S on 19/02/20.
// Copyright © 2020 Verizon Wireless. All rights reserved.
//
import UIKit
@objcMembers open class ListTwoColumnPriceDetails: TableViewCell {
let leftLabel = Label.commonLabelB2(true)
let rightLabel = Label.commonLabelB2(true)
let view = MVMCoreUICommonViewsUtility.commonView()
// MARK: - MFViewProtocol
open override func setupView() {
super.setupView()
view.addSubview(leftLabel)
view.addSubview(rightLabel)
NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: rightLabel, alignTop: true)
contentView.addSubview(view)
containerHelper.constrainView(view)
rightLabel.setContentCompressionResistancePriority(UILayoutPriority(rawValue: 900), for: .horizontal)
}
open override func updateView(_ size: CGFloat) {
super.updateView(size)
leftLabel.updateView(size)
rightLabel.updateView(size)
}
// MARK: - MVMCoreUIMoleculeViewProtocol
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListTwoColumnPriceDetailsModel else { return }
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
}
open override func reset() {
super.reset()
leftLabel.reset()
rightLabel.reset()
leftLabel.styleB2(true)
rightLabel.styleB2(true)
}
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
return 15
}
}

View File

@ -0,0 +1,54 @@
//
// ListTwoColumnPriceDetailsModel.swift
// MVMCoreUI
//
// Created by Lekshmi S on 19/02/20.
// Copyright © 2020 Verizon Wireless. All rights reserved.
//
import Foundation
public class ListTwoColumnPriceDetailsModel: ListItemModel, MoleculeModelProtocol {
public static var identifier: String = "list2CTxtPrc2"
public var leftLabel: LabelModel
public var rightLabel: LabelModel
public init(leftLabel: LabelModel, rightLabel:LabelModel) {
self.leftLabel = leftLabel
self.rightLabel = rightLabel
super.init()
}
/// Defaults to set
override public func setDefaults() {
super.setDefaults()
style = "none"
if leftLabel.textColor == nil {
leftLabel.textColor = Color(uiColor: .mvmCoolGray6)
}
if rightLabel.textColor == nil {
rightLabel.textColor = Color(uiColor: .mvmCoolGray6)
}
}
private enum CodingKeys: String, CodingKey {
case moleculeName
case leftLabel
case rightLabel
}
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)
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(rightLabel, forKey: .rightLabel)
}
}

View File

@ -112,6 +112,7 @@ import Foundation
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self)
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self)
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnCompareChanges.self, viewModelClass: ListTwoColumnCompareChangesModel.self)
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListTwoColumnPriceDetails.self, viewModelClass: ListTwoColumnPriceDetailsModel.self)
// TODO: Need model
MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(DigitEntryField.self, forKey: "digitTextField" as NSString)