mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Refactor InstantPageUI and related modules
This commit is contained in:
48
submodules/InstantPageUI/Sources/InstantPageAnchorItem.swift
Normal file
48
submodules/InstantPageUI/Sources/InstantPageAnchorItem.swift
Normal file
@@ -0,0 +1,48 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
import Postbox
|
||||
import TelegramCore
|
||||
import AsyncDisplayKit
|
||||
import TelegramPresentationData
|
||||
import AccountContext
|
||||
|
||||
final class InstantPageAnchorItem: InstantPageItem {
|
||||
let wantsNode: Bool = false
|
||||
let separatesTiles: Bool = false
|
||||
let medias: [InstantPageMedia] = []
|
||||
|
||||
let anchor: String
|
||||
var frame: CGRect
|
||||
|
||||
init(frame: CGRect, anchor: String) {
|
||||
self.frame = frame
|
||||
self.anchor = anchor
|
||||
}
|
||||
|
||||
func matchesAnchor(_ anchor: String) -> Bool {
|
||||
return anchor == self.anchor
|
||||
}
|
||||
|
||||
func drawInTile(context: CGContext) {
|
||||
}
|
||||
|
||||
func node(context: AccountContext, strings: PresentationStrings, theme: InstantPageTheme, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, openPeer: @escaping (PeerId) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> (InstantPageNode & ASDisplayNode)? {
|
||||
return nil
|
||||
}
|
||||
|
||||
func matchesNode(_ node: InstantPageNode) -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func linkSelectionRects(at point: CGPoint) -> [CGRect] {
|
||||
return []
|
||||
}
|
||||
|
||||
func distanceThresholdGroup() -> Int? {
|
||||
return nil
|
||||
}
|
||||
|
||||
func distanceThresholdWithGroupCount(_ count: Int) -> CGFloat {
|
||||
return 0.0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user