link color update MOBFIRST-20060
This commit is contained in:
parent
24bce846f4
commit
10ed8bcb66
@ -25,7 +25,7 @@ open class ExternalLink: Link {
|
|||||||
|
|
||||||
guard let model = model as? ExternalLinkModel else { return }
|
guard let model = model as? ExternalLinkModel else { return }
|
||||||
|
|
||||||
exportImageView?.tintColor = model.textColor.uiColor
|
exportImageView?.tintColor = model.enabledColor.uiColor
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -52,7 +52,7 @@ import UIKit
|
|||||||
guard let model = model as? LinkModel else { return }
|
guard let model = model as? LinkModel else { return }
|
||||||
|
|
||||||
setTitle(model.title, for: .normal)
|
setTitle(model.title, for: .normal)
|
||||||
setTitleColor(model.textColor.uiColor, for: .normal)
|
setTitleColor(model.enabledColor.uiColor, for: .normal)
|
||||||
setTitleColor(model.disabledColor.uiColor, for: .disabled)
|
setTitleColor(model.disabledColor.uiColor, for: .disabled)
|
||||||
isEnabled = model.enabled
|
isEnabled = model.enabled
|
||||||
set(with: model.action, delegateObject: delegateObject, additionalData: additionalData)
|
set(with: model.action, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
|
|||||||
@ -21,7 +21,7 @@ open class LinkModel: ButtonModelProtocol, MoleculeModelProtocol {
|
|||||||
public var title: String
|
public var title: String
|
||||||
public var action: ActionModelProtocol
|
public var action: ActionModelProtocol
|
||||||
public var enabled = true
|
public var enabled = true
|
||||||
public var textColor = Color(uiColor: .mvmBlack)
|
public var enabledColor = Color(uiColor: .mvmBlack)
|
||||||
public var disabledColor = Color(uiColor: .mvmCoolGray6)
|
public var disabledColor = Color(uiColor: .mvmCoolGray6)
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -43,7 +43,7 @@ open class LinkModel: ButtonModelProtocol, MoleculeModelProtocol {
|
|||||||
case title
|
case title
|
||||||
case action
|
case action
|
||||||
case enabled
|
case enabled
|
||||||
case textColor
|
case enabledColor
|
||||||
case disabledColor
|
case disabledColor
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,8 +60,8 @@ open class LinkModel: ButtonModelProtocol, MoleculeModelProtocol {
|
|||||||
if let enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) {
|
if let enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) {
|
||||||
self.enabled = enabled
|
self.enabled = enabled
|
||||||
}
|
}
|
||||||
if let color = try typeContainer.decodeIfPresent(Color.self, forKey: .textColor) {
|
if let color = try typeContainer.decodeIfPresent(Color.self, forKey: .enabledColor) {
|
||||||
textColor = color
|
enabledColor = color
|
||||||
}
|
}
|
||||||
|
|
||||||
if let color = try typeContainer.decodeIfPresent(Color.self, forKey: .disabledColor) {
|
if let color = try typeContainer.decodeIfPresent(Color.self, forKey: .disabledColor) {
|
||||||
@ -76,7 +76,7 @@ open class LinkModel: ButtonModelProtocol, MoleculeModelProtocol {
|
|||||||
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
||||||
try container.encodeModel(action, forKey: .action)
|
try container.encodeModel(action, forKey: .action)
|
||||||
try container.encode(enabled, forKey: .enabled)
|
try container.encode(enabled, forKey: .enabled)
|
||||||
try container.encode(textColor, forKey: .textColor)
|
try container.encode(enabledColor, forKey: .enabledColor)
|
||||||
try container.encode(disabledColor, forKey: .disabledColor)
|
try container.encode(disabledColor, forKey: .disabledColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user