updated external link
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
0f85c96201
commit
f4221c0215
@ -11,29 +11,24 @@ import UIKit
|
|||||||
|
|
||||||
open class ExternalLink: Link {
|
open class ExternalLink: Link {
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Properties
|
// MARK: - Public Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
open var exportImageView: UIImageView?
|
||||||
public var exportImageView: UIImageView?
|
open var exportImageHeight: NSLayoutConstraint?
|
||||||
|
open var exportImageWidth: NSLayoutConstraint?
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - MoleculeViewProtocol
|
// MARK: - Overrides
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
open override func viewModelDidUpdate() {
|
||||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
super.viewModelDidUpdate()
|
||||||
super.set(with: model, delegateObject, additionalData)
|
exportImageView?.tintColor = textColor
|
||||||
|
exportImageWidth?.constant = textStyle.lineHeight
|
||||||
guard let model = model as? ExternalLinkModel else { return }
|
exportImageHeight?.constant = textStyle.lineHeight
|
||||||
|
|
||||||
exportImageView?.tintColor = titleColor(for: model.enabled ? .normal : .disabled)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
open override func setup() {
|
||||||
// MARK: - MVMCoreViewProtocol
|
super.setup()
|
||||||
//--------------------------------------------------
|
|
||||||
|
|
||||||
open override func setupView() {
|
|
||||||
super.setupView()
|
|
||||||
|
|
||||||
let image = MVMCoreUIUtility.imageNamed("externalLink")
|
let image = MVMCoreUIUtility.imageNamed("externalLink")
|
||||||
exportImageView = UIImageView(image: image?.withRenderingMode(.alwaysTemplate))
|
exportImageView = UIImageView(image: image?.withRenderingMode(.alwaysTemplate))
|
||||||
@ -46,10 +41,10 @@ open class ExternalLink: Link {
|
|||||||
addSubview(exportIcon)
|
addSubview(exportIcon)
|
||||||
trailingAnchor.constraint(greaterThanOrEqualTo: exportIcon.trailingAnchor).isActive = true
|
trailingAnchor.constraint(greaterThanOrEqualTo: exportIcon.trailingAnchor).isActive = true
|
||||||
|
|
||||||
if let titleLabel = titleLabel {
|
exportImageHeight = exportIcon.heightAnchor.constraint(equalToConstant: textStyle.pointSize).activate()
|
||||||
let dimension = titleLabel.font.pointSize
|
exportImageWidth = exportIcon.widthAnchor.constraint(equalToConstant: textStyle.pointSize).activate()
|
||||||
exportIcon.heightAnchor.constraint(equalToConstant: dimension).isActive = true
|
|
||||||
exportIcon.widthAnchor.constraint(equalToConstant: dimension).isActive = true
|
if let titleLabel {
|
||||||
exportIcon.leadingAnchor.constraint(equalTo: titleLabel.trailingAnchor, constant: 4).isActive = true
|
exportIcon.leadingAnchor.constraint(equalTo: titleLabel.trailingAnchor, constant: 4).isActive = true
|
||||||
exportIcon.bottomAnchor.constraint(equalTo: titleLabel.lastBaselineAnchor, constant: 3).isActive = true
|
exportIcon.bottomAnchor.constraint(equalTo: titleLabel.lastBaselineAnchor, constant: 3).isActive = true
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user