Testing json override.
Prospect images tabs and carousel fixes new json
This commit is contained in:
parent
a5fcceca9b
commit
9b048ccd5a
@ -122,6 +122,25 @@ import VDSColorTokens
|
||||
NSLayoutConstraint.constraintPinSubview(bottomLine, pinTop: false, pinBottom: true, pinLeft: true, pinRight: true)
|
||||
}
|
||||
|
||||
open override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
// Accounts for any collection size changes
|
||||
DispatchQueue.main.async {
|
||||
self.layoutCollection()
|
||||
}
|
||||
}
|
||||
|
||||
/// Invalidates the layout and ensures we are paged to the correct cell.
|
||||
open func layoutCollection() {
|
||||
collectionView?.collectionViewLayout.invalidateLayout()
|
||||
|
||||
// Go to current cell. layoutIfNeeded is needed otherwise cellForItem returns nil for peaking logic. The dispatch is a sad way to ensure the collection view is ready to be scrolled.
|
||||
DispatchQueue.main.async {
|
||||
self.collectionView?.scrollToItem(at: IndexPath(row: self.selectedIndex, section: 0), at: .left, animated: false)
|
||||
self.collectionView?.layoutIfNeeded()
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// MARK: - Control Methods
|
||||
//-------------------------------------------------
|
||||
|
||||
@ -47,6 +47,7 @@ import UIKit
|
||||
public override func reset() {
|
||||
super.reset()
|
||||
tabs.reset()
|
||||
tabs.paddingBeforeFirstTab = false
|
||||
}
|
||||
|
||||
public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { 46 }
|
||||
|
||||
@ -104,6 +104,7 @@ open class Carousel: View {
|
||||
super.setupView()
|
||||
collectionView.dataSource = self
|
||||
collectionView.delegate = self
|
||||
collectionView.bounces = false
|
||||
addSubview(collectionView)
|
||||
bottomPin = NSLayoutConstraint.constraintPinSubview(toSuperview: collectionView)?[ConstraintBot] as? NSLayoutConstraint
|
||||
collectionViewHeight = collectionView.heightAnchor.constraint(equalToConstant: 300)
|
||||
@ -129,7 +130,8 @@ open class Carousel: View {
|
||||
inset.left = carouselModel?.leftPadding ?? Padding.Component.horizontalPaddingForSize(size)
|
||||
inset.right = carouselModel?.rightPadding ?? Padding.Component.horizontalPaddingForSize(size)
|
||||
}
|
||||
(collectionView.collectionViewLayout as? UICollectionViewFlowLayout)?.sectionInset = inset
|
||||
collectionView.contentInset = inset
|
||||
//(collectionView.collectionViewLayout as? UICollectionViewFlowLayout)?.sectionInset = inset
|
||||
|
||||
// Update cells and re-layout.
|
||||
for cell in collectionView.visibleCells {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user