This commit is contained in:
Kevin G Christiano 2020-04-02 10:09:32 -04:00
parent 20d23483fe
commit d039a0a64a
2 changed files with 3 additions and 4 deletions

View File

@ -22,7 +22,6 @@ open class BarsIndicatorView: CarouselIndicator {
stackView.alignment = .bottom stackView.alignment = .bottom
stackView.distribution = .equalSpacing stackView.distribution = .equalSpacing
stackView.spacing = 6 stackView.spacing = 6
stackView.heightAnchor.constraint(lessThanOrEqualToConstant: BarsIndicatorView.indicatorBarHeight.selected).isActive = true
return stackView return stackView
}() }()
@ -89,7 +88,6 @@ open class BarsIndicatorView: CarouselIndicator {
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
stackView.heightAnchor.constraint(equalToConstant: 4), stackView.heightAnchor.constraint(equalToConstant: 4),
heightAnchor.constraint(equalTo: stackView.heightAnchor), heightAnchor.constraint(equalTo: stackView.heightAnchor),
stackView.centerXAnchor.constraint(equalTo: centerXAnchor),
stackView.leadingAnchor.constraint(equalTo: leadingAnchor), stackView.leadingAnchor.constraint(equalTo: leadingAnchor),
stackView.topAnchor.constraint(equalTo: topAnchor), stackView.topAnchor.constraint(equalTo: topAnchor),
bottomAnchor.constraint(equalTo: stackView.bottomAnchor), bottomAnchor.constraint(equalTo: stackView.bottomAnchor),

View File

@ -49,13 +49,14 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
carouselIndicatorModel?.currentIndex = newIndex carouselIndicatorModel?.currentIndex = newIndex
previousIndex = _currentIndex previousIndex = _currentIndex
_currentIndex = newIndex _currentIndex = newIndex
performAction()
if previousIndex != newIndex { if previousIndex != newIndex {
updateUI(previousIndex: previousIndex, updateUI(previousIndex: previousIndex,
newIndex: newIndex, newIndex: newIndex,
totalCount: numberOfPages, totalCount: numberOfPages,
isAnimated: carouselIndicatorModel?.isAnimated ?? true) isAnimated: carouselIndicatorModel?.isAnimated ?? true)
performAction()
} }
} }
} }
@ -72,7 +73,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
carouselIndicatorModel?.numberOfPages = newTotal carouselIndicatorModel?.numberOfPages = newTotal
_numberOfPages = newTotal _numberOfPages = newTotal
isHidden = carouselIndicatorModel?.hidesForSinglePage ?? false && newTotal <= 1 isHidden = (carouselIndicatorModel?.hidesForSinglePage ?? false) && newTotal <= 1
updateUI(previousIndex: previousIndex, updateUI(previousIndex: previousIndex,
newIndex: currentIndex, newIndex: currentIndex,
totalCount: newTotal, totalCount: newTotal,