diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift index 9b4ea3bc..ad65049d 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift @@ -42,19 +42,24 @@ open class BarsIndicatorView: CarouselIndicator { open override var isEnabled: Bool { didSet { - barReferences.forEach { view, _ in - view.backgroundColor = isEnabled ? indicatorColor : disabledIndicatorColor + + for (i, bar) in barReferences.enumerated() { + if i == currentIndex { + bar.view.backgroundColor = isEnabled ? currentIndicatorColor : disabledIndicatorColor + } else { + bar.view.backgroundColor = isEnabled ? indicatorColor : disabledIndicatorColor + } } } } /// Colors the currently selected index, unique from other indicators public var currentIndicatorColor: UIColor { - get { return barsCarouselIndicatorModel?.currentIndicatorColor.uiColor ?? .mvmBlack } + get { return barsCarouselIndicatorModel?.currentIndicatorColor.uiColor ?? indicatorColor } set (newColor) { barsCarouselIndicatorModel?.currentIndicatorColor = Color(uiColor: newColor) - if !barReferences.isEmpty { + if isEnabled && !barReferences.isEmpty { barReferences[currentIndex].view.backgroundColor = newColor } }