Merge branch 'beta'

This commit is contained in:
Ali 2021-09-28 15:08:27 +04:00
commit 53bdcd7ef7
6 changed files with 54 additions and 3 deletions

View File

@ -1817,6 +1817,8 @@ plist_fragment(
</dict> </dict>
</dict> </dict>
</array> </array>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
""".format( """.format(
telegram_bundle_id = telegram_bundle_id, telegram_bundle_id = telegram_bundle_id,
) )

View File

@ -2,6 +2,7 @@ import UIKit
import AsyncDisplayKit import AsyncDisplayKit
import SwiftSignalKit import SwiftSignalKit
import UIKitRuntimeUtils import UIKitRuntimeUtils
import ObjCRuntimeUtils
private let infiniteScrollSize: CGFloat = 10000.0 private let infiniteScrollSize: CGFloat = 10000.0
private let insertionAnimationDuration: Double = 0.4 private let insertionAnimationDuration: Double = 0.4
@ -822,11 +823,27 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
} }
private var generalAccumulatedDeltaY: CGFloat = 0.0 private var generalAccumulatedDeltaY: CGFloat = 0.0
private var previousDidScrollTimestamp: Double = 0.0
private func updateScrollViewDidScroll(_ scrollView: UIScrollView, synchronous: Bool) { private func updateScrollViewDidScroll(_ scrollView: UIScrollView, synchronous: Bool) {
if self.ignoreScrollingEvents || scroller !== self.scroller { if self.ignoreScrollingEvents || scroller !== self.scroller {
return return
} }
/*let timestamp = CACurrentMediaTime()
if !self.previousDidScrollTimestamp.isZero {
let delta = timestamp - self.previousDidScrollTimestamp
if delta < 0.1 {
print("Scrolling delta: \(delta)")
}
}
self.previousDidScrollTimestamp = timestamp
if let displayLink = self.scroller.getIvarValue("_scrollHeartbeat") as? CADisplayLink {
if #available(iOS 10.0, *) {
displayLink.preferredFramesPerSecond = 120
}
}*/
//CATransaction.begin() //CATransaction.begin()
//CATransaction.setDisableActions(true) //CATransaction.setDisableActions(true)
@ -854,7 +871,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
self.trackingOffset += -deltaY self.trackingOffset += -deltaY
} }
self.enqueueUpdateVisibleItems(synchronous: synchronous) self.enqueueUpdateVisibleItems(synchronous: true)
var useScrollDynamics = false var useScrollDynamics = false

View File

@ -22,6 +22,8 @@ typedef enum {
- (id _Nullable)associatedObjectForKey:(void const * _Nonnull)key; - (id _Nullable)associatedObjectForKey:(void const * _Nonnull)key;
- (bool)checkObjectIsKindOfClass:(Class _Nonnull)targetClass; - (bool)checkObjectIsKindOfClass:(Class _Nonnull)targetClass;
- (void)setClass:(Class _Nonnull)newClass; - (void)setClass:(Class _Nonnull)newClass;
+ (NSArray<NSString *> * _Nonnull)getIvarList:(Class _Nonnull)classValue;
- (id _Nullable)getIvarValue:(NSString * _Nonnull)name;
- (NSNumber * _Nullable)floatValueForKeyPath:(NSString * _Nonnull)keyPath; - (NSNumber * _Nullable)floatValueForKeyPath:(NSString * _Nonnull)keyPath;

View File

@ -109,6 +109,34 @@
} else { } else {
return nil; return nil;
} }
+ (NSArray<NSString *> * _Nonnull)getIvarList:(Class _Nonnull)classValue {
NSMutableArray<NSString *> *result = [[NSMutableArray alloc] init];
unsigned int varCount;
Ivar *vars = class_copyIvarList(classValue, &varCount);
for (int i = 0; i < varCount; i++) {
Ivar var = vars[i];
const char* name = ivar_getName(var);
const char* typeEncoding = ivar_getTypeEncoding(var);
[result addObject:[NSString stringWithFormat:@"%s: %s", name, typeEncoding]];
}
free(vars);
return result;
}
- (id _Nullable)getIvarValue:(NSString * _Nonnull)name {
Ivar ivar = class_getInstanceVariable([self class], [name UTF8String]);
if (!ivar){
return nil;
}
id value = object_getIvar(self, ivar);
return value;
} }
@end @end

View File

@ -1066,8 +1066,10 @@ final class PeerInfoVisualMediaPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScro
self.updateHeaderFlashing(animated: true) self.updateHeaderFlashing(animated: true)
} }
private var previousDidScrollTimestamp: Double = 0.0
func scrollViewDidScroll(_ scrollView: UIScrollView) { func scrollViewDidScroll(_ scrollView: UIScrollView) {
if let (size, sideInset, bottomInset, visibleHeight, _, _, presentationData) = self.currentParams { if let (size, sideInset, bottomInset, visibleHeight, _, _, presentationData) = self.currentParams {
self.updateVisibleItems(size: size, sideInset: sideInset, bottomInset: bottomInset, visibleHeight: visibleHeight, theme: presentationData.theme, strings: presentationData.strings, synchronousLoad: false) self.updateVisibleItems(size: size, sideInset: sideInset, bottomInset: bottomInset, visibleHeight: visibleHeight, theme: presentationData.theme, strings: presentationData.strings, synchronousLoad: false)

View File

@ -1,5 +1,5 @@
{ {
"app": "8.1", "app": "8.1.2",
"bazel": "4.0.0", "bazel": "4.0.0",
"xcode": "12.5.1" "xcode": "12.5.1"
} }