From 50ef2ff6cced48e09041937311490ada1ff5082d Mon Sep 17 00:00:00 2001 From: Kruthika KP <> Date: Tue, 17 Mar 2020 16:04:59 +0530 Subject: [PATCH] Line style changes --- .../RightVariable/ListRightVariableTotalDataCaret.swift | 6 +++--- .../ListRightVariableTotalDataCaretModel.swift | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift index 1cbffb7b..0be49a32 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaret.swift @@ -28,7 +28,6 @@ import Foundation (view: rightLabel, model: StackItemModel(horizontalAlignment: .fill))], axis: .horizontal) bar.widthAnchor.constraint(equalToConstant: 20).isActive = true - super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -42,7 +41,8 @@ import Foundation override open func setupView() { super.setupView() - rightLabel.setContentCompressionResistancePriority(UILayoutPriority(901), for: .horizontal) + rightLabel.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal) + bar.setStyle(.heavy) addMolecule(stack) } @@ -56,7 +56,7 @@ import Foundation } open override class func estimatedHeight(with molecule: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat?{ - return 90 + return 80 } open override func reset() { diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift index c5912a37..6d1ba0c5 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/RightVariable/ListRightVariableTotalDataCaretModel.swift @@ -18,6 +18,10 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc override public func setDefaults() { super.setDefaults() rightLabel.hero = 0 + bar.type = .heavy + if bar.backgroundColor == nil { + bar.backgroundColor = Color(uiColor: .mvmBlue) + } } public init (leftLabel: LabelModel, rightlabel:LabelModel, bar: LineModel){ @@ -25,7 +29,6 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc self.rightLabel = rightlabel self.bar = bar super.init() - setDefaults() } private enum CodingKeys: String, CodingKey{ @@ -35,6 +38,7 @@ public class ListRightVariableTotalDataModel: ListItemModel, MoleculeModelProtoc case bar } + required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) leftLabel = try typeContainer.decode(LabelModel.self, forKey: .leftLabel)