Merge branch 'feature/new_tab_colors' into 'develop'

new tab colors

See merge request BPHV_MIPS/mvm_core_ui!541
This commit is contained in:
Suresh, Kamlesh Jain 2020-07-20 10:52:17 -04:00
commit 00be5a33d7
4 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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)
}

View File

@ -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

View File

@ -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")