mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-19 04:39:36 +00:00
[ASDisplayNode] Fix flickering for nodes that support range managed interface state (#2710)
* Fix flickering for range managed nodes * Go back to old behavior to check for range managed before calling didExitPreloadState in interface state change
This commit is contained in:
parent
e361d00a73
commit
a2e75152f8
@ -2993,12 +2993,10 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
|
|||||||
- (void)didExitPreloadState
|
- (void)didExitPreloadState
|
||||||
{
|
{
|
||||||
if (_methodOverrides & ASDisplayNodeMethodOverrideClearFetchedData) {
|
if (_methodOverrides & ASDisplayNodeMethodOverrideClearFetchedData) {
|
||||||
if ([self supportsRangeManagedInterfaceState]) {
|
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
[self clearFetchedData];
|
[self clearFetchedData];
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3068,7 +3066,11 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
|
|||||||
if (nowPreload) {
|
if (nowPreload) {
|
||||||
[self didEnterPreloadState];
|
[self didEnterPreloadState];
|
||||||
} else {
|
} else {
|
||||||
[self didExitPreloadState];
|
// We don't want to call -didExitPreloadState on nodes that aren't being managed by a range controller.
|
||||||
|
// Otherwise we get flashing behavior from normal UIKit manipulations like navigation controller push / pop.
|
||||||
|
if ([self supportsRangeManagedInterfaceState]) {
|
||||||
|
[self didExitPreloadState];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1936,6 +1936,7 @@ static bool stringContainsPointer(NSString *description, id p) {
|
|||||||
- (void)testDidExitPreloadIsCalledWhenNodesExitPreloadRange
|
- (void)testDidExitPreloadIsCalledWhenNodesExitPreloadRange
|
||||||
{
|
{
|
||||||
ASTestDisplayNode *node = [[ASTestDisplayNode alloc] init];
|
ASTestDisplayNode *node = [[ASTestDisplayNode alloc] init];
|
||||||
|
[node setHierarchyState:ASHierarchyStateRangeManaged];
|
||||||
|
|
||||||
[node recursivelySetInterfaceState:ASInterfaceStatePreload];
|
[node recursivelySetInterfaceState:ASInterfaceStatePreload];
|
||||||
[node recursivelySetInterfaceState:ASInterfaceStateDisplay];
|
[node recursivelySetInterfaceState:ASInterfaceStateDisplay];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user