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 {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
// MARK: - Public Properties
|
||||
//--------------------------------------------------
|
||||
|
||||
public var exportImageView: UIImageView?
|
||||
|
||||
open var exportImageView: UIImageView?
|
||||
open var exportImageHeight: NSLayoutConstraint?
|
||||
open var exportImageWidth: NSLayoutConstraint?
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - MoleculeViewProtocol
|
||||
// MARK: - Overrides
|
||||
//--------------------------------------------------
|
||||
|
||||
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
|
||||
guard let model = model as? ExternalLinkModel else { return }
|
||||
|
||||
exportImageView?.tintColor = titleColor(for: model.enabled ? .normal : .disabled)
|
||||
open override func viewModelDidUpdate() {
|
||||
super.viewModelDidUpdate()
|
||||
exportImageView?.tintColor = textColor
|
||||
exportImageWidth?.constant = textStyle.lineHeight
|
||||
exportImageHeight?.constant = textStyle.lineHeight
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - MVMCoreViewProtocol
|
||||
//--------------------------------------------------
|
||||
|
||||
open override func setupView() {
|
||||
super.setupView()
|
||||
|
||||
open override func setup() {
|
||||
super.setup()
|
||||
|
||||
let image = MVMCoreUIUtility.imageNamed("externalLink")
|
||||
exportImageView = UIImageView(image: image?.withRenderingMode(.alwaysTemplate))
|
||||
@ -46,10 +41,10 @@ open class ExternalLink: Link {
|
||||
addSubview(exportIcon)
|
||||
trailingAnchor.constraint(greaterThanOrEqualTo: exportIcon.trailingAnchor).isActive = true
|
||||
|
||||
if let titleLabel = titleLabel {
|
||||
let dimension = titleLabel.font.pointSize
|
||||
exportIcon.heightAnchor.constraint(equalToConstant: dimension).isActive = true
|
||||
exportIcon.widthAnchor.constraint(equalToConstant: dimension).isActive = true
|
||||
exportImageHeight = exportIcon.heightAnchor.constraint(equalToConstant: textStyle.pointSize).activate()
|
||||
exportImageWidth = exportIcon.widthAnchor.constraint(equalToConstant: textStyle.pointSize).activate()
|
||||
|
||||
if let titleLabel {
|
||||
exportIcon.leadingAnchor.constraint(equalTo: titleLabel.trailingAnchor, constant: 4).isActive = true
|
||||
exportIcon.bottomAnchor.constraint(equalTo: titleLabel.lastBaselineAnchor, constant: 3).isActive = true
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user