Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into feature/audio_player_behavior
This commit is contained in:
commit
5a08c88e2c
@ -234,6 +234,7 @@ open class BarsIndicatorView: CarouselIndicator {
|
|||||||
super.reset()
|
super.reset()
|
||||||
barReferences.forEach { $0.removeFromSuperview() }
|
barReferences.forEach { $0.removeFromSuperview() }
|
||||||
barReferences = []
|
barReferences = []
|
||||||
|
currentIndex = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) {
|
public override func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) {
|
||||||
|
|||||||
@ -248,4 +248,10 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
|||||||
bottomConstraint?.constant = constant
|
bottomConstraint?.constant = constant
|
||||||
topConstraint?.constant = constant
|
topConstraint?.constant = constant
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open override func reset() {
|
||||||
|
super.reset()
|
||||||
|
currentIndex = 0
|
||||||
|
previousIndex = 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@ open class Carousel: View {
|
|||||||
open var numberOfPages = 0
|
open var numberOfPages = 0
|
||||||
|
|
||||||
/// The models for the molecules.
|
/// The models for the molecules.
|
||||||
public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol]?
|
public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol & CollectionItemModelProtocol]?
|
||||||
|
|
||||||
/// The horizontal alignment of the cell in the collection view. Only noticeable if the itemWidthPercent is less than 100%.
|
/// 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
|
public var itemAlignment = UICollectionView.ScrollPosition.left
|
||||||
@ -177,6 +177,7 @@ open class Carousel: View {
|
|||||||
if let selectedIndex = carouselModel.selectedIndex {
|
if let selectedIndex = carouselModel.selectedIndex {
|
||||||
let adjustedIndex = loop ? selectedIndex + 2 : selectedIndex
|
let adjustedIndex = loop ? selectedIndex + 2 : selectedIndex
|
||||||
collectionView.selectItem(at: IndexPath(row: adjustedIndex, section: 0), animated: false, scrollPosition: [])
|
collectionView.selectItem(at: IndexPath(row: adjustedIndex, section: 0), animated: false, scrollPosition: [])
|
||||||
|
goTo(adjustedIndex, animated: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,6 +208,13 @@ open class Carousel: View {
|
|||||||
pageIndex = 0
|
pageIndex = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open override func reset() {
|
||||||
|
super.reset()
|
||||||
|
currentIndex = 0
|
||||||
|
pageIndex = 0
|
||||||
|
pagingView?.reset()
|
||||||
|
}
|
||||||
|
|
||||||
var pagingMoleculeName: String?
|
var pagingMoleculeName: String?
|
||||||
|
|
||||||
/// Sets up the paging molecule
|
/// Sets up the paging molecule
|
||||||
@ -216,6 +224,7 @@ open class Carousel: View {
|
|||||||
molecule.moleculeName == pagingMoleculeName {
|
molecule.moleculeName == pagingMoleculeName {
|
||||||
pagingView?.set(with: molecule, delegateObject, nil)
|
pagingView?.set(with: molecule, delegateObject, nil)
|
||||||
pagingView?.numberOfPages = numberOfPages
|
pagingView?.numberOfPages = numberOfPages
|
||||||
|
pagingView?.currentIndex = currentIndex
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -423,6 +432,10 @@ extension Carousel: UICollectionViewDelegate {
|
|||||||
adjustedIndex = adjustedIndex + numberOfPages
|
adjustedIndex = adjustedIndex + numberOfPages
|
||||||
}
|
}
|
||||||
model.selectedIndex = adjustedIndex
|
model.selectedIndex = adjustedIndex
|
||||||
|
currentIndex = adjustedIndex
|
||||||
|
pageIndex = currentIndex
|
||||||
|
pagingView?.currentIndex = adjustedIndex
|
||||||
|
updateModelIndex()
|
||||||
}
|
}
|
||||||
if let cell = collectionView.cellForItem(at: indexPath) as? CollectionTemplateItemProtocol {
|
if let cell = collectionView.cellForItem(at: indexPath) as? CollectionTemplateItemProtocol {
|
||||||
cell.didSelectCell(at: indexPath, delegateObject: delegateObject, additionalData: nil)
|
cell.didSelectCell(at: indexPath, delegateObject: delegateObject, additionalData: nil)
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import UIKit
|
|||||||
}
|
}
|
||||||
|
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol]
|
public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol & CollectionItemModelProtocol]
|
||||||
public var index: Int = 0
|
public var index: Int = 0
|
||||||
public var spacing: CGFloat?
|
public var spacing: CGFloat?
|
||||||
public var border: Bool?
|
public var border: Bool?
|
||||||
@ -41,7 +41,7 @@ import UIKit
|
|||||||
public var selectable = false
|
public var selectable = false
|
||||||
public var selectedIndex: Int?
|
public var selectedIndex: Int?
|
||||||
|
|
||||||
public init(molecules: [MoleculeModelProtocol & CarouselItemModelProtocol]) {
|
public init(molecules: [MoleculeModelProtocol & CarouselItemModelProtocol & CollectionItemModelProtocol]) {
|
||||||
self.molecules = molecules
|
self.molecules = molecules
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user