Merge branch 'feature/coding' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into feature/coding
This commit is contained in:
commit
03a907a39b
@ -176,7 +176,7 @@ open class DoughnutChart: View {
|
|||||||
labelContainer.layoutIfNeeded()
|
labelContainer.layoutIfNeeded()
|
||||||
let radius = sizeObject.getValueBasedOnApplicationWidth()/2 - lineWidth()
|
let radius = sizeObject.getValueBasedOnApplicationWidth()/2 - lineWidth()
|
||||||
let labelheight = labelContainer.frame.height/2
|
let labelheight = labelContainer.frame.height/2
|
||||||
let padding = sizeObject.getValueBasedOnApplicationWidth()/2 - sqrt(pow(radius, 2) - pow(labelheight, 2))
|
let padding = sizeObject.getValueBasedOnApplicationWidth()/2 - sqrt(max(0, pow(radius, 2) - pow(labelheight, 2)))
|
||||||
|
|
||||||
labelContainerLeftConstraint?.constant = padding
|
labelContainerLeftConstraint?.constant = padding
|
||||||
labelContainerRightConstraint?.constant = padding
|
labelContainerRightConstraint?.constant = padding
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import Foundation
|
|||||||
addSubview(colorLablesStack)
|
addSubview(colorLablesStack)
|
||||||
|
|
||||||
doughnutChart.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
doughnutChart.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
||||||
doughnutChart.topAnchor.constraint(equalTo: topAnchor, constant: PaddingFour).isActive = true
|
doughnutChart.topAnchor.constraint(equalTo: topAnchor).isActive = true
|
||||||
bottomAnchor.constraint(greaterThanOrEqualTo: doughnutChart.bottomAnchor).isActive = true
|
bottomAnchor.constraint(greaterThanOrEqualTo: doughnutChart.bottomAnchor).isActive = true
|
||||||
|
|
||||||
let doughnutBottomAnchor = bottomAnchor.constraint(equalTo: doughnutChart.bottomAnchor)
|
let doughnutBottomAnchor = bottomAnchor.constraint(equalTo: doughnutChart.bottomAnchor)
|
||||||
|
|||||||
@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import Foundation
|
|||||||
let list = try typeContainer.decodeMolecules(codingKey: .list)
|
let list = try typeContainer.decodeMolecules(codingKey: .list)
|
||||||
var models: [MoleculeStackItemModel] = []
|
var models: [MoleculeStackItemModel] = []
|
||||||
for (index, molecule) in list.enumerated() {
|
for (index, molecule) in list.enumerated() {
|
||||||
models.append(MoleculeStackItemModel(with: StringAndMoleculeModel(string: "\(index).", molecule: molecule)))
|
models.append(MoleculeStackItemModel(with: StringAndMoleculeModel(string: "\(index+1).", molecule: molecule)))
|
||||||
}
|
}
|
||||||
super.init(molecules: models)
|
super.init(molecules: models)
|
||||||
spacing = 0
|
spacing = 0
|
||||||
|
|||||||
@ -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