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:
commit
00be5a33d7
@ -8,15 +8,12 @@
|
|||||||
|
|
||||||
import Foundation
|
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 class TabBarModel: MoleculeModelProtocol {
|
||||||
public static var identifier: String = "tabBar"
|
public static var identifier: String = "tabBar"
|
||||||
public var backgroundColor: Color? = Color(uiColor: .white)
|
public var backgroundColor: Color? = Color(uiColor: .white)
|
||||||
public var tabs: [TabBarItemModel]
|
public var tabs: [TabBarItemModel]
|
||||||
public var selectedColor = Color(uiColor: .mvmBlack)
|
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)
|
// Must be capped to 0...(tabs.count - 1)
|
||||||
public var selectedTab: Int = 0
|
public var selectedTab: Int = 0
|
||||||
|
|||||||
@ -156,7 +156,8 @@ import UIKit
|
|||||||
self.delegateObject = delegateObject
|
self.delegateObject = delegateObject
|
||||||
self.additionalData = additionalData
|
self.additionalData = additionalData
|
||||||
selectedIndex = tabsModel?.selectedIndex ?? 0
|
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()
|
reloadData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,8 +300,10 @@ extension Tabs {
|
|||||||
label.reset()
|
label.reset()
|
||||||
label.set(with: labelModel, delegateObject, additionalData)
|
label.set(with: labelModel, delegateObject, additionalData)
|
||||||
self.labelModel = labelModel
|
self.labelModel = labelModel
|
||||||
if selected, let selectedColor = tabsModel?.selectedColor {
|
if selected {
|
||||||
label.textColor = selectedColor.uiColor
|
label.textColor = tabsModel?.selectedColor.uiColor ?? .black
|
||||||
|
} else {
|
||||||
|
label.textColor = .mvmCoolGray6
|
||||||
}
|
}
|
||||||
updateAccessibility(indexPath: indexPath, selected: selected, tabsModel: tabsModel)
|
updateAccessibility(indexPath: indexPath, selected: selected, tabsModel: tabsModel)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ public class TabsModel: MoleculeModelProtocol {
|
|||||||
public static var identifier: String = "tabs"
|
public static var identifier: String = "tabs"
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var tabs: [TabItemModel]
|
public var tabs: [TabItemModel]
|
||||||
public var selectedColor = Color(uiColor: .mfTomatoRed())
|
public var selectedColor = Color(uiColor: .black)
|
||||||
|
|
||||||
// Must be capped to 0...(tabs.count - 1)
|
// Must be capped to 0...(tabs.count - 1)
|
||||||
public var selectedIndex: Int = 0
|
public var selectedIndex: Int = 0
|
||||||
|
|||||||
@ -192,7 +192,7 @@ extension UIColor {
|
|||||||
public static let mvmCoolGray3 = UIColor.assetColor(named: "coolGray3")
|
public static let mvmCoolGray3 = UIColor.assetColor(named: "coolGray3")
|
||||||
|
|
||||||
/// HEX: #747676
|
/// HEX: #747676
|
||||||
public static let mvmCoolGray6 = UIColor.assetColor(named: "coolGray6")
|
@objc public static let mvmCoolGray6 = UIColor.assetColor(named: "coolGray6")
|
||||||
|
|
||||||
/// HEX: #333333
|
/// HEX: #333333
|
||||||
public static let mvmCoolGray10 = UIColor.assetColor(named: "coolGray10")
|
public static let mvmCoolGray10 = UIColor.assetColor(named: "coolGray10")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user