color changes
This commit is contained in:
parent
dcd4dde59d
commit
2ad329949a
@ -72,7 +72,11 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
||||
override open func viewForBottom() -> UIView {
|
||||
guard let footerModel = templateModel?.footer,
|
||||
let molecule = generateMoleculeView(from: footerModel)
|
||||
else { return super.viewForBottom() }
|
||||
else {
|
||||
let view = super.viewForBottom()
|
||||
view.backgroundColor = templateModel?.footerColor?.uiColor ?? .clear
|
||||
return view
|
||||
}
|
||||
|
||||
return molecule
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
public var header: MoleculeModelProtocol?
|
||||
public var anchorFooter: Bool = false
|
||||
public var footer: MoleculeModelProtocol?
|
||||
public var footerColor = Color(name: "white")
|
||||
|
||||
public override var rootMolecules: [MoleculeModelProtocol] {
|
||||
[navigationBar, header, footer].compactMap { $0 }
|
||||
@ -38,6 +39,7 @@
|
||||
case header
|
||||
case anchorFooter
|
||||
case footer
|
||||
case footerColor
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -54,6 +56,9 @@
|
||||
anchorFooter = anchor
|
||||
}
|
||||
footer = try typeContainer.decodeModelIfPresent(codingKey: .footer)
|
||||
if let footerColor = try typeContainer.decodeIfPresent(Color.self, forKey: .footerColor) {
|
||||
self.footerColor = footerColor
|
||||
}
|
||||
try super.init(from: decoder)
|
||||
}
|
||||
|
||||
@ -64,5 +69,6 @@
|
||||
try container.encodeModelIfPresent(header, forKey: .header)
|
||||
try container.encodeIfPresent(anchorFooter, forKey: .anchorFooter)
|
||||
try container.encodeModelIfPresent(footer, forKey: .footer)
|
||||
try container.encodeIfPresent(footerColor, forKey: .footerColor)
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,6 +169,7 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController {
|
||||
bottomView = MVMCoreUICommonViewsUtility.getView(with: 0.5)
|
||||
}
|
||||
let footerView = MVMCoreUICommonViewsUtility.commonView()
|
||||
footerView.backgroundColor = bottomView.backgroundColor
|
||||
footerView.addSubview(bottomView)
|
||||
bottomViewTopConstraint = bottomView.topAnchor.constraint(equalTo: footerView.topAnchor, constant: spaceAboveBottomView() ?? 0)
|
||||
bottomViewTopConstraint?.isActive = true
|
||||
|
||||
Loading…
Reference in New Issue
Block a user