From 201c5a274f6ab064ace3deb9090c039e6456c54d Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Mon, 20 Jul 2020 10:21:21 -0400 Subject: [PATCH] new tab colors --- .../HorizontalCombinationViews/TabBarModel.swift | 5 +---- .../Molecules/HorizontalCombinationViews/Tabs.swift | 9 ++++++--- .../Molecules/HorizontalCombinationViews/TabsModel.swift | 2 +- MVMCoreUI/Categories/UIColor+Extension.swift | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift index 212c63f1..9de2cd54 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift @@ -8,15 +8,12 @@ import Foundation -/// coolGray4: #A6A8A8. This color is currently limited to only the tab bar. -private let mvmCoolGray4 = UIColor(red: 0.65, green: 0.659, blue: 0.659, alpha: 1) - public class TabBarModel: MoleculeModelProtocol { public static var identifier: String = "tabBar" public var backgroundColor: Color? = Color(uiColor: .white) public var tabs: [TabBarItemModel] public var selectedColor = Color(uiColor: .mvmBlack) - public var unSelectedColor = Color(uiColor: mvmCoolGray4) + public var unSelectedColor = Color(uiColor: .mvmCoolGray6) // Must be capped to 0...(tabs.count - 1) public var selectedTab: Int = 0 diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift index 8a6cb82d..f9a75e7d 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/Tabs.swift @@ -156,7 +156,8 @@ import UIKit self.delegateObject = delegateObject self.additionalData = additionalData selectedIndex = tabsModel?.selectedIndex ?? 0 - bottomLine.backgroundColor = tabsModel?.selectedColor.uiColor + // TODO: Commented out until we have model support for bar color. Should also do unselected color. + //bottomLine.backgroundColor = tabsModel?.selectedColor.uiColor reloadData() } } @@ -299,8 +300,10 @@ extension Tabs { label.reset() label.set(with: labelModel, delegateObject, additionalData) self.labelModel = labelModel - if selected, let selectedColor = tabsModel?.selectedColor { - label.textColor = selectedColor.uiColor + if selected { + label.textColor = tabsModel?.selectedColor.uiColor ?? .black + } else { + label.textColor = .mvmCoolGray6 } updateAccessibility(indexPath: indexPath, selected: selected, tabsModel: tabsModel) } diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift index e318b47c..58990428 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabsModel.swift @@ -12,7 +12,7 @@ public class TabsModel: MoleculeModelProtocol { public static var identifier: String = "tabs" public var backgroundColor: Color? public var tabs: [TabItemModel] - public var selectedColor = Color(uiColor: .mfTomatoRed()) + public var selectedColor = Color(uiColor: .black) // Must be capped to 0...(tabs.count - 1) public var selectedIndex: Int = 0 diff --git a/MVMCoreUI/Categories/UIColor+Extension.swift b/MVMCoreUI/Categories/UIColor+Extension.swift index 580a6ed6..ca763ac5 100644 --- a/MVMCoreUI/Categories/UIColor+Extension.swift +++ b/MVMCoreUI/Categories/UIColor+Extension.swift @@ -192,7 +192,7 @@ extension UIColor { public static let mvmCoolGray3 = UIColor.assetColor(named: "coolGray3") /// HEX: #747676 - public static let mvmCoolGray6 = UIColor.assetColor(named: "coolGray6") + @objc public static let mvmCoolGray6 = UIColor.assetColor(named: "coolGray6") /// HEX: #333333 public static let mvmCoolGray10 = UIColor.assetColor(named: "coolGray10")