slight cleanup
This commit is contained in:
parent
c8183103f7
commit
1e03009142
@ -13,14 +13,13 @@ import UIKit
|
||||
//-----------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//-----------------------------------------------------
|
||||
|
||||
let progressBar = MultiProgress(frame: .zero)
|
||||
let leftLabel = Label.commonLabelB1(true)
|
||||
let rightLabel = Label.commonLabelB1(true)
|
||||
let view = View()
|
||||
let leftLabel = Label.createLabelBoldBodySmall(true)
|
||||
let rightLabel = Label.createLabelBoldBodySmall(true)
|
||||
let view = MVMCoreUICommonViewsUtility.commonView()
|
||||
|
||||
//-----------------------------------------------------
|
||||
// MARK: - View Lifecycle
|
||||
// MARK: - MFViewProtocol
|
||||
//-----------------------------------------------------
|
||||
override open func setupView() {
|
||||
super.setupView()
|
||||
@ -29,34 +28,46 @@ import UIKit
|
||||
view.addSubview(progressBar)
|
||||
view.addSubview(leftLabel)
|
||||
view.addSubview(rightLabel)
|
||||
addMolecule(view)
|
||||
NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: rightLabel, alignTop: false)
|
||||
contentView.addSubview(view)
|
||||
containerHelper.constrainView(view)
|
||||
NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: rightLabel, alignTop: true, bottomAnchor: progressBar.topAnchor, constant: 8)
|
||||
progressBar.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
|
||||
progressBar.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
|
||||
progressBar.topAnchor.constraint(equalTo: leftLabel.bottomAnchor, constant: 8).isActive = true
|
||||
view.bottomAnchor.constraint(equalTo: progressBar.bottomAnchor).isActive = true
|
||||
}
|
||||
|
||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||
open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
super.setWithModel(model, delegateObject, additionalData)
|
||||
guard let model = model as? ListProgressBarDataModel else { return}
|
||||
progressBar.setWithModel(model.progressBar, delegateObject, additionalData)
|
||||
leftLabel.setWithModel(model.leftLabel, delegateObject, additionalData)
|
||||
rightLabel.setWithModel(model.rightLabel, delegateObject, additionalData)
|
||||
public override func updateView(_ size: CGFloat) {
|
||||
super.updateView(size)
|
||||
progressBar.updateView(size)
|
||||
leftLabel.updateView(size)
|
||||
rightLabel.updateView(size)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
// MARK: - ModelMoleculeViewProtocol
|
||||
//-----------------------------------------------------
|
||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
guard let model = model as? ListProgressBarDataModel else { return}
|
||||
progressBar.set(with: model.progressBar, delegateObject, additionalData)
|
||||
leftLabel.set(with: model.leftLabel, delegateObject, additionalData)
|
||||
rightLabel.set(with: model.rightLabel, delegateObject, additionalData)
|
||||
}
|
||||
|
||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||
return 90
|
||||
}
|
||||
|
||||
//-----------------------------------------------------
|
||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||
//-----------------------------------------------------
|
||||
override open func reset() {
|
||||
super.reset()
|
||||
progressBar.reset()
|
||||
leftLabel.reset()
|
||||
rightLabel.reset()
|
||||
leftLabel.styleB1(true)
|
||||
rightLabel.styleB1(true)
|
||||
}
|
||||
|
||||
open override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||
return 90
|
||||
leftLabel.styleBoldBodySmall(true)
|
||||
rightLabel.styleBoldBodySmall(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ import Foundation
|
||||
stack.restack()
|
||||
}
|
||||
|
||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||
// MARK: - ModelMoleculeViewProtocol
|
||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
guard let model = model as? ListFourColumnDataUsageDividerModel else { return }
|
||||
@ -48,6 +48,10 @@ import Foundation
|
||||
label4.set(with: model.label4, delegateObject, additionalData)
|
||||
}
|
||||
|
||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||
return 121
|
||||
}
|
||||
|
||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||
open override func reset() {
|
||||
super.reset()
|
||||
@ -56,8 +60,4 @@ import Foundation
|
||||
label3.styleBoldBodySmall(true)
|
||||
label4.styleBoldBodySmall(true)
|
||||
}
|
||||
|
||||
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||
return 121
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ import Foundation
|
||||
stack.restack()
|
||||
}
|
||||
|
||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||
// MARK: - ModelMoleculeViewProtocol
|
||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
guard let model = model as? ListThreeColumnPlanDataDividerModel else { return }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user