mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 13:35:19 +00:00
Fix scrolling
This commit is contained in:
parent
53bdcd7ef7
commit
e578479e7b
@ -4,7 +4,6 @@ import SwiftSignalKit
|
||||
import UIKitRuntimeUtils
|
||||
import ObjCRuntimeUtils
|
||||
|
||||
private let infiniteScrollSize: CGFloat = 10000.0
|
||||
private let insertionAnimationDuration: Double = 0.4
|
||||
|
||||
private struct VisibleHeaderNodeId: Hashable {
|
||||
@ -161,6 +160,8 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
private final var lastContentOffset: CGPoint = CGPoint()
|
||||
private final var lastContentOffsetTimestamp: CFAbsoluteTime = 0.0
|
||||
private final var ignoreScrollingEvents: Bool = false
|
||||
|
||||
private let infiniteScrollSize: CGFloat
|
||||
|
||||
private final var displayLink: CADisplayLink!
|
||||
private final var needsAnimations = false
|
||||
@ -368,6 +369,8 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
self.transactionQueue = ListViewTransactionQueue()
|
||||
|
||||
self.scroller = ListViewScroller()
|
||||
|
||||
self.infiniteScrollSize = 10000.0
|
||||
|
||||
super.init()
|
||||
|
||||
@ -837,13 +840,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
print("Scrolling delta: \(delta)")
|
||||
}
|
||||
}
|
||||
self.previousDidScrollTimestamp = timestamp
|
||||
|
||||
if let displayLink = self.scroller.getIvarValue("_scrollHeartbeat") as? CADisplayLink {
|
||||
if #available(iOS 10.0, *) {
|
||||
displayLink.preferredFramesPerSecond = 120
|
||||
}
|
||||
}*/
|
||||
self.previousDidScrollTimestamp = timestamp*/
|
||||
|
||||
//CATransaction.begin()
|
||||
//CATransaction.setDisableActions(true)
|
||||
@ -871,7 +868,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
self.trackingOffset += -deltaY
|
||||
}
|
||||
|
||||
self.enqueueUpdateVisibleItems(synchronous: true)
|
||||
self.enqueueUpdateVisibleItems(synchronous: false)
|
||||
|
||||
var useScrollDynamics = false
|
||||
|
||||
@ -1531,8 +1528,12 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
else
|
||||
{
|
||||
self.scroller.contentSize = CGSize(width: self.visibleSize.width, height: infiniteScrollSize * 2.0)
|
||||
self.lastContentOffset = CGPoint(x: 0.0, y: infiniteScrollSize)
|
||||
self.scroller.contentOffset = self.lastContentOffset
|
||||
if abs(self.scroller.contentOffset.y - infiniteScrollSize) > infiniteScrollSize / 2.0 {
|
||||
self.lastContentOffset = CGPoint(x: 0.0, y: infiniteScrollSize)
|
||||
self.scroller.contentOffset = self.lastContentOffset
|
||||
} else {
|
||||
self.lastContentOffset = self.scroller.contentOffset
|
||||
}
|
||||
}
|
||||
self.ignoreScrollingEvents = wasIgnoringScrollingEvents
|
||||
}
|
||||
|
@ -109,6 +109,8 @@
|
||||
} else {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSArray<NSString *> * _Nonnull)getIvarList:(Class _Nonnull)classValue {
|
||||
NSMutableArray<NSString *> *result = [[NSMutableArray alloc] init];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user