Merge branch 'feature/list_twocolumn_comparechanges' into 'develop'
Feature/list twocolumn comparechanges See merge request BPHV_MIPS/mvm_core_ui!304
This commit is contained in:
commit
a26ab4b8c3
@ -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 */; };
|
||||
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 */; };
|
||||
52B201D324081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52B201D124081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift */; };
|
||||
8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */; };
|
||||
@ -487,6 +489,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>"; };
|
||||
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>"; };
|
||||
52B201D124081CFB00D2011E /* ListLeftVariableRadioButtonAndPaymentMethodModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListLeftVariableRadioButtonAndPaymentMethodModel.swift; sourceTree = "<group>"; };
|
||||
8D084ACF2410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListOneColumnFullWidthTextBodyTextModel.swift; sourceTree = "<group>"; };
|
||||
@ -885,6 +889,15 @@
|
||||
path = FourColumn;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
526A265A240D1FCE00B0D828 /* TwoColumn */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
526A265B240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift */,
|
||||
526A265D240D200500B0D828 /* ListTwoColumnCompareChanges.swift */,
|
||||
);
|
||||
path = TwoColumn;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
525239C32407FFCC00454969 /* LockUps */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -1133,6 +1146,7 @@
|
||||
D22B38EC23F4E10700490EF6 /* SectionDividers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
526A265A240D1FCE00B0D828 /* TwoColumn */,
|
||||
525019E3240684E500EED91C /* FourColumn */,
|
||||
D22B38ED23F4E11100490EF6 /* ThreeColumn */,
|
||||
);
|
||||
@ -1882,6 +1896,7 @@
|
||||
D2D6CD4022E78C1A00D701B8 /* Scroller.swift in Sources */,
|
||||
0A7EF85F23D8ABC500B2AAD1 /* MdnEntryFieldModel.swift in Sources */,
|
||||
011D959B240451E3000E3791 /* RuleRequiredModel.swift in Sources */,
|
||||
526A265C240D1FF700B0D828 /* ListTwoColumnCompareChangesModel.swift in Sources */,
|
||||
01509D952327ED1900EF99AA /* HeadlineBodyLinkToggle.swift in Sources */,
|
||||
31BE15CB23D8924D00452370 /* CheckboxLabelModel.swift in Sources */,
|
||||
D260105523CEA7DC00764D80 /* MVMCoreUISwitch+Model.swift in Sources */,
|
||||
@ -1943,6 +1958,7 @@
|
||||
94AF4A3F23E9D13900676048 /* MFCaretButton.m in Sources */,
|
||||
D29DF27A21E7A533003B2FB9 /* MVMCoreUISession.m in Sources */,
|
||||
D2A5146B2214905000345BFB /* ThreeLayerViewController.swift in Sources */,
|
||||
526A265E240D200500B0D828 /* ListTwoColumnCompareChanges.swift in Sources */,
|
||||
8D24041523E7FC0B009E23BE /* ListLeftVariableIconWithRightCaretModel.swift in Sources */,
|
||||
D28A838F23CCDEDE00DFE4FC /* TwoButtonViewModel.swift in Sources */,
|
||||
D2D90B42240463E100DD6EC9 /* MoleculeHeaderModel.swift in Sources */,
|
||||
|
||||
@ -8,9 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
extension UIStackView: MoleculeViewProtocol {
|
||||
public func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) {}
|
||||
|
||||
extension UIStackView: MVMCoreUIMoleculeViewProtocol {
|
||||
public func updateView(_ size: CGFloat) {
|
||||
for view in arrangedSubviews {
|
||||
(view as? MVMCoreViewProtocol)?.updateView(size)
|
||||
@ -19,7 +17,7 @@ extension UIStackView: MoleculeViewProtocol {
|
||||
|
||||
public func reset() {
|
||||
for view in arrangedSubviews {
|
||||
(view as? MoleculeViewProtocol)?.reset?()
|
||||
(view as? MVMCoreUIMoleculeViewProtocol)?.reset?()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ static CGFloat const IndicatorRectangleHeight = 4;
|
||||
self.currentPage = page;
|
||||
}
|
||||
|
||||
#pragma mark - MoleculeViewProtocol
|
||||
#pragma mark - MVMCoreUIMoleculeViewProtocol
|
||||
|
||||
- (void)setWithJSON:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {
|
||||
NSString *colorString = [json string:KeyBackgroundColor];
|
||||
|
||||
@ -0,0 +1,113 @@
|
||||
//
|
||||
// ListTwoColumnCompareChanges.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Lekshmi S on 24/02/20.
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objcMembers open class ListTwoColumnCompareChanges: TableViewCell {
|
||||
|
||||
//-------------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//-------------------------------------------------------
|
||||
let leftHeadline1 = Label.commonLabelB1(true)
|
||||
let leftHeadline2 = Label.commonLabelB1(true)
|
||||
let leftHeadline3 = Label.commonLabelB1(true)
|
||||
let leftBody = Label.commonLabelB2(true)
|
||||
let leftLink = Link()
|
||||
let rightHeadline1 = Label.commonLabelB1(true)
|
||||
let rightHeadline2 = Label.commonLabelB1(true)
|
||||
let rightHeadline3 = Label.commonLabelB1(true)
|
||||
let rightBody = Label.commonLabelB2(true)
|
||||
let rightLink = Link()
|
||||
let containingStack: Stack<StackModel>
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
//------------------------------------------------------
|
||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
let stackHeadline1 = Stack<StackModel>.createStack(with: [(view: leftHeadline1, model: StackItemModel(percent: 50, verticalAlignment: .leading)),
|
||||
(view: rightHeadline1, model: StackItemModel(percent: 50, verticalAlignment: .leading))],
|
||||
axis: .horizontal)
|
||||
let stackHeadline2 = Stack<StackModel>.createStack(with: [(view: leftHeadline2, model: StackItemModel(percent: 50, verticalAlignment: .leading)),
|
||||
(view: rightHeadline2, model: StackItemModel(percent: 50, verticalAlignment: .leading))],
|
||||
axis: .horizontal)
|
||||
let stackHeadline3 = Stack<StackModel>.createStack(with: [(view: leftHeadline3, model: StackItemModel(percent: 50, verticalAlignment: .leading)),
|
||||
(view: rightHeadline3, model: StackItemModel(percent: 50, verticalAlignment: .leading))],
|
||||
axis: .horizontal)
|
||||
let stackBody = Stack<StackModel>.createStack(with: [(view: leftBody, model: StackItemModel(percent: 50, verticalAlignment: .leading)),
|
||||
(view: rightBody, model: StackItemModel(percent: 50, verticalAlignment: .leading))],
|
||||
axis: .horizontal)
|
||||
let stackLink = Stack<StackModel>.createStack(with: [(view: leftLink, model: StackItemModel(percent: 50, verticalAlignment: .leading)),
|
||||
(view: rightLink, model: StackItemModel(percent: 50, verticalAlignment: .leading))],
|
||||
axis: .horizontal)
|
||||
containingStack = Stack<StackModel>.createStack(with: [stackHeadline1,
|
||||
stackHeadline2,
|
||||
stackHeadline3,
|
||||
stackBody,
|
||||
stackLink],
|
||||
spacing: 0)
|
||||
containingStack.stackModel?.molecules[1].spacing = 5
|
||||
containingStack.stackModel?.molecules[2].spacing = 5
|
||||
containingStack.stackModel?.molecules[4].spacing = 5
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
}
|
||||
|
||||
public required init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//------------------------------------------------------
|
||||
let stackSpacing: CGFloat = 5.0
|
||||
|
||||
//-------------------------------------------------------
|
||||
// MARK: - View Lifecycle
|
||||
//-------------------------------------------------------
|
||||
open override func setupView() {
|
||||
super.setupView()
|
||||
addMolecule(containingStack)
|
||||
for molecule in containingStack.stackItems {
|
||||
((molecule as? StackItem)?.view as? Stack<StackModel>)?.restack()
|
||||
}
|
||||
containingStack.restack()
|
||||
}
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - Molecule
|
||||
//------------------------------------------------------
|
||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
guard let model = model as? ListTwoColumnCompareChangesModel else { return }
|
||||
leftHeadline1.set(with: model.leftHeadline1, delegateObject, additionalData)
|
||||
leftHeadline2.set(with: model.leftHeadline2, delegateObject, additionalData)
|
||||
leftHeadline3.set(with: model.leftHeadline3, delegateObject, additionalData)
|
||||
leftBody.set(with: model.leftBody, delegateObject, additionalData)
|
||||
leftLink.set(with: model.leftLink, delegateObject, additionalData)
|
||||
rightHeadline1.set(with: model.rightHeadline1, delegateObject, additionalData)
|
||||
rightHeadline2.set(with: model.rightHeadline2, delegateObject, additionalData)
|
||||
rightHeadline3.set(with: model.rightHeadline3, delegateObject, additionalData)
|
||||
rightBody.set(with: model.rightBody, delegateObject, additionalData)
|
||||
rightLink.set(with: model.rightLink, delegateObject, additionalData)
|
||||
}
|
||||
|
||||
open override func reset() {
|
||||
super.reset()
|
||||
leftHeadline1.styleB1(true)
|
||||
leftHeadline2.styleB1(true)
|
||||
leftHeadline3.styleB1(true)
|
||||
leftBody.styleB2(true)
|
||||
rightHeadline1.styleB1(true)
|
||||
rightHeadline2.styleB1(true)
|
||||
rightHeadline3.styleB1(true)
|
||||
rightBody.styleB2(true)
|
||||
}
|
||||
|
||||
public override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||
return 121
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
//
|
||||
// ListTwoColumnCompareChangesModel.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Lekshmi S on 24/02/20.
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public class ListTwoColumnCompareChangesModel: ListItemModel, MoleculeModelProtocol {
|
||||
|
||||
public static var identifier: String = "list2CCmpr1"
|
||||
public var leftHeadline1: LabelModel
|
||||
public var leftHeadline2: LabelModel
|
||||
public var leftHeadline3: LabelModel
|
||||
public var leftBody: LabelModel
|
||||
public var leftLink: LinkModel
|
||||
public var rightHeadline1: LabelModel
|
||||
public var rightHeadline2: LabelModel
|
||||
public var rightHeadline3: LabelModel
|
||||
public var rightBody: LabelModel
|
||||
public var rightLink: LinkModel
|
||||
|
||||
public init(leftHeadline1: LabelModel, leftHeadline2: LabelModel, leftHeadline3: LabelModel, leftBody: LabelModel, leftLink: LinkModel, rightHeadline1: LabelModel, rightHeadline2: LabelModel, rightHeadline3: LabelModel, rightBody: LabelModel, rightLink: LinkModel) {
|
||||
self.leftHeadline1 = leftHeadline1
|
||||
self.leftHeadline2 = leftHeadline2
|
||||
self.leftHeadline3 = leftHeadline3
|
||||
self.leftBody = leftBody
|
||||
self.leftLink = leftLink
|
||||
self.rightHeadline1 = rightHeadline1
|
||||
self.rightHeadline2 = rightHeadline2
|
||||
self.rightHeadline3 = rightHeadline3
|
||||
self.rightBody = rightBody
|
||||
self.rightLink = rightLink
|
||||
super.init()
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case moleculeName
|
||||
case leftHeadline1
|
||||
case leftHeadline2
|
||||
case leftHeadline3
|
||||
case leftBody
|
||||
case leftLink
|
||||
case rightHeadline1
|
||||
case rightHeadline2
|
||||
case rightHeadline3
|
||||
case rightBody
|
||||
case rightLink
|
||||
}
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
leftHeadline1 = try typeContainer.decode(LabelModel.self, forKey: .leftHeadline1)
|
||||
leftHeadline2 = try typeContainer.decode(LabelModel.self, forKey: .leftHeadline2)
|
||||
leftHeadline3 = try typeContainer.decode(LabelModel.self, forKey: .leftHeadline3)
|
||||
leftBody = try typeContainer.decode(LabelModel.self, forKey: .leftBody)
|
||||
leftLink = try typeContainer.decode(LinkModel.self, forKey: .leftLink)
|
||||
rightHeadline1 = try typeContainer.decode(LabelModel.self, forKey: .rightHeadline1)
|
||||
rightHeadline2 = try typeContainer.decode(LabelModel.self, forKey: .rightHeadline2)
|
||||
rightHeadline3 = try typeContainer.decode(LabelModel.self, forKey: .rightHeadline3)
|
||||
rightBody = try typeContainer.decode(LabelModel.self, forKey: .rightBody)
|
||||
rightLink = try typeContainer.decode(LinkModel.self, forKey: .rightLink)
|
||||
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(leftHeadline1, forKey: .leftHeadline1)
|
||||
try container.encode(leftHeadline2, forKey: .leftHeadline2)
|
||||
try container.encode(leftHeadline3, forKey: .leftHeadline3)
|
||||
try container.encode(leftBody, forKey: .leftBody)
|
||||
try container.encode(leftLink, forKey: .leftLink)
|
||||
try container.encode(rightHeadline1, forKey: .rightHeadline1)
|
||||
try container.encode(rightHeadline2, forKey: .rightHeadline2)
|
||||
try container.encode(rightHeadline3, forKey: .rightHeadline3)
|
||||
try container.encode(rightBody, forKey: .rightBody)
|
||||
try container.encode(rightLink, forKey: .rightLink)
|
||||
}
|
||||
}
|
||||
@ -152,7 +152,7 @@ import UIKit
|
||||
styleDefault()
|
||||
spaceAboveMolecule = 6.0
|
||||
spaceBelowMolecule = 6.0
|
||||
(middleView as? MoleculeViewProtocol)?.reset?()
|
||||
(middleView as? MVMCoreUIMoleculeViewProtocol)?.reset?()
|
||||
}
|
||||
|
||||
func styleDefault() {
|
||||
|
||||
@ -73,7 +73,7 @@ open class StringAndMoleculeView: View {
|
||||
override open func reset() {
|
||||
super.reset()
|
||||
label.reset()
|
||||
(molecule as? MoleculeViewProtocol)?.reset?()
|
||||
(molecule as? MVMCoreUIMoleculeViewProtocol)?.reset?()
|
||||
}
|
||||
|
||||
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
|
||||
@ -135,7 +135,7 @@ open class Stack<T>: Container where T: (StackModelProtocol & MoleculeModelProto
|
||||
super.reset()
|
||||
backgroundColor = .clear
|
||||
for item in stackItems {
|
||||
(item as? MoleculeViewProtocol)?.reset?()
|
||||
(item as? MVMCoreUIMoleculeViewProtocol)?.reset?()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -111,6 +111,7 @@ import Foundation
|
||||
// Designed Section Dividers
|
||||
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)
|
||||
|
||||
// TODO: Need model
|
||||
MVMCoreUIMoleculeMappingObject.shared()?.moleculeMapping.setObject(DigitEntryField.self, forKey: "digitTextField" as NSString)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user