Merge branch 'bugfix/correct_toggle' into 'develop'
correct toggle See merge request BPHV_MIPS/mvm_core_ui!512
This commit is contained in:
commit
f2c5f9d043
@ -62,8 +62,7 @@ public typealias ActionBlockConfirmation = () -> (Bool)
|
||||
didSet {
|
||||
isUserInteractionEnabled = isEnabled
|
||||
changeStateNoAnimation(isEnabled ? isOn : false)
|
||||
backgroundColor = isEnabled ? (isOn ? containerTintColor.on : containerTintColor.off) : disabledTintColor.container
|
||||
knobView.backgroundColor = isEnabled ? (isOn ? knobTintColor.on : knobTintColor.off) : disabledTintColor.knob
|
||||
setToggleAppearanceFromState()
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,8 +95,7 @@ public typealias ActionBlockConfirmation = () -> (Bool)
|
||||
}, completion: nil)
|
||||
|
||||
} else {
|
||||
backgroundColor = isOn ? containerTintColor.on : containerTintColor.off
|
||||
knobView.backgroundColor = isOn ? knobTintColor.on : knobTintColor.off
|
||||
setToggleAppearanceFromState()
|
||||
self.constrainKnob()
|
||||
}
|
||||
|
||||
@ -350,6 +348,12 @@ public typealias ActionBlockConfirmation = () -> (Bool)
|
||||
// MARK: - Animations
|
||||
//--------------------------------------------------
|
||||
|
||||
public func setToggleAppearanceFromState() {
|
||||
|
||||
backgroundColor = isEnabled ? isOn ? containerTintColor.on : containerTintColor.off : disabledTintColor.container
|
||||
knobView.backgroundColor = isEnabled ? isOn ? knobTintColor.on : knobTintColor.off : disabledTintColor.knob
|
||||
}
|
||||
|
||||
public func knobReformAnimation() {
|
||||
|
||||
if isAnimated {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user