code review cleanup, removing testing details

This commit is contained in:
Scott Pfeil 2023-06-27 13:27:23 -04:00
parent 7eee7d51d5
commit 4920977c7f
4 changed files with 2 additions and 8 deletions

View File

@ -131,7 +131,6 @@ open class Carousel: View {
inset.right = carouselModel?.rightPadding ?? Padding.Component.horizontalPaddingForSize(size)
}
collectionView.contentInset = inset
//(collectionView.collectionViewLayout as? UICollectionViewFlowLayout)?.sectionInset = inset
// Update cells and re-layout.
for cell in collectionView.visibleCells {

View File

@ -100,6 +100,7 @@
let columns = templateModel?.columns, columns > 0,
let cell = cell as? CollectionTemplateItemProtocol {
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)
}
}

View File

@ -74,7 +74,7 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
let molecule = generateMoleculeView(from: footerModel)
else {
let view = super.viewForBottom()
view.backgroundColor = templateModel?.footerColor?.uiColor ?? .clear
view.backgroundColor = templateModel?.backgroundColor?.uiColor ?? .clear
return view
}

View File

@ -16,7 +16,6 @@
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 }
@ -39,7 +38,6 @@
case header
case anchorFooter
case footer
case footerColor
}
//--------------------------------------------------
@ -56,9 +54,6 @@
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)
}
@ -69,6 +64,5 @@
try container.encodeModelIfPresent(header, forKey: .header)
try container.encodeIfPresent(anchorFooter, forKey: .anchorFooter)
try container.encodeModelIfPresent(footer, forKey: .footer)
try container.encodeIfPresent(footerColor, forKey: .footerColor)
}
}