Merge branch 'bugfix/CXTDT-530193' into 'release/11_4_0'
CXTDT-530193 ### Summary footerless list template property handling. ### JIRA Ticket https://onejira.verizon.com/browse/CXTDT-530193 See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1070
This commit is contained in:
commit
91423f87f4
@ -18,6 +18,8 @@
|
||||
public var line: LineModel?
|
||||
public var scrollToRowIndex: Int?
|
||||
public var singleCellSelection: Bool = false
|
||||
public var footerlessSpacerHeight: CGFloat?
|
||||
public var footerlessSpacerColor: Color?
|
||||
|
||||
public override var rootMolecules: [MoleculeModelProtocol] {
|
||||
if let molecules = molecules {
|
||||
@ -60,6 +62,8 @@
|
||||
case line
|
||||
case scrollToRowIndex
|
||||
case singleCellSelection
|
||||
case footerlessSpacerHeight
|
||||
case footerlessSpacerColor
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -74,6 +78,8 @@
|
||||
if let singleCellSelection = try typeContainer.decodeIfPresent(Bool.self, forKey: .singleCellSelection) {
|
||||
self.singleCellSelection = singleCellSelection
|
||||
}
|
||||
footerlessSpacerColor = try typeContainer.decodeIfPresent(Color.self, forKey: .footerlessSpacerColor)
|
||||
footerlessSpacerHeight = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .footerlessSpacerHeight)
|
||||
try super.init(from: decoder)
|
||||
try validateModelHasContent()
|
||||
}
|
||||
@ -85,5 +91,7 @@
|
||||
try container.encode(line, forKey: .line)
|
||||
try container.encode(singleCellSelection, forKey: .singleCellSelection)
|
||||
try container.encodeIfPresent(scrollToRowIndex, forKey: .scrollToRowIndex)
|
||||
try container.encodeIfPresent(footerlessSpacerColor, forKey: .footerlessSpacerColor)
|
||||
try container.encodeIfPresent(footerlessSpacerHeight, forKey: .footerlessSpacerHeight)
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,16 +69,21 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
||||
return molecule
|
||||
}
|
||||
|
||||
override open func viewForBottom() -> UIView {
|
||||
guard let footerModel = templateModel?.footer,
|
||||
let molecule = generateMoleculeView(from: footerModel)
|
||||
else {
|
||||
let view = super.viewForBottom()
|
||||
view.backgroundColor = templateModel?.backgroundColor?.uiColor ?? .clear
|
||||
return view
|
||||
open override func viewForBottom() -> UIView {
|
||||
// If there is a footer molecule return the molecule.
|
||||
if let footerModel = templateModel?.footer,
|
||||
let molecule = generateMoleculeView(from: footerModel) {
|
||||
return molecule
|
||||
}
|
||||
|
||||
return molecule
|
||||
// Otherwise setup a bottom spacer view.
|
||||
let view: UIView
|
||||
if let footerlessSpacerHeight = templateModel?.footerlessSpacerHeight {
|
||||
view = MVMCoreUICommonViewsUtility.getView(with: footerlessSpacerHeight <= 0.5 ? 0.5 : footerlessSpacerHeight)
|
||||
} else {
|
||||
view = super.viewForBottom()
|
||||
}
|
||||
view.backgroundColor = templateModel?.footerlessSpacerColor?.uiColor ?? templateModel?.backgroundColor?.uiColor ?? .clear
|
||||
return view
|
||||
}
|
||||
|
||||
open override func handleNewData() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user