Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
@@ -0,0 +1,46 @@
import Foundation
import UIKit
import AsyncDisplayKit
import Display
import Postbox
import TelegramCore
import SwiftSignalKit
private let textFont = Font.regular(16.0)
final class SecretMediaPreviewFooterContentNode: GalleryFooterContentNode {
private var currentText: String?
private let textNode: ImmediateTextNode
override init() {
self.textNode = ImmediateTextNode()
self.textNode.isUserInteractionEnabled = false
self.textNode.displaysAsynchronously = false
super.init()
self.addSubnode(self.textNode)
}
func setText(_ text: String) {
if self.currentText != text {
self.currentText = text
self.textNode.attributedText = NSAttributedString(string: text, font: textFont, textColor: .white)
self.requestLayout?(.immediate)
}
}
override func updateLayout(size: CGSize, metrics: LayoutMetrics, leftInset: CGFloat, rightInset: CGFloat, bottomInset: CGFloat, contentInset: CGFloat, transition: ContainedViewLayoutTransition) -> CGFloat {
let width = size.width
let panelHeight: CGFloat = 44.0 + bottomInset
let sideInset: CGFloat = leftInset + 8.0
let textSize = self.textNode.updateLayout(CGSize(width: width - sideInset * 2.0, height: CGFloat.greatestFiniteMagnitude))
transition.updateFrame(node: self.textNode, frame: CGRect(origin: CGPoint(x: floor((width - textSize.width) / 2.0), y: floor((44.0 - textSize.height) / 2.0)), size: textSize))
return panelHeight
}
}