code review cleanup, removing testing details
This commit is contained in:
parent
7eee7d51d5
commit
4920977c7f
@ -131,7 +131,6 @@ open class Carousel: View {
|
|||||||
inset.right = carouselModel?.rightPadding ?? Padding.Component.horizontalPaddingForSize(size)
|
inset.right = carouselModel?.rightPadding ?? Padding.Component.horizontalPaddingForSize(size)
|
||||||
}
|
}
|
||||||
collectionView.contentInset = inset
|
collectionView.contentInset = inset
|
||||||
//(collectionView.collectionViewLayout as? UICollectionViewFlowLayout)?.sectionInset = inset
|
|
||||||
|
|
||||||
// Update cells and re-layout.
|
// Update cells and re-layout.
|
||||||
for cell in collectionView.visibleCells {
|
for cell in collectionView.visibleCells {
|
||||||
|
|||||||
@ -100,6 +100,7 @@
|
|||||||
let columns = templateModel?.columns, columns > 0,
|
let columns = templateModel?.columns, columns > 0,
|
||||||
let cell = cell as? CollectionTemplateItemProtocol {
|
let cell = cell as? CollectionTemplateItemProtocol {
|
||||||
let width = (size - collectionView.adjustedContentInset.left - collectionView.adjustedContentInset.right) / CGFloat(columns)
|
let width = (size - collectionView.adjustedContentInset.left - collectionView.adjustedContentInset.right) / CGFloat(columns)
|
||||||
|
// Makes the width slightly less to avoid rounding errors and the column being a little too big.
|
||||||
cell.set(width: width - 0.1)
|
cell.set(width: width - 0.1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,7 +74,7 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
|||||||
let molecule = generateMoleculeView(from: footerModel)
|
let molecule = generateMoleculeView(from: footerModel)
|
||||||
else {
|
else {
|
||||||
let view = super.viewForBottom()
|
let view = super.viewForBottom()
|
||||||
view.backgroundColor = templateModel?.footerColor?.uiColor ?? .clear
|
view.backgroundColor = templateModel?.backgroundColor?.uiColor ?? .clear
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
public var header: MoleculeModelProtocol?
|
public var header: MoleculeModelProtocol?
|
||||||
public var anchorFooter: Bool = false
|
public var anchorFooter: Bool = false
|
||||||
public var footer: MoleculeModelProtocol?
|
public var footer: MoleculeModelProtocol?
|
||||||
public var footerColor = Color(name: "white")
|
|
||||||
|
|
||||||
public override var rootMolecules: [MoleculeModelProtocol] {
|
public override var rootMolecules: [MoleculeModelProtocol] {
|
||||||
[navigationBar, header, footer].compactMap { $0 }
|
[navigationBar, header, footer].compactMap { $0 }
|
||||||
@ -39,7 +38,6 @@
|
|||||||
case header
|
case header
|
||||||
case anchorFooter
|
case anchorFooter
|
||||||
case footer
|
case footer
|
||||||
case footerColor
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -56,9 +54,6 @@
|
|||||||
anchorFooter = anchor
|
anchorFooter = anchor
|
||||||
}
|
}
|
||||||
footer = try typeContainer.decodeModelIfPresent(codingKey: .footer)
|
footer = try typeContainer.decodeModelIfPresent(codingKey: .footer)
|
||||||
if let footerColor = try typeContainer.decodeIfPresent(Color.self, forKey: .footerColor) {
|
|
||||||
self.footerColor = footerColor
|
|
||||||
}
|
|
||||||
try super.init(from: decoder)
|
try super.init(from: decoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,6 +64,5 @@
|
|||||||
try container.encodeModelIfPresent(header, forKey: .header)
|
try container.encodeModelIfPresent(header, forKey: .header)
|
||||||
try container.encodeIfPresent(anchorFooter, forKey: .anchorFooter)
|
try container.encodeIfPresent(anchorFooter, forKey: .anchorFooter)
|
||||||
try container.encodeModelIfPresent(footer, forKey: .footer)
|
try container.encodeModelIfPresent(footer, forKey: .footer)
|
||||||
try container.encodeIfPresent(footerColor, forKey: .footerColor)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user