mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-06 12:43:58 +00:00
Cleanup
This commit is contained in:
parent
dcc54c0d36
commit
b0eb2f81c2
@ -235,7 +235,6 @@
|
||||
return;
|
||||
|
||||
_contentSpacing = contentSpacing;
|
||||
[self setNeedsLayout];
|
||||
[self invalidateSize];
|
||||
}
|
||||
|
||||
@ -252,7 +251,6 @@
|
||||
return;
|
||||
|
||||
_laysOutHorizontally = laysOutHorizontally;
|
||||
[self setNeedsLayout];
|
||||
[self invalidateSize];
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,12 @@ static NSMutableSet *__cellClassesForVisibilityNotifications = nil; // See +init
|
||||
- (void)didInvalidateSize
|
||||
{
|
||||
CGSize oldSize = self.calculatedSize;
|
||||
CGSize newSize = [self layoutThatFits:[self constrainedSize]].size;
|
||||
|
||||
ASSizeRange constrainedSize = ASSizeRangeMake(CGSizeZero, CGSizeMake(CGRectGetWidth(self.bounds), CGFLOAT_MAX));
|
||||
if (_interactionDelegate != nil) {
|
||||
constrainedSize = [_interactionDelegate constrainedSizeForNode:self];
|
||||
}
|
||||
CGSize newSize = [self layoutThatFits:constrainedSize].size;
|
||||
|
||||
if (CGSizeEqualToSize(oldSize, newSize) == NO) {
|
||||
self.frame = {self.frame.origin, newSize};
|
||||
@ -173,14 +178,6 @@ static NSMutableSet *__cellClassesForVisibilityNotifications = nil; // See +init
|
||||
}
|
||||
}
|
||||
|
||||
- (ASSizeRange)constrainedSize
|
||||
{
|
||||
if (_interactionDelegate != nil) {
|
||||
return [_interactionDelegate constrainedSizeForNode:self];
|
||||
}
|
||||
return ASSizeRangeMake(CGSizeZero, CGSizeMake(CGRectGetWidth(self.bounds), CGFLOAT_MAX));
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected
|
||||
{
|
||||
if (_selected != selected) {
|
||||
|
@ -26,19 +26,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class ASDisplayNode;
|
||||
|
||||
// TODO: Extract to ASDisplayNode+Layout.h
|
||||
// ASDisplayNodeSizingDelegate / ASDisplayNodeSizingHandlers
|
||||
@protocol ASDisplayNodeSizingDelegate<NSObject>
|
||||
@required
|
||||
/**
|
||||
Called after the display node state update happened (layout invlidation) that could lead to a
|
||||
|
||||
The delegate can use this callback to appropriately resize the node frame to fit the new
|
||||
node size. The node will not resize itself.
|
||||
*/
|
||||
- (void)displayNodeDidInvalidateSize:(ASDisplayNode *)displayNode;
|
||||
@end
|
||||
|
||||
/**
|
||||
* UIView creation block. Used to create the backing view of a new display node.
|
||||
*/
|
||||
@ -267,11 +254,10 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
|
||||
/** @name Managing dimensions */
|
||||
|
||||
//@property (nonatomic, readwrite, weak, nullable) id<ASDisplayNodeSizingDelegate> sizingDelegate;
|
||||
// TODO: coalesc: Documentation
|
||||
- (void)invalidateSize;
|
||||
- (void)didInvalidateSize;
|
||||
- (void)sizeToFit;
|
||||
|
||||
- (CGSize)sizeThatFits:(CGSize)size;
|
||||
|
||||
/**
|
||||
|
@ -712,13 +712,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
|
||||
// Mark the node for layout in the next layout pass
|
||||
[self invalidateCalculatedLayout];
|
||||
|
||||
// This is the root node. Let the delegate know that the size changed
|
||||
// If someone calls `invalidateBlaBla TBD` we have to inform the sizing delegate of the root node to be able
|
||||
// to let them now that a size change happened and it needs to calculate a new layout / size for this node hierarchy
|
||||
// if ([self.sizingDelegate respondsToSelector:@selector(displayNodeDidInvalidateSize:)]) {
|
||||
// [self.sizingDelegate displayNodeDidInvalidateSize:self];
|
||||
// }
|
||||
|
||||
// Hook for subclasses to get size invalidation changes
|
||||
[self didInvalidateSize];
|
||||
|
||||
|
@ -28,8 +28,6 @@ static const NSInteger kImageHeight = 200;
|
||||
@property (nonatomic, copy) NSString *imageCategory;
|
||||
@property (nonatomic, strong) ASCollectionNode *collectionNode;
|
||||
|
||||
@property (nonatomic, strong) ASDisplayNode *backgroundNode;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user