mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Improvements for automatic range mode
- Only update range mode if visibility changes if the node is not range controlled - Only change explicitly set range mode if ASRangeController becomes visible - Return interface state for range controller in ASCollectionView and ASTableView based on if the containing node is range managed
This commit is contained in:
@@ -56,6 +56,11 @@ inline BOOL ASHierarchyStateIncludesLayoutPending(ASHierarchyState hierarchyStat
|
||||
return ((hierarchyState & ASHierarchyStateLayoutPending) == ASHierarchyStateLayoutPending);
|
||||
}
|
||||
|
||||
inline BOOL ASHierarchyStateIncludesRangeManaged(ASHierarchyState hierarchyState)
|
||||
{
|
||||
return ((hierarchyState & ASHierarchyStateRangeManaged) == ASHierarchyStateRangeManaged);
|
||||
}
|
||||
|
||||
@interface ASDisplayNode ()
|
||||
{
|
||||
@protected
|
||||
@@ -91,6 +96,14 @@ inline BOOL ASHierarchyStateIncludesLayoutPending(ASHierarchyState hierarchyStat
|
||||
*/
|
||||
@property (nonatomic, readwrite) ASHierarchyState hierarchyState;
|
||||
|
||||
/**
|
||||
* @abstract Return if the node is range managed or not
|
||||
*
|
||||
* @discussion Currently only set interface state on nodes in table and collection views. For other nodes, if they are
|
||||
* in the hierarchy we enable all ASInterfaceState types with `ASInterfaceStateInHierarchy`, otherwise `None`.
|
||||
*/
|
||||
- (BOOL)supportsRangeManagedInterfaceState;
|
||||
|
||||
// The two methods below will eventually be exposed, but their names are subject to change.
|
||||
/**
|
||||
* @abstract Ensure that all rendering is complete for this node and its descendents.
|
||||
|
||||
Reference in New Issue
Block a user