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

View File

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