mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[ASRangeController] Ensure that even if the collection view layout is inconsistent, it is impossible for a visible item to not be in the display range.
This commit is contained in:
@@ -120,11 +120,6 @@ typedef NS_OPTIONS(NSUInteger, ASControlState) {
|
||||
*/
|
||||
- (void)sendActionsForControlEvents:(ASControlNodeEvent)controlEvents withEvent:(nullable UIEvent *)event;
|
||||
|
||||
/**
|
||||
Class method to enable a visualization overlay of the tapable area on the ASControlNode. For app debugging purposes only.
|
||||
@param enable Specify YES to make this debug feature enabled when messaging the ASControlNode class.
|
||||
*/
|
||||
+ (void)setEnableHitTestDebug:(BOOL)enable;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -2003,6 +2003,8 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
|
||||
|
||||
- (void)setInterfaceState:(ASInterfaceState)newState
|
||||
{
|
||||
// It should never be possible for a node to be visible but not be allowed / expected to display.
|
||||
ASDisplayNodeAssertFalse(ASInterfaceStateIncludesVisible(newState) && !ASInterfaceStateIncludesDisplay(newState));
|
||||
ASInterfaceState oldState = ASInterfaceStateNone;
|
||||
{
|
||||
ASDN::MutexLocker l(_propertyLock);
|
||||
|
||||
@@ -6,9 +6,19 @@
|
||||
// Copyright © 2016 Facebook. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "ASControlNode.h"
|
||||
#import "ASImageNode.h"
|
||||
|
||||
@interface ASControlNode (Debugging)
|
||||
|
||||
/**
|
||||
Class method to enable a visualization overlay of the tapable area on the ASControlNode. For app debugging purposes only.
|
||||
@param enable Specify YES to make this debug feature enabled when messaging the ASControlNode class.
|
||||
*/
|
||||
+ (void)setEnableHitTestDebug:(BOOL)enable;
|
||||
|
||||
@end
|
||||
|
||||
@interface ASImageNode (Debugging)
|
||||
|
||||
/**
|
||||
|
||||
@@ -238,6 +238,7 @@ static UIApplicationState __ApplicationState = UIApplicationStateActive;
|
||||
[self registerForNotificationsForInterfaceStateIfNeeded:selfInterfaceState];
|
||||
|
||||
#if ASRangeControllerLoggingEnabled
|
||||
ASDisplayNodeAssertTrue([visibleIndexPaths isSubsetOfSet:displayIndexPaths]);
|
||||
NSMutableArray<NSIndexPath *> *modifiedIndexPaths = (ASRangeControllerLoggingEnabled ? [NSMutableArray array] : nil);
|
||||
#endif
|
||||
|
||||
@@ -247,14 +248,15 @@ static UIApplicationState __ApplicationState = UIApplicationStateActive;
|
||||
ASInterfaceState interfaceState = ASInterfaceStateMeasureLayout;
|
||||
|
||||
if (ASInterfaceStateIncludesVisible(selfInterfaceState)) {
|
||||
if ([visibleIndexPaths containsObject:indexPath]) {
|
||||
interfaceState |= (ASInterfaceStateVisible | ASInterfaceStateDisplay | ASInterfaceStateFetchData);
|
||||
} else {
|
||||
if ([fetchDataIndexPaths containsObject:indexPath]) {
|
||||
interfaceState |= ASInterfaceStateFetchData;
|
||||
}
|
||||
if ([displayIndexPaths containsObject:indexPath]) {
|
||||
interfaceState |= ASInterfaceStateDisplay;
|
||||
}
|
||||
if ([visibleIndexPaths containsObject:indexPath]) {
|
||||
interfaceState |= ASInterfaceStateVisible;
|
||||
}
|
||||
} else {
|
||||
// If selfInterfaceState isn't visible, then visibleIndexPaths represents what /will/ be immediately visible at the
|
||||
|
||||
Reference in New Issue
Block a user