mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Make instant view classes public for browser ui integration
This commit is contained in:
@@ -8,31 +8,31 @@ import TelegramUIPreferences
|
||||
import AccountContext
|
||||
import ContextUI
|
||||
|
||||
final class InstantPageAudioItem: InstantPageItem {
|
||||
var frame: CGRect
|
||||
let wantsNode: Bool = true
|
||||
let separatesTiles: Bool = false
|
||||
let medias: [InstantPageMedia]
|
||||
public final class InstantPageAudioItem: InstantPageItem {
|
||||
public var frame: CGRect
|
||||
public let wantsNode: Bool = true
|
||||
public let separatesTiles: Bool = false
|
||||
public let medias: [InstantPageMedia]
|
||||
|
||||
let media: InstantPageMedia
|
||||
let webpage: TelegramMediaWebpage
|
||||
|
||||
init(frame: CGRect, media: InstantPageMedia, webpage: TelegramMediaWebpage) {
|
||||
public init(frame: CGRect, media: InstantPageMedia, webpage: TelegramMediaWebpage) {
|
||||
self.frame = frame
|
||||
self.media = media
|
||||
self.webpage = webpage
|
||||
self.medias = [media]
|
||||
}
|
||||
|
||||
func node(context: AccountContext, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, theme: InstantPageTheme, sourceLocation: InstantPageSourceLocation, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, activatePinchPreview: ((PinchSourceContainerNode) -> Void)?, pinchPreviewFinished: ((InstantPageNode) -> Void)?, openPeer: @escaping (EnginePeer) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> InstantPageNode? {
|
||||
public func node(context: AccountContext, strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, theme: InstantPageTheme, sourceLocation: InstantPageSourceLocation, openMedia: @escaping (InstantPageMedia) -> Void, longPressMedia: @escaping (InstantPageMedia) -> Void, activatePinchPreview: ((PinchSourceContainerNode) -> Void)?, pinchPreviewFinished: ((InstantPageNode) -> Void)?, openPeer: @escaping (EnginePeer) -> Void, openUrl: @escaping (InstantPageUrlItem) -> Void, updateWebEmbedHeight: @escaping (CGFloat) -> Void, updateDetailsExpanded: @escaping (Bool) -> Void, currentExpandedDetails: [Int : Bool]?) -> InstantPageNode? {
|
||||
return InstantPageAudioNode(context: context, strings: strings, theme: theme, webPage: self.webpage, media: self.media, openMedia: openMedia)
|
||||
}
|
||||
|
||||
func matchesAnchor(_ anchor: String) -> Bool {
|
||||
public func matchesAnchor(_ anchor: String) -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func matchesNode(_ node: InstantPageNode) -> Bool {
|
||||
public func matchesNode(_ node: InstantPageNode) -> Bool {
|
||||
if let node = node as? InstantPageAudioNode {
|
||||
return self.media == node.media
|
||||
} else {
|
||||
@@ -40,11 +40,11 @@ final class InstantPageAudioItem: InstantPageItem {
|
||||
}
|
||||
}
|
||||
|
||||
func distanceThresholdGroup() -> Int? {
|
||||
public func distanceThresholdGroup() -> Int? {
|
||||
return 4
|
||||
}
|
||||
|
||||
func distanceThresholdWithGroupCount(_ count: Int) -> CGFloat {
|
||||
public func distanceThresholdWithGroupCount(_ count: Int) -> CGFloat {
|
||||
if count > 3 {
|
||||
return 1000.0
|
||||
} else {
|
||||
@@ -52,11 +52,11 @@ final class InstantPageAudioItem: InstantPageItem {
|
||||
}
|
||||
}
|
||||
|
||||
func linkSelectionRects(at point: CGPoint) -> [CGRect] {
|
||||
public func linkSelectionRects(at point: CGPoint) -> [CGRect] {
|
||||
return []
|
||||
}
|
||||
|
||||
func drawInTile(context: CGContext) {
|
||||
public func drawInTile(context: CGContext) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user