mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-12 09:19:52 +00:00
git-subtree-dir: submodules/Display git-subtree-mainline: 9bc996374ffdad37aef175427db72731c9551dcf git-subtree-split: 7bd11013ea936e3d49d937550d599f5816d32560
34 lines
1.2 KiB
Swift
34 lines
1.2 KiB
Swift
import UIKit
|
|
import AsyncDisplayKit
|
|
|
|
open class ActionSheetItemNode: ASDisplayNode {
|
|
private let theme: ActionSheetControllerTheme
|
|
|
|
public let backgroundNode: ASDisplayNode
|
|
private let overflowSeparatorNode: ASDisplayNode
|
|
|
|
public init(theme: ActionSheetControllerTheme) {
|
|
self.theme = theme
|
|
|
|
self.backgroundNode = ASDisplayNode()
|
|
self.backgroundNode.backgroundColor = self.theme.itemBackgroundColor
|
|
|
|
self.overflowSeparatorNode = ASDisplayNode()
|
|
self.overflowSeparatorNode.backgroundColor = self.theme.itemHighlightedBackgroundColor
|
|
|
|
super.init()
|
|
|
|
self.addSubnode(self.backgroundNode)
|
|
self.addSubnode(self.overflowSeparatorNode)
|
|
}
|
|
|
|
open override func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
|
|
return CGSize(width: constrainedSize.width, height: 57.0)
|
|
}
|
|
|
|
open override func layout() {
|
|
self.backgroundNode.frame = CGRect(origin: CGPoint(), size: self.calculatedSize)
|
|
self.overflowSeparatorNode.frame = CGRect(origin: CGPoint(x: 0.0, y: self.calculatedSize.height), size: CGSize(width: self.calculatedSize.width, height: UIScreenPixel))
|
|
}
|
|
}
|