diff --git a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift index 06d63845..466439a1 100644 --- a/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift +++ b/MVMCoreUI/Molecules/DesignedComponents/List/LeftVariable/ListProgressBarData.swift @@ -19,7 +19,6 @@ import UIKit let leftLabel = Label.commonLabelB1(true) let rightLabel = Label.commonLabelB1(true) let view = View() - let horizontalPadding = MFStyler.defaultHorizontalPaddingForApplicationWidth() //----------------------------------------------------- // MARK: - View Lifecycle @@ -35,10 +34,7 @@ import UIKit override open func setupView() { super.setupView() - guard leftLabel.superview == nil else { - return - } - + contentView.addSubview(view) view.addSubview(progressBar) view.addSubview(leftLabel) @@ -47,30 +43,17 @@ import UIKit //constraints - leftLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true - leftLabel.topAnchor.constraint(equalTo: view.topAnchor).isActive = true - - rightLabel.leadingAnchor.constraint(greaterThanOrEqualTo: leftLabel.trailingAnchor,constant: horizontalPadding).isActive = true - rightLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true - rightLabel.topAnchor.constraint(equalTo: view.topAnchor).isActive = true - + NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: rightLabel, alignTop: false) progressBar.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true progressBar.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true progressBar.topAnchor.constraint(equalTo: leftLabel.bottomAnchor, constant: PaddingTwo).isActive = true progressBar.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true - - } + +} //---------------------------------------------------- // MARK: - Molecule //------------------------------------------------------ - override open func reset() { - super.reset() - progressBar.reset() - leftLabel.reset() - rightLabel.reset() - - } public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { super.setWithModel(model, delegateObject, additionalData) @@ -83,5 +66,13 @@ import UIKit public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { return 90 } + + + override open func reset() { + super.reset() + progressBar.reset() + leftLabel.styleB1(true) + rightLabel.styleB1(true) + } }