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:
Michael Schneider
2016-03-15 13:38:46 -07:00
parent b30fa8b2f6
commit d3ba80ccfd
6 changed files with 59 additions and 25 deletions

View File

@@ -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.