mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Refactor PasswordSetupUI, PassportUI, GalleryUI and related modules
This commit is contained in:
92
submodules/GalleryUI/Sources/GalleryItemNode.swift
Normal file
92
submodules/GalleryUI/Sources/GalleryItemNode.swift
Normal file
@@ -0,0 +1,92 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
import Display
|
||||
import SwiftSignalKit
|
||||
import Postbox
|
||||
|
||||
public enum GalleryItemNodeNavigationStyle {
|
||||
case light
|
||||
case dark
|
||||
}
|
||||
|
||||
open class GalleryItemNode: ASDisplayNode {
|
||||
private var _index: Int?
|
||||
public var index: Int {
|
||||
get {
|
||||
return self._index!
|
||||
} set(value) {
|
||||
self._index = value
|
||||
}
|
||||
}
|
||||
|
||||
public var toggleControlsVisibility: () -> Void = { }
|
||||
public var dismiss: () -> Void = { }
|
||||
public var beginCustomDismiss: () -> Void = { }
|
||||
public var completeCustomDismiss: () -> Void = { }
|
||||
public var baseNavigationController: () -> NavigationController? = { return nil }
|
||||
|
||||
override public init() {
|
||||
super.init()
|
||||
|
||||
self.setViewBlock({
|
||||
return UITracingLayerView()
|
||||
})
|
||||
}
|
||||
|
||||
open func ready() -> Signal<Void, NoError> {
|
||||
return .single(Void())
|
||||
}
|
||||
|
||||
open func title() -> Signal<String, NoError> {
|
||||
return .single("")
|
||||
}
|
||||
|
||||
open func titleView() -> Signal<UIView?, NoError> {
|
||||
return .single(nil)
|
||||
}
|
||||
|
||||
open func rightBarButtonItem() -> Signal<UIBarButtonItem?, NoError> {
|
||||
return .single(nil)
|
||||
}
|
||||
|
||||
open func rightBarButtonItems() -> Signal<[UIBarButtonItem]?, NoError> {
|
||||
return .single(nil)
|
||||
}
|
||||
|
||||
open func footerContent() -> Signal<GalleryFooterContentNode?, NoError> {
|
||||
return .single(nil)
|
||||
}
|
||||
|
||||
open func navigationStyle() -> Signal<GalleryItemNodeNavigationStyle, NoError> {
|
||||
return .single(.dark)
|
||||
}
|
||||
|
||||
open func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationBarHeight: CGFloat, transition: ContainedViewLayoutTransition) {
|
||||
}
|
||||
|
||||
open func centralityUpdated(isCentral: Bool) {
|
||||
}
|
||||
|
||||
open func screenFrameUpdated(_ frame: CGRect) {
|
||||
}
|
||||
|
||||
open func activateAsInitial() {
|
||||
}
|
||||
|
||||
open func processAction(_ action: GalleryControllerItemNodeAction) {
|
||||
}
|
||||
|
||||
open func visibilityUpdated(isVisible: Bool) {
|
||||
}
|
||||
|
||||
open func animateIn(from node: (ASDisplayNode, () -> (UIView?, UIView?)), addToTransitionSurface: (UIView) -> Void) {
|
||||
}
|
||||
|
||||
open func animateOut(to node: (ASDisplayNode, () -> (UIView?, UIView?)), addToTransitionSurface: (UIView) -> Void, completion: @escaping () -> Void) {
|
||||
}
|
||||
|
||||
open func contentSize() -> CGSize? {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user