updated as per confluence

This commit is contained in:
Damodaram 2020-04-15 15:57:57 +05:30
parent 73403b8948
commit 594a45894e
2 changed files with 13 additions and 19 deletions

View File

@ -13,18 +13,18 @@ import Foundation
// MARK: - Outlets
//-----------------------------------------------------
public var stack: Stack<StackModel>
public let eyebrowHeadlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero)
public let headlineBodyLink = EyebrowHeadlineBodyLink(frame: .zero)
public let rightLabel = Label.commonLabelB2(true)
public let arrow = Arrow(frame: .zero)
let arrowAndrightLabelStack: Stack<StackModel>
let arrowAndRightLabelStack: Stack<StackModel>
// MARK: - Initializers
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
arrowAndrightLabelStack = Stack<StackModel>.createStack(with: [(view: arrow, model: StackItemModel(horizontalAlignment: .fill)),
(view: rightLabel, model: StackItemModel(horizontalAlignment: .leading))],
axis: .horizontal, spacing: 4)
stack = Stack<StackModel>.createStack(with: [(view: eyebrowHeadlineBodyLink, model: StackItemModel(percent:70,horizontalAlignment: .leading)),
(view: arrowAndrightLabelStack, model: StackItemModel(percent:30,horizontalAlignment: .trailing,verticalAlignment: .top))],
arrowAndRightLabelStack = Stack<StackModel>.createStack(with: [(view: arrow, model: StackItemModel(horizontalAlignment: .fill)),
(view: rightLabel, model: StackItemModel(horizontalAlignment: .leading))],
axis: .horizontal, spacing: 6)
stack = Stack<StackModel>.createStack(with: [(view: headlineBodyLink, model: StackItemModel(percent:70,horizontalAlignment: .leading)),
(view: arrowAndRightLabelStack, model: StackItemModel(percent:30,horizontalAlignment: .trailing,verticalAlignment: .top))],
axis: .horizontal)
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
@ -41,14 +41,13 @@ import Foundation
arrow.pinHeightAndWidth()
addMolecule(stack)
stack.restack()
arrowAndrightLabelStack.restack()
arrowAndRightLabelStack.restack()
}
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? ListRightVariablePriceChangeBodyTextModel else { return }
eyebrowHeadlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
headlineBodyLink.set(with: model.eyebrowHeadlineBodyLink, delegateObject, additionalData)
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
arrow.set(with: model.arrow, delegateObject, additionalData)
}
@ -56,8 +55,9 @@ import Foundation
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
return 120
}
open override func reset() {
super.reset()
rightLabel.styleB2(true)
}
super.reset()
rightLabel.styleB2(true)
}
}

View File

@ -13,8 +13,6 @@ public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeM
public var rightLabel: LabelModel
public var arrow: ArrowModel
public init(eyebrowHeadlineBodyLink: EyebrowHeadlineBodyLinkModel,rightLabel: LabelModel,arrow: ArrowModel) {
self.eyebrowHeadlineBodyLink = eyebrowHeadlineBodyLink
self.rightLabel = rightLabel
@ -22,8 +20,6 @@ public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeM
super.init()
}
private enum CodingKeys: String, CodingKey {
case moleculeName
case eyebrowHeadlineBodyLink
@ -36,7 +32,6 @@ public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeM
eyebrowHeadlineBodyLink = try typeContainer.decode(EyebrowHeadlineBodyLinkModel.self, forKey: .eyebrowHeadlineBodyLink)
rightLabel = try typeContainer.decode(LabelModel.self, forKey: .rightLabel)
arrow = try typeContainer.decode(ArrowModel.self, forKey: .arrow)
try super.init(from: decoder)
}
@ -47,6 +42,5 @@ public class ListRightVariablePriceChangeBodyTextModel: ListItemModel, MoleculeM
try container.encode(eyebrowHeadlineBodyLink, forKey: .eyebrowHeadlineBodyLink)
try container.encode(rightLabel, forKey: .rightLabel)
try container.encode(arrow, forKey: .arrow)
}
}