fix for radiobutton on launch

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-08-12 10:04:16 -05:00
parent 9d440aaeac
commit eeabdba54c

View File

@ -72,26 +72,28 @@ open class RadioButtonBase<ModelType: RadioButtonModel>: SelectorBase<ModelType>
}
open override func updateSelector(_ viewModel: ModelType) {
//get the colors
let backgroundColor = radioButtonBackgroundColorConfiguration.getColor(viewModel)
let borderColor = radioButtonBorderColorConfiguration.getColor(viewModel)
let radioSelectedColor = radioButtonCheckColorConfiguration.getColor(viewModel)
if let shapeLayer = shapeLayer, let sublayers = layer.sublayers, sublayers.contains(shapeLayer) {
shapeLayer.removeFromSuperlayer()
self.shapeLayer = nil
}
let bounds = selectorView.bounds
let length = max(bounds.size.height, bounds.size.width)
guard length > 0.0, shapeLayer == nil else { return }
//get the colors
let backgroundColor = radioButtonBackgroundColorConfiguration.getColor(viewModel)
let borderColor = radioButtonBorderColorConfiguration.getColor(viewModel)
let radioSelectedColor = radioButtonCheckColorConfiguration.getColor(viewModel)
selectorView.backgroundColor = backgroundColor
selectorView.layer.borderColor = borderColor.cgColor
selectorView.layer.cornerRadius = selectorView.bounds.width * 0.5
selectorView.layer.borderWidth = 1.0
if shapeLayer == nil {
let bounds = selectorView.bounds
let selectedBounds = radioButtonSelectedSize
let length = max(bounds.size.height, bounds.size.width)
guard length > 0.0, shapeLayer == nil else { return }
let bezierPath = UIBezierPath(ovalIn: CGRect(x: (bounds.width - selectedBounds.width) / 2,
y: (bounds.height - selectedBounds.height) / 2,
width: radioButtonSelectedSize.width,