Merge branch 'feature/textLink' into 'develop'
reverted code back to pin to parent See merge request BPHV_MIPS/vds_ios!13
This commit is contained in:
commit
62ff5a4848
@ -18,11 +18,6 @@ public enum BadgeFillColor: String, Codable, CaseIterable {
|
||||
@objc(VDSBadge)
|
||||
public class Badge: View, Accessable {
|
||||
|
||||
private var contentView = UIView().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.layer.cornerRadius = 2
|
||||
}
|
||||
|
||||
private var label = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.adjustsFontSizeToFitWidth = false
|
||||
@ -71,16 +66,7 @@ public class Badge: View, Accessable {
|
||||
isAccessibilityElement = true
|
||||
accessibilityTraits = .staticText
|
||||
|
||||
contentView.addSubview(label)
|
||||
addSubview(contentView)
|
||||
|
||||
contentView
|
||||
.pinTop()
|
||||
.pinBottom()
|
||||
.pinLeading()
|
||||
|
||||
contentView.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor).isActive = true
|
||||
|
||||
addSubview(label)
|
||||
label.pinToSuperView(.init(top: 2, left: 4, bottom: 2, right: 4))
|
||||
|
||||
maxWidthConstraint = label.widthAnchor.constraint(lessThanOrEqualToConstant: 100)
|
||||
@ -188,7 +174,7 @@ public class Badge: View, Accessable {
|
||||
// MARK: - State
|
||||
//--------------------------------------------------
|
||||
open override func updateView() {
|
||||
contentView.backgroundColor = backgroundColor()
|
||||
backgroundColor = backgroundColor()
|
||||
|
||||
label.textColorConfiguration = textColorConfiguration()
|
||||
label.numberOfLines = numberOfLines
|
||||
|
||||
@ -62,11 +62,6 @@ open class ToggleBase: Control, Accessable, DataTrackable, BinaryColorable {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Private Properties
|
||||
//--------------------------------------------------
|
||||
private var contentView = UIView().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.layer.cornerRadius = 2
|
||||
}
|
||||
|
||||
private var stackView = UIStackView().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.axis = .horizontal
|
||||
@ -257,15 +252,7 @@ open class ToggleBase: Control, Accessable, DataTrackable, BinaryColorable {
|
||||
|
||||
isAccessibilityElement = true
|
||||
accessibilityTraits = .button
|
||||
addSubview(contentView)
|
||||
contentView.addSubview(stackView)
|
||||
|
||||
contentView
|
||||
.pinTop()
|
||||
.pinBottom()
|
||||
.pinLeading()
|
||||
|
||||
contentView.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor).isActive = true
|
||||
addSubview(stackView)
|
||||
|
||||
//set the h/w to container size, since the width "can" grow if text is there
|
||||
//allow this to be greaterThanEqualTo
|
||||
|
||||
Loading…
Reference in New Issue
Block a user