Switch to new check node implementation

This commit is contained in:
Ilya Laktyushin
2021-02-08 21:55:41 +04:00
parent 838f16781e
commit 249b684e64
21 changed files with 407 additions and 359 deletions

View File

@@ -8,7 +8,7 @@ public final class ItemListSelectableControlNode: ASDisplayNode {
private let checkNode: CheckNode
public init(strokeColor: UIColor, fillColor: UIColor, foregroundColor: UIColor) {
self.checkNode = CheckNode(strokeColor: strokeColor, fillColor: fillColor, foregroundColor: foregroundColor, style: .plain)
self.checkNode = CheckNode(theme: CheckNodeTheme(backgroundColor: fillColor, strokeColor: foregroundColor, borderColor: strokeColor, overlayBorder: false, hasInset: true, hasShadow: false))
self.checkNode.isUserInteractionEnabled = false
super.init()
@@ -26,9 +26,9 @@ public final class ItemListSelectableControlNode: ASDisplayNode {
}
return (compact ? 38.0 : 45.0, { size, animated in
let checkSize = CGSize(width: 32.0, height: 32.0)
resultNode.checkNode.frame = CGRect(origin: CGPoint(x: compact ? 9 : 12.0, y: floor((size.height - checkSize.height) / 2.0)), size: checkSize)
resultNode.checkNode.setIsChecked(selected, animated: animated)
let checkSize = CGSize(width: 26.0, height: 26.0)
resultNode.checkNode.frame = CGRect(origin: CGPoint(x: compact ? 11.0 : 13.0, y: floorToScreenPixels((size.height - checkSize.height) / 2.0)), size: checkSize)
resultNode.checkNode.setSelected(selected, animated: animated)
return resultNode
})
}