updated Code as per confluence page color changes
This commit is contained in:
parent
5e9d24f15c
commit
e4dc439d1c
@ -69,6 +69,10 @@ open class RadioBox: Control {
|
||||
subTextLabel.text = model.subText
|
||||
isOutOfStock = model.strikethrough
|
||||
subTextLabelHeightConstraint?.isActive = (subTextLabel.text?.count ?? 0) == 0
|
||||
if let boxesModel = additionalData?["radioboxesmodel"] as? RadioBoxesModel{
|
||||
backgroundColor = model.backgroundColor?.uiColor ?? (boxesModel.backgroundColor?.uiColor ?? UIColor.white)
|
||||
accentColor = model.selectedAccentColor?.uiColor ?? (boxesModel.selectedAccentColor?.uiColor ?? UIColor.mvmRed)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - State Handling
|
||||
@ -134,7 +138,7 @@ open class RadioBox: Control {
|
||||
|
||||
let topLineLayer = CAShapeLayer()
|
||||
topLineLayer.fillColor = nil
|
||||
topLineLayer.strokeColor = UIColor.mvmRed.cgColor
|
||||
topLineLayer.strokeColor = accentColor.cgColor
|
||||
topLineLayer.lineWidth = 4
|
||||
topLineLayer.path = topLinePath.cgPath
|
||||
layer.addSublayer(topLineLayer)
|
||||
|
||||
@ -11,8 +11,8 @@ import Foundation
|
||||
public static var identifier: String = "radioBox"
|
||||
public var text: String
|
||||
public var subText: String?
|
||||
public var backgroundColor: Color? = Color(uiColor: .white)
|
||||
public var selectedAccentColor = Color(uiColor: .mvmRed)
|
||||
public var backgroundColor: Color?
|
||||
public var selectedAccentColor: Color?
|
||||
public var selected: Bool = false
|
||||
public var enabled: Bool = true
|
||||
public var strikethrough: Bool = false
|
||||
|
||||
@ -16,6 +16,8 @@ open class RadioBoxes: View {
|
||||
private let boxHeight: CGFloat = 64.0
|
||||
private let itemSpacing: CGFloat = 8.0
|
||||
private var numberOfColumns: CGFloat = 2.0
|
||||
private var radioBoxesmodel: RadioBoxesModel!
|
||||
|
||||
|
||||
private var delegateObject: MVMCoreUIDelegateObject?
|
||||
|
||||
@ -48,6 +50,7 @@ open class RadioBoxes: View {
|
||||
self.delegateObject = delegateObject
|
||||
|
||||
guard let radioBoxesModel = model as? RadioBoxesModel else { return }
|
||||
radioBoxesmodel = radioBoxesModel
|
||||
boxes = radioBoxesModel.boxes
|
||||
FormValidator.setupValidation(for: radioBoxesModel, delegate: delegateObject?.formHolderDelegate)
|
||||
|
||||
@ -118,8 +121,9 @@ extension RadioBoxes: UICollectionViewDataSource {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "RadioBoxCollectionViewCell", for: indexPath) as? RadioBoxCollectionViewCell else {
|
||||
fatalError()
|
||||
}
|
||||
let additionalData: [AnyHashable : RadioBoxesModel] = ["radioboxesmodel":radioBoxesmodel]
|
||||
cell.radioBox.isUserInteractionEnabled = false
|
||||
cell.set(with: molecule, delegateObject, nil)
|
||||
cell.set(with: molecule, delegateObject, additionalData)
|
||||
cell.updateView(size ?? collectionView.bounds.width)
|
||||
if molecule.selected {
|
||||
collectionView.selectItem(at: indexPath, animated: false, scrollPosition: .centeredVertically)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user