diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift index 3995a3f7..2eefd716 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift @@ -20,6 +20,8 @@ open class BarsIndicatorView: CarouselIndicator { static let width: CGFloat = 24 static let selectedHeight: CGFloat = 4 static let unselectedHeight: CGFloat = 1 + static let selectedCornerRadius: CGFloat = 2 + static let unselectedCornerRadius: CGFloat = 0.5 var constraint: NSLayoutConstraint? @@ -53,7 +55,7 @@ open class BarsIndicatorView: CarouselIndicator { stackView.axis = .horizontal stackView.alignment = .bottom stackView.distribution = .equalSpacing - stackView.spacing = 6 + stackView.spacing = 4 return stackView }() @@ -190,6 +192,7 @@ open class BarsIndicatorView: CarouselIndicator { let bar = IndicatorBar() setAccessibilityLabel(view: bar, index: index) bar.backgroundColor = isEnabled ? (index == currentIndex ? currentIndicatorColor : indicatorColor) : disabledIndicatorColor + bar.layer.cornerRadius = index == currentIndex ? BarsIndicatorView.IndicatorBar.selectedCornerRadius : BarsIndicatorView.IndicatorBar.unselectedCornerRadius let barHeight = index == currentIndex ? BarsIndicatorView.IndicatorBar.selectedHeight : BarsIndicatorView.IndicatorBar.unselectedHeight let heightConstraint = bar.heightAnchor.constraint(equalToConstant: barHeight) heightConstraint.isActive = true @@ -252,6 +255,7 @@ open class BarsIndicatorView: CarouselIndicator { barReferences.forEach { $0.backgroundColor = isEnabled ? indicatorColor : disabledIndicatorColor $0.constraint?.constant = IndicatorBar.unselectedHeight + $0.layer.cornerRadius = IndicatorBar.unselectedCornerRadius } balanceBarCount(numberOfPages - barReferences.count) @@ -261,8 +265,10 @@ open class BarsIndicatorView: CarouselIndicator { let expression = { [self] in barReferences[previousIndex].backgroundColor = isEnabled ? indicatorColor : disabledIndicatorColor barReferences[previousIndex].constraint?.constant = IndicatorBar.unselectedHeight + barReferences[previousIndex].layer.cornerRadius = IndicatorBar.unselectedCornerRadius barReferences[newIndex].backgroundColor = isEnabled ? currentIndicatorColor : disabledIndicatorColor barReferences[newIndex].constraint?.constant = IndicatorBar.selectedHeight + barReferences[newIndex].layer.cornerRadius = IndicatorBar.selectedCornerRadius layoutIfNeeded() } diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift index 6a82ef80..1d7808bd 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift @@ -5,7 +5,7 @@ // Created by Kevin Christiano on 1/30/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // - +import VDSColorTokens open class CarouselIndicator: Control, CarouselPageControlProtocol { //-------------------------------------------------- @@ -71,13 +71,22 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol { } public var disabledIndicatorColor: UIColor { - get { carouselIndicatorModel?.disabledIndicatorColor.uiColor ?? .mvmCoolGray3 } - set { carouselIndicatorModel?.disabledIndicatorColor = Color(uiColor: newValue) } + get { + guard let model = carouselIndicatorModel else { return VDSColor.elementsSecondaryOnlight } + return model.inverted ? model.disabledIndicatorColor_inverted.uiColor : model.disabledIndicatorColor.uiColor + } + set { + if let model = carouselIndicatorModel, model.inverted { + model.disabledIndicatorColor_inverted = Color(uiColor: newValue) + } else { + carouselIndicatorModel?.disabledIndicatorColor = Color(uiColor: newValue) + } + } } public var indicatorColor: UIColor { get { - guard let model = carouselIndicatorModel else { return .mvmBlack } + guard let model = carouselIndicatorModel else { return VDSColor.elementsPrimaryOnlight} return model.inverted ? model.indicatorColor_inverted.uiColor : model.indicatorColor.uiColor } set { diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift index 9b211857..164bb306 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift @@ -7,7 +7,7 @@ // import Foundation - +import VDSColorTokens open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelProtocol, EnableableModelProtocol { //-------------------------------------------------- @@ -30,9 +30,10 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro /// Set true to make the accessibility value as "Slide #currentPage of #totalPage", otherwise will be "Page #currentPage of #totalPage", default is false public var accessibilityHasSlidesInsteadOfPage: Bool = false public var enabled: Bool = true - public var disabledIndicatorColor: Color = Color(uiColor: .mvmCoolGray3) - public var indicatorColor: Color = Color(uiColor: .mvmBlack) - public var indicatorColor_inverted: Color = Color(uiColor: .mvmWhite) + public var disabledIndicatorColor: Color = Color(uiColor: VDSColor.elementsSecondaryOnlight) + public var disabledIndicatorColor_inverted: Color = Color(uiColor: VDSColor.elementsSecondaryOndark) + public var indicatorColor: Color = Color(uiColor: VDSColor.elementsPrimaryOnlight) + public var indicatorColor_inverted: Color = Color(uiColor: VDSColor.elementsPrimaryOndark) public var position: CGFloat? /// Allows sendActions() to trigger even if index is already at min/max index. diff --git a/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift b/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift index b5b562eb..cc9e7333 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift @@ -32,6 +32,8 @@ import VDSColorTokens The style of the line: - secondary (1 height, silver) - primary (1 height, black) + - standard (1 height, silver) - deprecated + - thin (1 height, black) - deprecated - medium (2 height, black) - heavy (4 height, black) - none (hidden) @@ -39,6 +41,8 @@ import VDSColorTokens public enum Style: String, Codable { case secondary case primary + case standard + case thin case medium case heavy case none @@ -59,10 +63,10 @@ import VDSColorTokens get { if let backgroundColor = _backgroundColor { return backgroundColor } if inverted { - if type == .secondary { return Color(uiColor: VDSColor.paletteGray20) } + if type == .secondary || type == .standard { return Color(uiColor: VDSColor.paletteGray20) } return Color(uiColor: VDSColor.elementsPrimaryOndark) } - if type == .secondary { return Color(uiColor: VDSColor.paletteGray85) } + if type == .secondary || type == .standard { return Color(uiColor: VDSColor.paletteGray85) } return Color(uiColor: VDSColor.elementsPrimaryOnlight) } set { diff --git a/MVMCoreUI/Categories/colors.xcassets/Contents.json b/MVMCoreUI/Categories/colors.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/MVMCoreUI/Categories/colors.xcassets/Contents.json +++ b/MVMCoreUI/Categories/colors.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/MVMCoreUI/Containers/NavigationController/NavigationController.swift b/MVMCoreUI/Containers/NavigationController/NavigationController.swift index 644dee73..9b4b332a 100644 --- a/MVMCoreUI/Containers/NavigationController/NavigationController.swift +++ b/MVMCoreUI/Containers/NavigationController/NavigationController.swift @@ -74,6 +74,9 @@ extension NavigationController: MVMCoreViewManagerProtocol { let model = getNavigationModel(from: viewController) { setNavigationItem(with: model, for: topViewController) setNavigationBarUI(with: model) + + navigationBar.setNeedsLayout() + navigationBar.layoutIfNeeded() } manager?.newDataReceived?(in: viewController) } @@ -84,6 +87,9 @@ extension NavigationController: MVMCoreViewManagerProtocol { let model = getNavigationModel(from: viewController) { setNavigationItem(with: model, for: topViewController) setNavigationBarUI(with: model) + + navigationBar.setNeedsLayout() + navigationBar.layoutIfNeeded() } manager?.willDisplay?(viewController) }