Merge branch 'feature/3.0-VDS-LineComponent' into 'feature/develop_mvp_3'

Modifying line component as part of VDS for brand 3.0

See merge request BPHV_MIPS/mvm_core_ui!834
This commit is contained in:
Pfeil, Scott Robert 2022-04-04 19:44:15 +00:00
commit 359c99f5c6
7 changed files with 21 additions and 21 deletions

View File

@ -48,17 +48,17 @@ import UIKit
public init() { public init() {
super.init(frame: .zero) super.init(frame: .zero)
model = LineModel(type: .standard) model = LineModel(type: .secondary)
} }
public override init(frame: CGRect) { public override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
model = LineModel(type: .standard) model = LineModel(type: .secondary)
} }
public required init?(coder: NSCoder) { public required init?(coder: NSCoder) {
super.init(coder: coder) super.init(coder: coder)
model = LineModel(type: .standard) model = LineModel(type: .secondary)
} }
public required init(model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { public required init(model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
@ -106,7 +106,7 @@ import UIKit
} }
open override func reset() { open override func reset() {
setStyle(.standard) setStyle(.secondary)
} }
public override static func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { public override static func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {

View File

@ -30,15 +30,15 @@ import VDSColorTokens
/** /**
The style of the line: The style of the line:
- standard (1 height, silver) - secondary (1 height, silver)
- thin (1 height, black) - primary (1 height, black)
- medium (2 height, black) - medium (2 height, black)
- heavy (4 height, black) - heavy (4 height, black)
- none (hidden) - none (hidden)
*/ */
public enum Style: String, Codable { public enum Style: String, Codable {
case standard case secondary
case thin case primary
case medium case medium
case heavy case heavy
case none case none
@ -49,7 +49,7 @@ import VDSColorTokens
//-------------------------------------------------- //--------------------------------------------------
public static var identifier: String = "line" public static var identifier: String = "line"
public var type: Style = .standard public var type: Style = .secondary
public var frequency: Frequency? = .allExceptTop public var frequency: Frequency? = .allExceptTop
//TODO: use color insted of backgroundColor. Needs server changes //TODO: use color insted of backgroundColor. Needs server changes
@ -59,10 +59,10 @@ import VDSColorTokens
get { get {
if let backgroundColor = _backgroundColor { return backgroundColor } if let backgroundColor = _backgroundColor { return backgroundColor }
if inverted { if inverted {
if type == .standard { return Color(uiColor: VDSColor.interactiveDisabledOndark) } if type == .secondary { return Color(uiColor: VDSColor.paletteGray20) }
return Color(uiColor: VDSColor.elementsPrimaryOndark) return Color(uiColor: VDSColor.elementsPrimaryOndark)
} }
if type == .standard { return Color(uiColor: VDSColor.interactiveDisabledOnlight) } if type == .secondary { return Color(uiColor: VDSColor.paletteGray85) }
return Color(uiColor: VDSColor.elementsPrimaryOnlight) return Color(uiColor: VDSColor.elementsPrimaryOnlight)
} }
set { set {

View File

@ -22,7 +22,7 @@ import Foundation
public override func setupView() { public override func setupView() {
super.setupView() super.setupView()
line.setStyle(.thin) line.setStyle(.primary)
contentView.addSubview(line) contentView.addSubview(line)
NSLayoutConstraint.pinViewBottom(toSuperview: line, useMargins: false, constant: 0).isActive = true NSLayoutConstraint.pinViewBottom(toSuperview: line, useMargins: false, constant: 0).isActive = true
NSLayoutConstraint.pinViewLeft(toSuperview: line, useMargins: true, constant: 0).isActive = true NSLayoutConstraint.pinViewLeft(toSuperview: line, useMargins: true, constant: 0).isActive = true
@ -51,7 +51,7 @@ import Foundation
open override func reset() { open override func reset() {
super.reset() super.reset()
line.setStyle(.thin) line.setStyle(.primary)
molecule?.reset() molecule?.reset()
} }

View File

@ -42,7 +42,7 @@
bottomPadding = PaddingDefaultVerticalSpacing3 bottomPadding = PaddingDefaultVerticalSpacing3
} }
if line == nil { if line == nil {
line = LineModel(type: .thin) line = LineModel(type: .primary)
} }
} }

View File

@ -24,7 +24,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
open var title: String? open var title: String?
open var hidden = false open var hidden = false
open var line: LineModel? = LineModel(type: .standard) open var line: LineModel? = LineModel(type: .secondary)
open var hidesSystemBackButton = true open var hidesSystemBackButton = true
open var style: NavigationItemStyle? open var style: NavigationItemStyle?

View File

@ -42,13 +42,13 @@ import UIKit
switch style { switch style {
case .standard?: case .standard?:
topSeparatorView?.setStyle(.none) topSeparatorView?.setStyle(.none)
bottomSeparatorView?.setStyle(.standard) bottomSeparatorView?.setStyle(.secondary)
case .shortDivider?: case .shortDivider?:
topSeparatorView?.setStyle(.none) topSeparatorView?.setStyle(.none)
bottomSeparatorView?.setStyle(.thin) bottomSeparatorView?.setStyle(.primary)
case .tallDivider?: case .tallDivider?:
topSeparatorView?.setStyle(.none) topSeparatorView?.setStyle(.none)
bottomSeparatorView?.setStyle(.thin) bottomSeparatorView?.setStyle(.primary)
case .sectionFooter?: case .sectionFooter?:
topSeparatorView?.setStyle(.none) topSeparatorView?.setStyle(.none)
bottomSeparatorView?.setStyle(.none) bottomSeparatorView?.setStyle(.none)
@ -244,8 +244,8 @@ import UIKit
topSeparatorView?.set(with: model, delegateObject, additionalData) topSeparatorView?.set(with: model, delegateObject, additionalData)
bottomSeparatorView?.set(with: model, delegateObject, additionalData) bottomSeparatorView?.set(with: model, delegateObject, additionalData)
} else { } else {
topSeparatorView?.setStyle(.standard) topSeparatorView?.setStyle(.secondary)
bottomSeparatorView?.setStyle(.standard) bottomSeparatorView?.setStyle(.secondary)
} }
setSeparatorFrequency(model?.frequency ?? .allExceptTop, indexPath: indexPath) setSeparatorFrequency(model?.frequency ?? .allExceptTop, indexPath: indexPath)
} }

View File

@ -34,7 +34,7 @@ open class SubNavManagerController: ViewController, MVMCoreViewManagerProtocol,
}() }()
public lazy var line: Line = { public lazy var line: Line = {
return Line(model: LineModel(type: .standard), delegateObjectIVar, nil) return Line(model: LineModel(type: .secondary), delegateObjectIVar, nil)
}() }()
public lazy var subNavigationController: UINavigationController = { public lazy var subNavigationController: UINavigationController = {