CXTDT-542341 - disabled state color/borderWidth

CXTDT-542333 - padding fix

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-04-05 14:09:10 -05:00
parent b56e45d41b
commit f3f71b4b10

View File

@ -34,16 +34,10 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
//--------------------------------------------------
// MARK: - Private Properties
//--------------------------------------------------
private var mainStackView = UIStackView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.alignment = .top
$0.axis = .vertical
$0.spacing = 0
}
private var selectorStackView = UIStackView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.alignment = .top
$0.distribution = .fill
$0.axis = .horizontal
$0.spacing = 12
}
@ -160,6 +154,7 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .selected)
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .highlighted)
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: [.selected, .disabled])
}
//--------------------------------------------------
@ -182,10 +177,8 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
addSubview(selectorView)
selectorView.isUserInteractionEnabled = false
selectorView.addSubview(mainStackView)
mainStackView.addArrangedSubview(selectorStackView)
selectorView.addSubview(selectorStackView)
selectorStackView.addArrangedSubview(selectorLeftLabelStackView)
selectorStackView.addArrangedSubview(subTextRightLabel)
selectorLeftLabelStackView.addArrangedSubview(textLabel)
@ -197,7 +190,7 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
.pinTrailing(0, .defaultHigh)
.pinBottom(0, .defaultHigh)
mainStackView.pinToSuperView(.uniform(16))
selectorStackView.pinToSuperView(.uniform(16))
}
/// Resets to default settings.
@ -323,7 +316,7 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
//get the colors
let backgroundColor = backgroundColorConfiguration.getColor(self)
let borderColor = borderColorConfiguration.getColor(self)
let borderWidth = isSelected || isHighlighted ? selectorBorderWidthSelected : selectorBorderWidth
let borderWidth = (isSelected || isHighlighted) && isEnabled ? selectorBorderWidthSelected : selectorBorderWidth
selectorView.backgroundColor = backgroundColor
selectorView.layer.borderColor = borderColor.cgColor