mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
35 lines
1.1 KiB
Swift
35 lines
1.1 KiB
Swift
import Foundation
|
|
import AsyncDisplayKit
|
|
import Display
|
|
|
|
protocol FormControllerEntry: Identifiable {
|
|
associatedtype ItemParams
|
|
|
|
func isEqual(to: Self) -> Bool
|
|
func item(params: ItemParams, strings: PresentationStrings) -> FormControllerItem
|
|
}
|
|
|
|
enum FormControllerItemNeighbor {
|
|
case none
|
|
case spacer
|
|
case item(FormControllerItemNode)
|
|
}
|
|
|
|
struct FormControllerItemPreLayout {
|
|
let aligningInset: CGFloat
|
|
}
|
|
|
|
struct FormControllerItemLayoutParams {
|
|
let maxAligningInset: CGFloat
|
|
}
|
|
|
|
protocol FormControllerItem {
|
|
func node() -> ASDisplayNode & FormControllerItemNode
|
|
func update(node: ASDisplayNode & FormControllerItemNode, theme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, width: CGFloat, previousNeighbor: FormControllerItemNeighbor, nextNeighbor: FormControllerItemNeighbor, transition: ContainedViewLayoutTransition) -> (FormControllerItemPreLayout, (FormControllerItemLayoutParams) -> CGFloat)
|
|
}
|
|
|
|
protocol FormControllerItemNode {
|
|
var preventsTouchesToOtherItems: Bool { get }
|
|
func touchesToOtherItemsPrevented()
|
|
}
|