From 5a4805d1a4fb27c76fe5857aa550fd0a354626a6 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Tue, 21 Apr 2020 16:26:59 +0530 Subject: [PATCH] Applied styles as per confluence --- .../List/ListDeviceComplexButtonMedium.swift | 43 +++++++++++-------- .../ListDeviceComplexButtonMediumModel.swift | 7 --- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListDeviceComplexButtonMedium.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListDeviceComplexButtonMedium.swift index 435ef03f..3d1971fa 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListDeviceComplexButtonMedium.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListDeviceComplexButtonMedium.swift @@ -9,28 +9,31 @@ import Foundation @objcMembers open class ListDeviceComplexButtonMedium: TableViewCell { - public var stack: Stack + public var verticalStack: Stack public let eyebrow = Label.commonLabelB3(true) public let headline = Label.commonLabelB1(true) public let body = Label.commonLabelB2(true) public let body2 = Label.commonLabelB2(true) - public let button = Button(frame: .zero) + public let button = PillButton(frame: .zero) public let rightImageView = MFLoadImageView(pinnedEdges: .all) - public var imageViewStack: Stack - + public var stack: Stack + // MARK: - Initializers public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - stack = Stack.createStack(with: [(view: eyebrow, model: StackItemModel(horizontalAlignment: .leading)), - (view: headline, model: StackItemModel(horizontalAlignment: .leading)), - (view: body, model: StackItemModel(horizontalAlignment: .leading)), - (view: body2, model: StackItemModel(horizontalAlignment: .leading)), - (view: button, model: StackItemModel(horizontalAlignment: .leading))], - axis: .vertical) - imageViewStack = Stack.createStack(with: [(view: stack, model: StackItemModel(horizontalAlignment: .leading)), - (view: rightImageView, model: StackItemModel(horizontalAlignment: .fill,verticalAlignment: .center))], - axis: .horizontal,spacing: 10) + rightImageView.heightAnchor.constraint(equalToConstant: 116.0).isActive = true + rightImageView.widthAnchor.constraint(equalToConstant: 116.0).isActive = true + + verticalStack = Stack.createStack(with: [(view: eyebrow, model: StackItemModel(horizontalAlignment: .leading)), + (view: headline, model: StackItemModel(horizontalAlignment: .leading)), + (view: body, model: StackItemModel(horizontalAlignment: .leading)), + (view: body2, model: StackItemModel(horizontalAlignment: .leading)), + (view: button, model: StackItemModel(spacing:10,horizontalAlignment: .leading))], + axis: .vertical,spacing: 0) + stack = Stack.createStack(with: [(view: verticalStack, model: StackItemModel(horizontalAlignment: .leading,verticalAlignment: .center)), + (view: rightImageView, model: StackItemModel(horizontalAlignment: .fill,verticalAlignment: .center))], + axis: .horizontal,spacing: 10) super.init(style: style, reuseIdentifier: reuseIdentifier) } @@ -43,6 +46,7 @@ import Foundation super.setupView() addMolecule(stack) stack.restack() + verticalStack.restack() } // MARK: - ModelMoleculeViewProtocol @@ -52,7 +56,7 @@ import Foundation eyebrow.setOptional(with: model.eyebrow, delegateObject, additionalData) headline.setOptional(with: model.headline, delegateObject, additionalData) body.setOptional(with: model.body, delegateObject, additionalData) - body2.setOptional(with: model.body, delegateObject, additionalData) + body2.setOptional(with: model.body2, delegateObject, additionalData) button.set(with: model.button, delegateObject, additionalData) rightImageView.set(with: model.image, delegateObject, additionalData) } @@ -60,13 +64,16 @@ import Foundation open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat { return 120 } - - open override func reset() { - super.reset() + public func setDefault() { eyebrow.styleRegularMicro(true) headline.styleBoldTitleMedium(true) body.styleRegularBodySmall(true) body2.styleRegularBodySmall(true) - + eyebrow.textColor = .mvmCoolGray6 + } + + open override func reset() { + super.reset() + setDefault() } } diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListDeviceComplexButtonMediumModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListDeviceComplexButtonMediumModel.swift index 5325f8ee..7f676795 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListDeviceComplexButtonMediumModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/ListDeviceComplexButtonMediumModel.swift @@ -15,8 +15,6 @@ public class ListDeviceComplexButtonMediumModel: ListItemModel, MoleculeModelPro public var body2: LabelModel? public var button: ButtonModel public var image: ImageViewModel - - public init(eyebrow: LabelModel, headline:LabelModel, body: LabelModel, body2: LabelModel, button: ButtonModel, image: ImageViewModel) { self.eyebrow = eyebrow @@ -31,11 +29,6 @@ public class ListDeviceComplexButtonMediumModel: ListItemModel, MoleculeModelPro /// Defaults to set override public func setDefaults() { super.setDefaults() - eyebrow?.fontStyle = .RegularMicro - eyebrow?.textColor = Color(uiColor: .mvmCoolGray6) - headline?.fontStyle = .BoldTitleMedium - body?.fontStyle = .RegularBodySmall - body2?.fontStyle = .RegularBodySmall button.size = .tiny button.style = .secondary }