Merge branch 'revert-d9e2593d' into 'release/9_1_0'

Revert "Merge branch 'bugfix/carousel_issues' into 'develop'"

See merge request BPHV_MIPS/mvm_core_ui!739
This commit is contained in:
Pfeil, Scott Robert 2021-07-22 15:54:48 +00:00
commit cea16818cc
4 changed files with 3 additions and 23 deletions

View File

@ -234,7 +234,6 @@ open class BarsIndicatorView: CarouselIndicator {
super.reset()
barReferences.forEach { $0.removeFromSuperview() }
barReferences = []
currentIndex = 0
}
public override func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) {

View File

@ -248,10 +248,4 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
bottomConstraint?.constant = constant
topConstraint?.constant = constant
}
open override func reset() {
super.reset()
currentIndex = 0
previousIndex = 0
}
}

View File

@ -41,7 +41,7 @@ open class Carousel: View {
open var numberOfPages = 0
/// The models for the molecules.
public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol & CollectionItemModelProtocol]?
public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol]?
/// The horizontal alignment of the cell in the collection view. Only noticeable if the itemWidthPercent is less than 100%.
public var itemAlignment = UICollectionView.ScrollPosition.left
@ -177,7 +177,6 @@ open class Carousel: View {
if let selectedIndex = carouselModel.selectedIndex {
let adjustedIndex = loop ? selectedIndex + 2 : selectedIndex
collectionView.selectItem(at: IndexPath(row: adjustedIndex, section: 0), animated: false, scrollPosition: [])
goTo(adjustedIndex, animated: false)
}
}
@ -208,13 +207,6 @@ open class Carousel: View {
pageIndex = 0
}
open override func reset() {
super.reset()
currentIndex = 0
pageIndex = 0
pagingView?.reset()
}
var pagingMoleculeName: String?
/// Sets up the paging molecule
@ -224,7 +216,6 @@ open class Carousel: View {
molecule.moleculeName == pagingMoleculeName {
pagingView?.set(with: molecule, delegateObject, nil)
pagingView?.numberOfPages = numberOfPages
pagingView?.currentIndex = currentIndex
return
}
@ -432,10 +423,6 @@ extension Carousel: UICollectionViewDelegate {
adjustedIndex = adjustedIndex + numberOfPages
}
model.selectedIndex = adjustedIndex
currentIndex = adjustedIndex
pageIndex = currentIndex
pagingView?.currentIndex = adjustedIndex
updateModelIndex()
}
if let cell = collectionView.cellForItem(at: indexPath) as? CollectionTemplateItemProtocol {
cell.didSelectCell(at: indexPath, delegateObject: delegateObject, additionalData: nil)

View File

@ -20,7 +20,7 @@ import UIKit
}
public var backgroundColor: Color?
public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol & CollectionItemModelProtocol]
public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol]
public var index: Int = 0
public var spacing: CGFloat?
public var border: Bool?
@ -41,7 +41,7 @@ import UIKit
public var selectable = false
public var selectedIndex: Int?
public init(molecules: [MoleculeModelProtocol & CarouselItemModelProtocol & CollectionItemModelProtocol]) {
public init(molecules: [MoleculeModelProtocol & CarouselItemModelProtocol]) {
self.molecules = molecules
}