mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Refactor PasswordSetupUI, PassportUI, GalleryUI and related modules
This commit is contained in:
37
submodules/PassportUI/Sources/Form/FormControllerItem.swift
Normal file
37
submodules/PassportUI/Sources/Form/FormControllerItem.swift
Normal file
@@ -0,0 +1,37 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
import Display
|
||||
import TelegramPresentationData
|
||||
import MergeLists
|
||||
|
||||
public protocol FormControllerEntry: Identifiable {
|
||||
associatedtype ItemParams
|
||||
|
||||
func isEqual(to: Self) -> Bool
|
||||
func item(params: ItemParams, strings: PresentationStrings) -> FormControllerItem
|
||||
}
|
||||
|
||||
public enum FormControllerItemNeighbor {
|
||||
case none
|
||||
case spacer
|
||||
case item(FormControllerItemNode)
|
||||
}
|
||||
|
||||
public struct FormControllerItemPreLayout {
|
||||
let aligningInset: CGFloat
|
||||
}
|
||||
|
||||
public struct FormControllerItemLayoutParams {
|
||||
let maxAligningInset: CGFloat
|
||||
}
|
||||
|
||||
public 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)
|
||||
}
|
||||
|
||||
public protocol FormControllerItemNode {
|
||||
var preventsTouchesToOtherItems: Bool { get }
|
||||
func touchesToOtherItemsPrevented()
|
||||
}
|
||||
Reference in New Issue
Block a user