Merge branch 'feature/HeadLineBodyCaretLinkImage_alignment_issues' into 'feature/coding'
Feature/head line body caret link image alignment issues See merge request BPHV_MIPS/mvm_core_ui!229
This commit is contained in:
commit
be710bfb0e
@ -13,18 +13,15 @@ import Foundation
|
|||||||
let caretButton = CaretButton(frame: .zero)
|
let caretButton = CaretButton(frame: .zero)
|
||||||
let backgroundImageView = MFLoadImageView()
|
let backgroundImageView = MFLoadImageView()
|
||||||
var spaceBetweenConstant: CGFloat = 104.0
|
var spaceBetweenConstant: CGFloat = 104.0
|
||||||
var leftConstraintHeadline : NSLayoutConstraint?
|
|
||||||
var leftConstraintCaretView : NSLayoutConstraint?
|
|
||||||
let padding = MFStyler.defaultHorizontalPaddingForApplicationWidth()
|
|
||||||
let maxWidth : CGFloat = 350.0
|
let maxWidth : CGFloat = 350.0
|
||||||
// MARK: - MVMCoreViewProtocol
|
// MARK: - MVMCoreViewProtocol
|
||||||
open override func updateView(_ size: CGFloat) {
|
open override func updateView(_ size: CGFloat) {
|
||||||
super.updateView(size)
|
super.updateView(size)
|
||||||
headlineBody.updateView(size)
|
headlineBody.updateView(size)
|
||||||
caretButton.updateView(size)
|
caretButton.updateView(size)
|
||||||
backgroundImageView.updateView(size)
|
backgroundImageView.updateView(size)
|
||||||
leftConstraintHeadline?.constant = MFStyler.defaultHorizontalPadding(forSize: size)
|
backgroundImageView.alignFillHorizontal()
|
||||||
leftConstraintCaretView?.constant = MFStyler.defaultHorizontalPadding(forSize: size)
|
backgroundImageView.alignFillVertical()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
@ -39,8 +36,7 @@ import Foundation
|
|||||||
view.addSubview(caretButton)
|
view.addSubview(caretButton)
|
||||||
|
|
||||||
//Headline view
|
//Headline view
|
||||||
leftConstraintHeadline = headlineBody.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: padding)
|
headlineBody.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 0).isActive = true
|
||||||
leftConstraintHeadline?.isActive = true
|
|
||||||
headlineBody.topAnchor.constraint(equalTo: view.topAnchor, constant: PaddingDefault).isActive = true
|
headlineBody.topAnchor.constraint(equalTo: view.topAnchor, constant: PaddingDefault).isActive = true
|
||||||
|
|
||||||
let headLineBodyWidth = headlineBody.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.85)
|
let headLineBodyWidth = headlineBody.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.85)
|
||||||
@ -50,8 +46,7 @@ import Foundation
|
|||||||
|
|
||||||
//Caret view
|
//Caret view
|
||||||
caretButton.translatesAutoresizingMaskIntoConstraints = false
|
caretButton.translatesAutoresizingMaskIntoConstraints = false
|
||||||
leftConstraintCaretView = caretButton.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: padding)
|
caretButton.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 0).isActive = true
|
||||||
leftConstraintCaretView?.isActive = true
|
|
||||||
view.bottomAnchor.constraint(equalTo: caretButton.bottomAnchor, constant: PaddingDefault).isActive = true
|
view.bottomAnchor.constraint(equalTo: caretButton.bottomAnchor, constant: PaddingDefault).isActive = true
|
||||||
|
|
||||||
caretButton.topAnchor.constraint(greaterThanOrEqualTo: headlineBody.bottomAnchor, constant: spaceBetweenConstant).isActive = true
|
caretButton.topAnchor.constraint(greaterThanOrEqualTo: headlineBody.bottomAnchor, constant: spaceBetweenConstant).isActive = true
|
||||||
@ -59,6 +54,8 @@ import Foundation
|
|||||||
//Background image view
|
//Background image view
|
||||||
backgroundImageView.translatesAutoresizingMaskIntoConstraints = false
|
backgroundImageView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
backgroundImageView.imageView.contentMode = .scaleAspectFill
|
backgroundImageView.imageView.contentMode = .scaleAspectFill
|
||||||
|
backgroundImageView.alignFillHorizontal()
|
||||||
|
backgroundImageView.alignFillVertical()
|
||||||
view.addSubview(backgroundImageView)
|
view.addSubview(backgroundImageView)
|
||||||
NSLayoutConstraint.constraintPinSubview(toSuperview: backgroundImageView)
|
NSLayoutConstraint.constraintPinSubview(toSuperview: backgroundImageView)
|
||||||
view.sendSubviewToBack(backgroundImageView)
|
view.sendSubviewToBack(backgroundImageView)
|
||||||
@ -88,6 +85,8 @@ import Foundation
|
|||||||
headlineBody.setWithModel(model.headlineBody, delegateObject, additionalData)
|
headlineBody.setWithModel(model.headlineBody, delegateObject, additionalData)
|
||||||
caretButton.setWithModel(model.caretLink, delegateObject, additionalData)
|
caretButton.setWithModel(model.caretLink, delegateObject, additionalData)
|
||||||
backgroundImageView.setWithModel(model.image, delegateObject, additionalData)
|
backgroundImageView.setWithModel(model.image, delegateObject, additionalData)
|
||||||
|
backgroundImageView.alignFillHorizontal()
|
||||||
|
backgroundImageView.alignFillVertical()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,7 @@
|
|||||||
@"checkbox": Checkbox.class,
|
@"checkbox": Checkbox.class,
|
||||||
@"checkboxLabel": CheckboxWithLabelView.class,
|
@"checkboxLabel": CheckboxWithLabelView.class,
|
||||||
@"cornerLabels" : CornerLabels.class,
|
@"cornerLabels" : CornerLabels.class,
|
||||||
@"progressbar": ProgressBar.class,
|
@"progressBar": ProgressBar.class,
|
||||||
@"circleProgress": GraphView.class,
|
@"circleProgress": GraphView.class,
|
||||||
@"multiProgressBar": MultiProgress.class,
|
@"multiProgressBar": MultiProgress.class,
|
||||||
@"radioButton": RadioButton.class,
|
@"radioButton": RadioButton.class,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user