From d0b390291580ad43d701b00e37c19e4d70bba372 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 4 Aug 2020 17:27:17 +0530 Subject: [PATCH 1/9] 22008(iOS - List - Three Column - Speed Test) initial commit. --- MVMCoreUI.xcodeproj/project.pbxproj | 8 + MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + .../ListThreeColumnSpeedTest.swift | 139 ++++++++++++++++++ .../ListThreeColumnSpeedTestModel.swift | 79 ++++++++++ 4 files changed, 227 insertions(+) create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTestModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 97f48227..454ef7e7 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -242,6 +242,8 @@ AAB7EDF1246ADA2A00E54929 /* ListProgressBarThin.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB7EDF0246ADA2A00E54929 /* ListProgressBarThin.swift */; }; AAB9C10824346F4B00151545 /* RadioSwatches.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB9C10724346F4B00151545 /* RadioSwatches.swift */; }; AAB9C10A243496DD00151545 /* RadioSwatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB9C109243496DD00151545 /* RadioSwatch.swift */; }; + AAC23FAD24D92A0D009208DF /* ListThreeColumnSpeedTestModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAC23FAC24D92A0D009208DF /* ListThreeColumnSpeedTestModel.swift */; }; + AAC23FAF24D92A1E009208DF /* ListThreeColumnSpeedTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAC23FAE24D92A1E009208DF /* ListThreeColumnSpeedTest.swift */; }; AAC6F167243332E400F295C1 /* RadioSwatchesModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAC6F166243332E400F295C1 /* RadioSwatchesModel.swift */; }; AAE7270C24AC8B8500A3ED0E /* HeadersH2CaretLinkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAE7270B24AC8B8500A3ED0E /* HeadersH2CaretLinkModel.swift */; }; AAE7270E24AC8B9300A3ED0E /* HeadersH2CaretLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAE7270D24AC8B9300A3ED0E /* HeadersH2CaretLink.swift */; }; @@ -719,6 +721,8 @@ AAB7EDF0246ADA2A00E54929 /* ListProgressBarThin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListProgressBarThin.swift; sourceTree = ""; }; AAB9C10724346F4B00151545 /* RadioSwatches.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSwatches.swift; sourceTree = ""; }; AAB9C109243496DD00151545 /* RadioSwatch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSwatch.swift; sourceTree = ""; }; + AAC23FAC24D92A0D009208DF /* ListThreeColumnSpeedTestModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTestModel.swift; sourceTree = ""; }; + AAC23FAE24D92A1E009208DF /* ListThreeColumnSpeedTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnSpeedTest.swift; sourceTree = ""; }; AAC6F166243332E400F295C1 /* RadioSwatchesModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSwatchesModel.swift; sourceTree = ""; }; AAE7270B24AC8B8500A3ED0E /* HeadersH2CaretLinkModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2CaretLinkModel.swift; sourceTree = ""; }; AAE7270D24AC8B9300A3ED0E /* HeadersH2CaretLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2CaretLink.swift; sourceTree = ""; }; @@ -1160,6 +1164,8 @@ 323AC96B24C837FF00F8E4C4 /* ListThreeColumnBillChanges.swift */, AAA905DE24D1758700D1EFAB /* ListThreeColumnBillHistoryModel.swift */, AAA905E024D1759A00D1EFAB /* ListThreeColumnBillHistory.swift */, + AAC23FAC24D92A0D009208DF /* ListThreeColumnSpeedTestModel.swift */, + AAC23FAE24D92A1E009208DF /* ListThreeColumnSpeedTest.swift */, ); path = ThreeColumn; sourceTree = ""; @@ -2189,6 +2195,7 @@ 94C2D9A923872E5E0006CF46 /* LabelAttributeImageModel.swift in Sources */, DBC4391922442197001AB423 /* DashLine.swift in Sources */, D264FAAA2440F97600D98315 /* CollectionView.swift in Sources */, + AAC23FAD24D92A0D009208DF /* ListThreeColumnSpeedTestModel.swift in Sources */, BBC0C4FF24811DCA0087C44F /* TagModel.swift in Sources */, 0A7BAD74232A8DC700FB8E22 /* HeadlineBodyButton.swift in Sources */, 3265B30424BCA749000D154B /* HeadersH1NoButtonsBodyText.swift in Sources */, @@ -2288,6 +2295,7 @@ 8D084AD22410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift in Sources */, 94C0150C2421564A005811A9 /* ActionCollapseNotificationModel.swift in Sources */, 014AA73123C5059B006F3E93 /* ListPageTemplateModel.swift in Sources */, + AAC23FAF24D92A1E009208DF /* ListThreeColumnSpeedTest.swift in Sources */, D29DF2A221E7AF4E003B2FB9 /* MVMCoreUIUtility.m in Sources */, D29DF12B21E6851E003B2FB9 /* MVMCoreUITopAlertExpandableView.m in Sources */, 94C2D9A723872DA90006CF46 /* LabelAttributeColorModel.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index ef8e4573..27123d63 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -194,6 +194,7 @@ import Foundation 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: ListThreeColumnSpeedTest.self, viewModelClass: ListThreeColumnSpeedTestModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListFourColumnDataUsageListItem.self, viewModelClass: ListFourColumnDataUsageListItemModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListProgressBarThin.self, viewModelClass: ListProgressBarThinModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift new file mode 100644 index 00000000..9c1b342f --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift @@ -0,0 +1,139 @@ +// +// ListThreeColumnSpeedTest.swift +// MVMCoreUI +// +// Created by Lekshmi S on 04/08/20. +// 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 bottomLeftHeadlineBody = HeadlineBody() + public var verticalStack1: Stack + public var topCenterHeadlineBody = HeadlineBody() + public var bottomCenterHeadlineBody = HeadlineBody() + public var verticalStack2: Stack + public var topRightHeadlineBody = HeadlineBody() + public var bottomRightHeadlineBody = HeadlineBody() + public var verticalStack3: Stack + public var horizontalStack: Stack + public var stack: Stack + + //------------------------------------------------------ + // MARK: - Initializers + //------------------------------------------------------ + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + + verticalStack1 = Stack.createStack(with: [(view: topLeftHeadlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: bottomLeftHeadlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) + verticalStack2 = Stack.createStack(with: [(view: topCenterHeadlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: bottomCenterHeadlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) + verticalStack3 = Stack.createStack(with: [(view: topRightHeadlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: bottomRightHeadlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) + horizontalStack = Stack.createStack(with: [(view: verticalStack1, model: StackItemModel(percent: 36, horizontalAlignment: .leading)), + (view: verticalStack2, model: StackItemModel(percent: 34, horizontalAlignment: .leading)), + (view: verticalStack3, model: StackItemModel(percent: 30, horizontalAlignment: .leading))], + axis: .horizontal) + stack = Stack.createStack(with: [(view: title, model: StackItemModel(horizontalAlignment: .leading)), (view: horizontalStack, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical, spacing: 0) + 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() + addMolecule(stack) + stack.restack() + verticalStack1.restack() + verticalStack2.restack() + verticalStack3.restack() + horizontalStack.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? ListThreeColumnSpeedTestModel else { return } + title.set(with: model.title, delegateObject, additionalData) + verticalStack1.updateContainedMolecules(with: [model.topLeftHeadlineBody, model.bottomLeftHeadlineBody], delegateObject, additionalData) + verticalStack2.updateContainedMolecules(with: [model.topCenterHeadlineBody, model.bottomCenterHeadlineBody], delegateObject, additionalData) + verticalStack3.updateContainedMolecules(with: [model.topRightHeadlineBody, model.bottomRightHeadlineBody], delegateObject, additionalData) + updateAccessibilityLabel() + } + + open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { + return 121 + } + + open override func reset() { + super.reset() + title.setFontStyle(.BoldBodySmall) + styleHeadlineBody(topLeftHeadlineBody, true) + styleHeadlineBody(bottomLeftHeadlineBody, false) + styleHeadlineBody(topCenterHeadlineBody, false) + styleHeadlineBody(bottomCenterHeadlineBody, false) + styleHeadlineBody(topRightHeadlineBody, false) + styleHeadlineBody(bottomRightHeadlineBody, false) + } + + func styleHeadlineBody(_ headlineBody: HeadlineBody, _ isBodyMicro: Bool) { + headlineBody.headlineLabel.setFontStyle(.RegularMicro) + headlineBody.headlineLabel.textColor = .mvmCoolGray6 + headlineBody.messageLabel.setFontStyle(.RegularBodySmall) + if isBodyMicro { + headlineBody.messageLabel.setFontStyle(.RegularMicro) + headlineBody.messageLabel.textColor = .mvmCoolGray6 + } + } + + //-------------------------------------------------- + // 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 + } +} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTestModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTestModel.swift new file mode 100644 index 00000000..1ba62c2f --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTestModel.swift @@ -0,0 +1,79 @@ +// +// ListThreeColumnSpeedTestModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 04/08/20. +// 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 + public var topCenterHeadlineBody: HeadlineBodyModel + public var topRightHeadlineBody: HeadlineBodyModel + public var bottomLeftHeadlineBody: HeadlineBodyModel + public var bottomCenterHeadlineBody: HeadlineBodyModel + public var bottomRightHeadlineBody: HeadlineBodyModel + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init(title: LabelModel, topLeftHeadlineBody: HeadlineBodyModel, topCenterHeadlineBody: HeadlineBodyModel, topRightHeadlineBody: HeadlineBodyModel, bottomLeftHeadlineBody: HeadlineBodyModel, bottomCenterHeadlineBody: HeadlineBodyModel, bottomRightHeadlineBody: HeadlineBodyModel) { + self.title = title + self.topLeftHeadlineBody = topLeftHeadlineBody + self.topCenterHeadlineBody = topCenterHeadlineBody + self.topRightHeadlineBody = topRightHeadlineBody + self.bottomLeftHeadlineBody = bottomLeftHeadlineBody + self.bottomCenterHeadlineBody = bottomCenterHeadlineBody + self.bottomRightHeadlineBody = bottomRightHeadlineBody + super.init() + } + + //-------------------------------------------------- + // MARK: - Keys + //-------------------------------------------------- + private enum CodingKeys: String, CodingKey { + case moleculeName + case title + case topLeftHeadlineBody + case topCenterHeadlineBody + case topRightHeadlineBody + case bottomLeftHeadlineBody + case bottomCenterHeadlineBody + case bottomRightHeadlineBody + } + + //-------------------------------------------------- + // 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) + topLeftHeadlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .topLeftHeadlineBody) + topCenterHeadlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .topCenterHeadlineBody) + topRightHeadlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .topRightHeadlineBody) + bottomLeftHeadlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .bottomLeftHeadlineBody) + bottomCenterHeadlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .bottomCenterHeadlineBody) + bottomRightHeadlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .bottomRightHeadlineBody) + 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(title, forKey: .title) + try container.encode(topLeftHeadlineBody, forKey: .topLeftHeadlineBody) + try container.encode(topCenterHeadlineBody, forKey: .topCenterHeadlineBody) + try container.encode(topRightHeadlineBody, forKey: .topRightHeadlineBody) + try container.encode(bottomLeftHeadlineBody, forKey: .bottomLeftHeadlineBody) + try container.encode(bottomCenterHeadlineBody, forKey: .bottomCenterHeadlineBody) + try container.encode(bottomRightHeadlineBody, forKey: .bottomRightHeadlineBody) + } +} From 61f6f388218fa39115c1feb437f331661d78e839 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 4 Aug 2020 17:56:33 +0530 Subject: [PATCH 2/9] Adjusted percent values. --- .../List/ThreeColumn/ListThreeColumnSpeedTest.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift index 9c1b342f..1290a3d3 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift @@ -34,8 +34,8 @@ import Foundation verticalStack2 = Stack.createStack(with: [(view: topCenterHeadlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: bottomCenterHeadlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) verticalStack3 = Stack.createStack(with: [(view: topRightHeadlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: bottomRightHeadlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) horizontalStack = Stack.createStack(with: [(view: verticalStack1, model: StackItemModel(percent: 36, horizontalAlignment: .leading)), - (view: verticalStack2, model: StackItemModel(percent: 34, horizontalAlignment: .leading)), - (view: verticalStack3, model: StackItemModel(percent: 30, horizontalAlignment: .leading))], + (view: verticalStack2, model: StackItemModel(percent: 32, horizontalAlignment: .leading)), + (view: verticalStack3, model: StackItemModel(percent: 32, horizontalAlignment: .trailing))], axis: .horizontal) stack = Stack.createStack(with: [(view: title, model: StackItemModel(horizontalAlignment: .leading)), (view: horizontalStack, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical, spacing: 0) super.init(style: style, reuseIdentifier: reuseIdentifier) From 8f12770e00cc98d6feb03238b27be26b31b8cf13 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Wed, 5 Aug 2020 17:20:53 +0530 Subject: [PATCH 3/9] Code changes after internal review. --- .../List/ThreeColumn/ListThreeColumnSpeedTest.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift index 1290a3d3..bf7cb43d 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift @@ -33,11 +33,11 @@ import Foundation verticalStack1 = Stack.createStack(with: [(view: topLeftHeadlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: bottomLeftHeadlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) verticalStack2 = Stack.createStack(with: [(view: topCenterHeadlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: bottomCenterHeadlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) verticalStack3 = Stack.createStack(with: [(view: topRightHeadlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: bottomRightHeadlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) - horizontalStack = Stack.createStack(with: [(view: verticalStack1, model: StackItemModel(percent: 36, horizontalAlignment: .leading)), - (view: verticalStack2, model: StackItemModel(percent: 32, horizontalAlignment: .leading)), - (view: verticalStack3, model: StackItemModel(percent: 32, horizontalAlignment: .trailing))], + horizontalStack = Stack.createStack(with: [(view: verticalStack1, model: StackItemModel(percent: 37, horizontalAlignment: .leading)), + (view: verticalStack2, model: StackItemModel(percent: 33, horizontalAlignment: .leading)), + (view: verticalStack3, model: StackItemModel(percent: 30, horizontalAlignment: .leading))], axis: .horizontal) - stack = Stack.createStack(with: [(view: title, model: StackItemModel(horizontalAlignment: .leading)), (view: horizontalStack, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical, spacing: 0) + stack = Stack.createStack(with: [(view: title, model: StackItemModel(horizontalAlignment: .leading)), (view: horizontalStack, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical, spacing: 2) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -50,6 +50,7 @@ import Foundation //------------------------------------------------------ open override func setupView() { super.setupView() + title.numberOfLines = 1 addMolecule(stack) stack.restack() verticalStack1.restack() @@ -86,6 +87,7 @@ import Foundation styleHeadlineBody(bottomRightHeadlineBody, false) } + //Method to style headline label and message label of HeadlineBody func styleHeadlineBody(_ headlineBody: HeadlineBody, _ isBodyMicro: Bool) { headlineBody.headlineLabel.setFontStyle(.RegularMicro) headlineBody.headlineLabel.textColor = .mvmCoolGray6 @@ -94,6 +96,7 @@ import Foundation headlineBody.messageLabel.setFontStyle(.RegularMicro) headlineBody.messageLabel.textColor = .mvmCoolGray6 } + headlineBody.spaceBetweenLabelsConstant = 2 } //-------------------------------------------------- From 96ebaaa3809e8667ca769531f038cb033be60029 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Fri, 7 Aug 2020 17:51:11 +0530 Subject: [PATCH 4/9] 22011(iOS - List - Three Column - Bill History - Divider) initial commit. --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++ MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 + .../ListThreeColumnBillHistoryDivider.swift | 80 +++++++++++++++++++ ...stThreeColumnBillHistoryDividerModel.swift | 66 +++++++++++++++ 4 files changed, 155 insertions(+) create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnBillHistoryDivider.swift create mode 100644 MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnBillHistoryDividerModel.swift diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 97f48227..208a22a2 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -240,6 +240,8 @@ 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 */; }; + AAB8549824DC01BD00477C40 /* ListThreeColumnBillHistoryDividerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB8549724DC01BD00477C40 /* ListThreeColumnBillHistoryDividerModel.swift */; }; + AAB8549A24DC01DB00477C40 /* ListThreeColumnBillHistoryDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB8549924DC01DB00477C40 /* ListThreeColumnBillHistoryDivider.swift */; }; AAB9C10824346F4B00151545 /* RadioSwatches.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB9C10724346F4B00151545 /* RadioSwatches.swift */; }; AAB9C10A243496DD00151545 /* RadioSwatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAB9C109243496DD00151545 /* RadioSwatch.swift */; }; AAC6F167243332E400F295C1 /* RadioSwatchesModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAC6F166243332E400F295C1 /* RadioSwatchesModel.swift */; }; @@ -717,6 +719,8 @@ AAA905E024D1759A00D1EFAB /* ListThreeColumnBillHistory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnBillHistory.swift; sourceTree = ""; }; AAB7EDEE246ADA1600E54929 /* ListProgressBarThinModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListProgressBarThinModel.swift; sourceTree = ""; }; AAB7EDF0246ADA2A00E54929 /* ListProgressBarThin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListProgressBarThin.swift; sourceTree = ""; }; + AAB8549724DC01BD00477C40 /* ListThreeColumnBillHistoryDividerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnBillHistoryDividerModel.swift; sourceTree = ""; }; + AAB8549924DC01DB00477C40 /* ListThreeColumnBillHistoryDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListThreeColumnBillHistoryDivider.swift; sourceTree = ""; }; AAB9C10724346F4B00151545 /* RadioSwatches.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSwatches.swift; sourceTree = ""; }; AAB9C109243496DD00151545 /* RadioSwatch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSwatch.swift; sourceTree = ""; }; AAC6F166243332E400F295C1 /* RadioSwatchesModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioSwatchesModel.swift; sourceTree = ""; }; @@ -1457,6 +1461,8 @@ AA1EC59824373994003D6F50 /* ListThreeColumnSpeedTestDivider.swift */, 8DEFA95B243DAC20000D27E5 /* ListThreeColumnDataUsageDividerModel.swift */, 8DEFA95D243DAC2F000D27E5 /* ListThreeColumnDataUsageDivider.swift */, + AAB8549724DC01BD00477C40 /* ListThreeColumnBillHistoryDividerModel.swift */, + AAB8549924DC01DB00477C40 /* ListThreeColumnBillHistoryDivider.swift */, ); path = ThreeColumn; sourceTree = ""; @@ -2309,6 +2315,7 @@ D2E2A99C23D8D975000B42E6 /* ImageHeadlineBodyModel.swift in Sources */, 525019DE2406430800EED91C /* ListProgressBarData.swift in Sources */, D28A837F23CCA96400DFE4FC /* TabsModel.swift in Sources */, + AAB8549A24DC01DB00477C40 /* ListThreeColumnBillHistoryDivider.swift in Sources */, 012A88EC238F084D00FE3DA1 /* FooterModel.swift in Sources */, 8DDD6C1F244D90E1006A2232 /* ListThreeColumnDataUsageModel.swift in Sources */, BB55B51F244482D2002001AD /* ListRightVariablePriceChangeBodyTextModel.swift in Sources */, @@ -2506,6 +2513,7 @@ BB2FB3BB247E7EBC00DF73CD /* TagCollectionViewCell.swift in Sources */, 012A88C6238DA34000FE3DA1 /* ModuleMoleculeModel.swift in Sources */, 94C2D9A123872BCC0006CF46 /* LabelAttributeUnderlineModel.swift in Sources */, + AAB8549824DC01BD00477C40 /* ListThreeColumnBillHistoryDividerModel.swift in Sources */, D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */, D2B1E3E522F37D6A0065F95C /* ImageHeadlineBody.swift in Sources */, 0A21DB94235E24ED00C160A2 /* DigitEntryField.swift in Sources */, diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index ef8e4573..248d3323 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -208,6 +208,7 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnSpeedTestDivider.self, viewModelClass: ListThreeColumnSpeedTestDividerModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnBillChangesDivider.self, viewModelClass: ListThreeColumnBillChangesDividerModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnDataUsageDivider.self, viewModelClass: ListThreeColumnDataUsageDividerModel.self) + MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnBillHistoryDivider.self, viewModelClass: ListThreeColumnBillHistoryDividerModel.self) // MARK:- Designed Headers MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnBillHistoryDivider.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnBillHistoryDivider.swift new file mode 100644 index 00000000..1246e98c --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnBillHistoryDivider.swift @@ -0,0 +1,80 @@ +// +// ListThreeColumnBillHistoryDivider.swift +// MVMCoreUI +// +// Created by Lekshmi S on 06/08/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation +@objcMembers open class ListThreeColumnBillHistoryDivider: TableViewCell { + //----------------------------------------------------- + // MARK: - Outlets + //------------------------------------------------------- + public let leftLabel = Label(fontStyle: .BoldBodySmall) + public let centerLabel = Label(fontStyle: .BoldBodySmall) + public let rightLabel = Label(fontStyle: .BoldBodySmall) + var stack: Stack + + //------------------------------------------------------ + // MARK: - Initializers + //------------------------------------------------------ + public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + stack = Stack.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 34, horizontalAlignment: .leading)), (view: centerLabel, model: StackItemModel(percent: 42, horizontalAlignment: .leading)), (view: rightLabel, model: StackItemModel(percent: 24, horizontalAlignment: .trailing))], 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() + 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? ListThreeColumnBillHistoryDividerModel 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(.BoldBodySmall) + centerLabel.setFontStyle(.BoldBodySmall) + rightLabel.setFontStyle(.BoldBodySmall) + } + + //-------------------------------------------------- + // 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 + } +} diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnBillHistoryDividerModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnBillHistoryDividerModel.swift new file mode 100644 index 00000000..807800bb --- /dev/null +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnBillHistoryDividerModel.swift @@ -0,0 +1,66 @@ +// +// ListThreeColumnBillHistoryDividerModel.swift +// MVMCoreUI +// +// Created by Lekshmi S on 06/08/20. +// Copyright © 2020 Verizon Wireless. All rights reserved. +// + +import Foundation +public class ListThreeColumnBillHistoryDividerModel: ListItemModel, MoleculeModelProtocol { + //----------------------------------------------------- + // MARK: - Properties + //----------------------------------------------------- + public static var identifier: String = "list3CBillHisDiv" + 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: - Method + //----------------------------------------------------- + override public func setDefaults() { + style = .tallDivider + super.setDefaults() + } + + //----------------------------------------------------- + // 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) + } +} From 0256ede110a8fdeebe1042b3e316147c7fe765f6 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 10 Aug 2020 14:45:54 -0400 Subject: [PATCH 5/9] update --- MVMCoreUI/Atomic/MoleculeObjectMapping.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift index 27123d63..f5b91c52 100644 --- a/MVMCoreUI/Atomic/MoleculeObjectMapping.swift +++ b/MVMCoreUI/Atomic/MoleculeObjectMapping.swift @@ -127,7 +127,6 @@ import Foundation MoleculeObjectMapping.shared()?.register(viewClass: HeadlineBodyToggle.self, viewModelClass: HeadlineBodyToggleModel.self) MoleculeObjectMapping.shared()?.register(viewClass: HeadlineBodyLinkToggle.self, viewModelClass: HeadlineBodyLinkToggleModel.self) MoleculeObjectMapping.shared()?.register(viewClass: ActionDetailWithImage.self, viewModelClass: ActionDetailWithImageModel.self) - MoleculeObjectMapping.shared()?.register(viewClass: LockupsPlanSMLXL.self, viewModelClass: LockupsPlanSMLXLModel.self) // MARK:- List items MoleculeObjectMapping.shared()?.register(viewClass: MoleculeTableViewCell.self, viewModelClass: MoleculeListItemModel.self) From 25ce6b285ff9074bf700c9c7d26c7b0df002c3e8 Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 11 Aug 2020 18:02:41 +0530 Subject: [PATCH 6/9] Code changes as per review comment. --- .../ListThreeColumnSpeedTest.swift | 57 ++++++------------- .../ListThreeColumnSpeedTestModel.swift | 24 ++++++++ 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift index bf7cb43d..f3070959 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift @@ -14,30 +14,22 @@ import Foundation //------------------------------------------------------- public var title = Label(fontStyle: .RegularMicro) public var topLeftHeadlineBody = HeadlineBody() - public var bottomLeftHeadlineBody = HeadlineBody() - public var verticalStack1: Stack public var topCenterHeadlineBody = HeadlineBody() - public var bottomCenterHeadlineBody = HeadlineBody() - public var verticalStack2: Stack public var topRightHeadlineBody = HeadlineBody() + public var tophorizontalStack: Stack + public var bottomLeftHeadlineBody = HeadlineBody() + public var bottomCenterHeadlineBody = HeadlineBody() public var bottomRightHeadlineBody = HeadlineBody() - public var verticalStack3: Stack - public var horizontalStack: Stack + public var bottomhorizontalStack: Stack public var stack: Stack //------------------------------------------------------ // MARK: - Initializers //------------------------------------------------------ public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - - verticalStack1 = Stack.createStack(with: [(view: topLeftHeadlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: bottomLeftHeadlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) - verticalStack2 = Stack.createStack(with: [(view: topCenterHeadlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: bottomCenterHeadlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) - verticalStack3 = Stack.createStack(with: [(view: topRightHeadlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: bottomRightHeadlineBody, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) - horizontalStack = Stack.createStack(with: [(view: verticalStack1, model: StackItemModel(percent: 37, horizontalAlignment: .leading)), - (view: verticalStack2, model: StackItemModel(percent: 33, horizontalAlignment: .leading)), - (view: verticalStack3, model: StackItemModel(percent: 30, horizontalAlignment: .leading))], - axis: .horizontal) - stack = Stack.createStack(with: [(view: title, model: StackItemModel(horizontalAlignment: .leading)), (view: horizontalStack, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical, spacing: 2) + tophorizontalStack = Stack.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.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) + stack = Stack.createStack(with: [(view: title, model: StackItemModel(horizontalAlignment: .leading)), (view: tophorizontalStack, model: StackItemModel(spacing: 2, horizontalAlignment: .leading)), (view: bottomhorizontalStack, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -53,10 +45,8 @@ import Foundation title.numberOfLines = 1 addMolecule(stack) stack.restack() - verticalStack1.restack() - verticalStack2.restack() - verticalStack3.restack() - horizontalStack.restack() + tophorizontalStack.restack() + bottomhorizontalStack.restack() } //-------------------------------------------------- @@ -66,9 +56,8 @@ import Foundation super.set(with: model, delegateObject, additionalData) guard let model = model as? ListThreeColumnSpeedTestModel else { return } title.set(with: model.title, delegateObject, additionalData) - verticalStack1.updateContainedMolecules(with: [model.topLeftHeadlineBody, model.bottomLeftHeadlineBody], delegateObject, additionalData) - verticalStack2.updateContainedMolecules(with: [model.topCenterHeadlineBody, model.bottomCenterHeadlineBody], delegateObject, additionalData) - verticalStack3.updateContainedMolecules(with: [model.topRightHeadlineBody, model.bottomRightHeadlineBody], delegateObject, additionalData) + tophorizontalStack.updateContainedMolecules(with: [model.topLeftHeadlineBody, model.topCenterHeadlineBody, model.topRightHeadlineBody], delegateObject, additionalData) + bottomhorizontalStack.updateContainedMolecules(with: [model.bottomLeftHeadlineBody, model.bottomCenterHeadlineBody, model.bottomRightHeadlineBody], delegateObject, additionalData) updateAccessibilityLabel() } @@ -79,24 +68,12 @@ import Foundation open override func reset() { super.reset() title.setFontStyle(.BoldBodySmall) - styleHeadlineBody(topLeftHeadlineBody, true) - styleHeadlineBody(bottomLeftHeadlineBody, false) - styleHeadlineBody(topCenterHeadlineBody, false) - styleHeadlineBody(bottomCenterHeadlineBody, false) - styleHeadlineBody(topRightHeadlineBody, false) - styleHeadlineBody(bottomRightHeadlineBody, false) - } - - //Method to style headline label and message label of HeadlineBody - func styleHeadlineBody(_ headlineBody: HeadlineBody, _ isBodyMicro: Bool) { - headlineBody.headlineLabel.setFontStyle(.RegularMicro) - headlineBody.headlineLabel.textColor = .mvmCoolGray6 - headlineBody.messageLabel.setFontStyle(.RegularBodySmall) - if isBodyMicro { - headlineBody.messageLabel.setFontStyle(.RegularMicro) - headlineBody.messageLabel.textColor = .mvmCoolGray6 - } - headlineBody.spaceBetweenLabelsConstant = 2 + topLeftHeadlineBody.spaceBetweenLabelsConstant = 2 + topCenterHeadlineBody.spaceBetweenLabelsConstant = 2 + topRightHeadlineBody.spaceBetweenLabelsConstant = 2 + bottomLeftHeadlineBody.spaceBetweenLabelsConstant = 2 + bottomCenterHeadlineBody.spaceBetweenLabelsConstant = 2 + bottomRightHeadlineBody.spaceBetweenLabelsConstant = 2 } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTestModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTestModel.swift index 1ba62c2f..24f8c160 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTestModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTestModel.swift @@ -35,6 +35,30 @@ public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol super.init() } + //------------------------------------------------------ + // MARK: - Method + //------------------------------------------------------ + override public func setDefaults() { + styleHeadlineBody(topLeftHeadlineBody, true) + styleHeadlineBody(bottomLeftHeadlineBody, false) + styleHeadlineBody(topCenterHeadlineBody, false) + styleHeadlineBody(bottomCenterHeadlineBody, false) + styleHeadlineBody(topRightHeadlineBody, false) + styleHeadlineBody(bottomRightHeadlineBody, false) + super.setDefaults() + } + + //Method to style headline and body of HeadlineBody + func styleHeadlineBody(_ headlineBodyModel: HeadlineBodyModel, _ isBodyMicro: Bool) { + headlineBodyModel.headline?.fontStyle = .RegularMicro + headlineBodyModel.headline?.textColor = Color(uiColor: .mvmCoolGray6) + headlineBodyModel.body?.fontStyle = .RegularBodySmall + if isBodyMicro { + headlineBodyModel.body?.fontStyle = .RegularMicro + headlineBodyModel.body?.textColor = Color(uiColor: .mvmCoolGray6) + } + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- From 83d15aeba4f91ca734c744313c79d2f84110eb55 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 13 Aug 2020 09:33:20 -0400 Subject: [PATCH 7/9] small corrections --- .../ListThreeColumnSpeedTest.swift | 19 +++++++++---------- .../ListThreeColumnSpeedTestModel.swift | 3 ++- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift index f3070959..28feb481 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTest.swift @@ -16,20 +16,20 @@ import Foundation public var topLeftHeadlineBody = HeadlineBody() public var topCenterHeadlineBody = HeadlineBody() public var topRightHeadlineBody = HeadlineBody() - public var tophorizontalStack: Stack + public var topHorizontalStack: Stack public var bottomLeftHeadlineBody = HeadlineBody() public var bottomCenterHeadlineBody = HeadlineBody() public var bottomRightHeadlineBody = HeadlineBody() - public var bottomhorizontalStack: Stack + public var bottomHorizontalStack: Stack public var stack: Stack //------------------------------------------------------ // MARK: - Initializers //------------------------------------------------------ public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - tophorizontalStack = Stack.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.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) - stack = Stack.createStack(with: [(view: title, model: StackItemModel(horizontalAlignment: .leading)), (view: tophorizontalStack, model: StackItemModel(spacing: 2, horizontalAlignment: .leading)), (view: bottomhorizontalStack, model: StackItemModel(horizontalAlignment: .leading))], axis: .vertical) + topHorizontalStack = Stack.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.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) + stack = Stack.createStack(with: [(view: title, model: StackItemModel()), (view: topHorizontalStack, model: StackItemModel(spacing: 2)), (view: bottomHorizontalStack, model: StackItemModel())], axis: .vertical) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -42,11 +42,10 @@ import Foundation //------------------------------------------------------ open override func setupView() { super.setupView() - title.numberOfLines = 1 addMolecule(stack) stack.restack() - tophorizontalStack.restack() - bottomhorizontalStack.restack() + topHorizontalStack.restack() + bottomHorizontalStack.restack() } //-------------------------------------------------- @@ -56,8 +55,8 @@ import Foundation 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) + topHorizontalStack.updateContainedMolecules(with: [model.topLeftHeadlineBody, model.topCenterHeadlineBody, model.topRightHeadlineBody], delegateObject, additionalData) + bottomHorizontalStack.updateContainedMolecules(with: [model.bottomLeftHeadlineBody, model.bottomCenterHeadlineBody, model.bottomRightHeadlineBody], delegateObject, additionalData) updateAccessibilityLabel() } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTestModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTestModel.swift index 24f8c160..45a9af13 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTestModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ThreeColumn/ListThreeColumnSpeedTestModel.swift @@ -52,10 +52,11 @@ public class ListThreeColumnSpeedTestModel: ListItemModel, MoleculeModelProtocol func styleHeadlineBody(_ headlineBodyModel: HeadlineBodyModel, _ isBodyMicro: Bool) { headlineBodyModel.headline?.fontStyle = .RegularMicro headlineBodyModel.headline?.textColor = Color(uiColor: .mvmCoolGray6) - headlineBodyModel.body?.fontStyle = .RegularBodySmall if isBodyMicro { headlineBodyModel.body?.fontStyle = .RegularMicro headlineBodyModel.body?.textColor = Color(uiColor: .mvmCoolGray6) + } else { + headlineBodyModel.body?.fontStyle = .RegularBodySmall } } From c5762ba4d4b87b8d91f4dff2b369aaffc6b23455 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 13 Aug 2020 15:22:32 -0400 Subject: [PATCH 8/9] font update --- .../Molecules/NavigationBar/Buttons/LabelBarButtonItem.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/LabelBarButtonItem.swift b/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/LabelBarButtonItem.swift index 4d31a84c..a2c18e08 100644 --- a/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/LabelBarButtonItem.swift +++ b/MVMCoreUI/Atomic/Molecules/NavigationBar/Buttons/LabelBarButtonItem.swift @@ -18,6 +18,7 @@ import Foundation let actionObject = ActionDelegate() let button = self.init(title: title, style: .plain, target: actionObject, action: #selector(actionObject.callActionBlock(_:))) button.actionDelegate = actionObject + button.setTitleTextAttributes([NSAttributedString.Key.font: Styler.Font.RegularBodySmall], for: .normal) return button } From 8ef38be8dd59e6a50334bdd7d4d59631dd7a1b23 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Thu, 13 Aug 2020 16:21:28 -0400 Subject: [PATCH 9/9] update font for primary button --- MVMCoreUI/Styles/MFStyler.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MVMCoreUI/Styles/MFStyler.m b/MVMCoreUI/Styles/MFStyler.m index 213c205e..130b4c7a 100644 --- a/MVMCoreUI/Styles/MFStyler.m +++ b/MVMCoreUI/Styles/MFStyler.m @@ -468,17 +468,17 @@ CGFloat const LabelWithInternalButtonLineSpace = 2; } + (nullable UIFont *)fontForPrimaryButton:(BOOL)genericScaling { - CGFloat size = 14; + CGFloat size = 13; if (genericScaling) { size = [self sizeFontGenericForCurrentDevice:size]; } - return [MFFonts mfFont75Bd:size]; + return [MFFonts mfFontTXBold:size]; } + (nullable UIFont *)fontForPrimaryButtonForWidth:(CGFloat)size { - CGFloat pointSize = 14; + CGFloat pointSize = 13; pointSize = [[MFStyler sizeObjectGenericForCurrentDevice:pointSize] getValueBasedOnSize:size]; - return [MFFonts mfFont75Bd:pointSize]; + return [MFFonts mfFontTXBold:pointSize]; } + (nullable UIFont *)fontForSmallButton:(BOOL)genericScaling { @@ -486,13 +486,13 @@ CGFloat const LabelWithInternalButtonLineSpace = 2; if (genericScaling) { size = [self sizeFontGenericForCurrentDevice:size]; } - return [MFFonts mfFont75Bd:size]; + return [MFFonts mfFontTXBold:size]; } + (nullable UIFont *)fontForSmallButtonForWidth:(CGFloat)size { CGFloat pointSize = 11; pointSize = [[MFStyler sizeObjectGenericForCurrentDevice:pointSize] getValueBasedOnSize:size]; - return [MFFonts mfFont75Bd:pointSize]; + return [MFFonts mfFontTXBold:pointSize]; } + (nullable UIFont *)fontForTextField:(BOOL)genericScaling {