Applied styles as per confluence
This commit is contained in:
parent
e5a5415dd3
commit
5a4805d1a4
@ -9,28 +9,31 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
@objcMembers open class ListDeviceComplexButtonMedium: TableViewCell {
|
@objcMembers open class ListDeviceComplexButtonMedium: TableViewCell {
|
||||||
|
|
||||||
public var stack: Stack<StackModel>
|
public var verticalStack: Stack<StackModel>
|
||||||
public let eyebrow = Label.commonLabelB3(true)
|
public let eyebrow = Label.commonLabelB3(true)
|
||||||
public let headline = Label.commonLabelB1(true)
|
public let headline = Label.commonLabelB1(true)
|
||||||
public let body = Label.commonLabelB2(true)
|
public let body = Label.commonLabelB2(true)
|
||||||
public let body2 = 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 let rightImageView = MFLoadImageView(pinnedEdges: .all)
|
||||||
public var imageViewStack: Stack<StackModel>
|
public var stack: Stack<StackModel>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
stack = Stack<StackModel>.createStack(with: [(view: eyebrow, model: StackItemModel(horizontalAlignment: .leading)),
|
rightImageView.heightAnchor.constraint(equalToConstant: 116.0).isActive = true
|
||||||
(view: headline, model: StackItemModel(horizontalAlignment: .leading)),
|
rightImageView.widthAnchor.constraint(equalToConstant: 116.0).isActive = true
|
||||||
(view: body, model: StackItemModel(horizontalAlignment: .leading)),
|
|
||||||
(view: body2, model: StackItemModel(horizontalAlignment: .leading)),
|
verticalStack = Stack<StackModel>.createStack(with: [(view: eyebrow, model: StackItemModel(horizontalAlignment: .leading)),
|
||||||
(view: button, model: StackItemModel(horizontalAlignment: .leading))],
|
(view: headline, model: StackItemModel(horizontalAlignment: .leading)),
|
||||||
axis: .vertical)
|
(view: body, model: StackItemModel(horizontalAlignment: .leading)),
|
||||||
imageViewStack = Stack<StackModel>.createStack(with: [(view: stack, model: StackItemModel(horizontalAlignment: .leading)),
|
(view: body2, model: StackItemModel(horizontalAlignment: .leading)),
|
||||||
(view: rightImageView, model: StackItemModel(horizontalAlignment: .fill,verticalAlignment: .center))],
|
(view: button, model: StackItemModel(spacing:10,horizontalAlignment: .leading))],
|
||||||
axis: .horizontal,spacing: 10)
|
axis: .vertical,spacing: 0)
|
||||||
|
stack = Stack<StackModel>.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)
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,6 +46,7 @@ import Foundation
|
|||||||
super.setupView()
|
super.setupView()
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
|
verticalStack.restack()
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - ModelMoleculeViewProtocol
|
// MARK: - ModelMoleculeViewProtocol
|
||||||
@ -52,7 +56,7 @@ import Foundation
|
|||||||
eyebrow.setOptional(with: model.eyebrow, delegateObject, additionalData)
|
eyebrow.setOptional(with: model.eyebrow, delegateObject, additionalData)
|
||||||
headline.setOptional(with: model.headline, delegateObject, additionalData)
|
headline.setOptional(with: model.headline, delegateObject, additionalData)
|
||||||
body.setOptional(with: model.body, 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)
|
button.set(with: model.button, delegateObject, additionalData)
|
||||||
rightImageView.set(with: model.image, 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 {
|
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||||
return 120
|
return 120
|
||||||
}
|
}
|
||||||
|
public func setDefault() {
|
||||||
open override func reset() {
|
|
||||||
super.reset()
|
|
||||||
eyebrow.styleRegularMicro(true)
|
eyebrow.styleRegularMicro(true)
|
||||||
headline.styleBoldTitleMedium(true)
|
headline.styleBoldTitleMedium(true)
|
||||||
body.styleRegularBodySmall(true)
|
body.styleRegularBodySmall(true)
|
||||||
body2.styleRegularBodySmall(true)
|
body2.styleRegularBodySmall(true)
|
||||||
|
eyebrow.textColor = .mvmCoolGray6
|
||||||
|
}
|
||||||
|
|
||||||
|
open override func reset() {
|
||||||
|
super.reset()
|
||||||
|
setDefault()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,8 +15,6 @@ public class ListDeviceComplexButtonMediumModel: ListItemModel, MoleculeModelPro
|
|||||||
public var body2: LabelModel?
|
public var body2: LabelModel?
|
||||||
public var button: ButtonModel
|
public var button: ButtonModel
|
||||||
public var image: ImageViewModel
|
public var image: ImageViewModel
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public init(eyebrow: LabelModel, headline:LabelModel, body: LabelModel, body2: LabelModel, button: ButtonModel, image: ImageViewModel) {
|
public init(eyebrow: LabelModel, headline:LabelModel, body: LabelModel, body2: LabelModel, button: ButtonModel, image: ImageViewModel) {
|
||||||
self.eyebrow = eyebrow
|
self.eyebrow = eyebrow
|
||||||
@ -31,11 +29,6 @@ public class ListDeviceComplexButtonMediumModel: ListItemModel, MoleculeModelPro
|
|||||||
/// Defaults to set
|
/// Defaults to set
|
||||||
override public func setDefaults() {
|
override public func setDefaults() {
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
eyebrow?.fontStyle = .RegularMicro
|
|
||||||
eyebrow?.textColor = Color(uiColor: .mvmCoolGray6)
|
|
||||||
headline?.fontStyle = .BoldTitleMedium
|
|
||||||
body?.fontStyle = .RegularBodySmall
|
|
||||||
body2?.fontStyle = .RegularBodySmall
|
|
||||||
button.size = .tiny
|
button.size = .tiny
|
||||||
button.style = .secondary
|
button.style = .secondary
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user