Applied styles as per confluence
This commit is contained in:
parent
e5a5415dd3
commit
5a4805d1a4
@ -9,28 +9,31 @@
|
||||
import Foundation
|
||||
@objcMembers open class ListDeviceComplexButtonMedium: TableViewCell {
|
||||
|
||||
public var stack: Stack<StackModel>
|
||||
public var verticalStack: Stack<StackModel>
|
||||
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<StackModel>
|
||||
|
||||
public var stack: Stack<StackModel>
|
||||
|
||||
|
||||
|
||||
// MARK: - Initializers
|
||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
stack = Stack<StackModel>.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<StackModel>.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<StackModel>.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<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)
|
||||
}
|
||||
|
||||
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user