mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
UI optimizations
This commit is contained in:
@@ -383,8 +383,41 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
private let waitingForNodesDisposable = MetaDisposable()
|
||||
|
||||
private var auxiliaryDisplayLink: CADisplayLink?
|
||||
private var auxiliaryDisplayLinkHandle: SharedDisplayLinkDriver.Link?
|
||||
private var debugView: UIView?
|
||||
private var isAuxiliaryDisplayLinkEnabled: Bool = false {
|
||||
didSet {
|
||||
if self.isAuxiliaryDisplayLinkEnabled {
|
||||
if self.auxiliaryDisplayLinkHandle == nil {
|
||||
self.auxiliaryDisplayLinkHandle = SharedDisplayLinkDriver.shared.add(needsHighestFramerate: true, { [weak self] in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
if self.debugView == nil {
|
||||
let debugView = UIView(frame: CGRect(origin: CGPoint(), size: CGSize(width: 1.0, height: 1.0)))
|
||||
debugView.backgroundColor = .black
|
||||
debugView.alpha = 0.0001
|
||||
self.debugView = debugView
|
||||
self.view.addSubview(debugView)
|
||||
}
|
||||
if let debugView = self.debugView {
|
||||
if debugView.frame.origin.x == 0.0 {
|
||||
debugView.frame = CGRect(origin: CGPoint(x: 1.0, y: 0.0), size: CGSize(width: 1.0, height: 1.0))
|
||||
} else {
|
||||
debugView.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: 1.0, height: 1.0))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if let auxiliaryDisplayLinkHandle = self.auxiliaryDisplayLinkHandle {
|
||||
self.auxiliaryDisplayLinkHandle = nil
|
||||
auxiliaryDisplayLinkHandle.invalidate()
|
||||
if let debugView = self.debugView {
|
||||
self.debugView = nil
|
||||
debugView.removeFromSuperview()
|
||||
}
|
||||
}
|
||||
|
||||
/*if self.isAuxiliaryDisplayLinkEnabled != oldValue {
|
||||
if self.isAuxiliaryDisplayLinkEnabled {
|
||||
if self.auxiliaryDisplayLink == nil {
|
||||
@@ -3536,7 +3569,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
}
|
||||
}
|
||||
|
||||
private func updateItemHeaders(leftInset: CGFloat, rightInset: CGFloat, synchronousLoad: Bool, transition: (ContainedViewLayoutTransition, Bool, CGFloat) = (.immediate, false, 0.0), animateInsertion: Bool = false) {
|
||||
private func updateItemHeaders(leftInset: CGFloat, rightInset: CGFloat, synchronousLoad: Bool, transition: (ContainedViewLayoutTransition, Bool, CGFloat) = (.immediate, false, 0.0), animateInsertion: Bool = false) {
|
||||
self.assignHeaderSpaceAffinities()
|
||||
|
||||
let upperDisplayBound = self.headerInsets.top
|
||||
|
||||
Reference in New Issue
Block a user