mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-09 22:20:41 +00:00
Clean up node transition API
This commit is contained in:
parent
3444fa18dd
commit
a00e9bb41c
@ -50,10 +50,18 @@
|
|||||||
- (void)didCompleteLayoutTransition:(id<ASContextTransitioning>)context;
|
- (void)didCompleteLayoutTransition:(id<ASContextTransitioning>)context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract Invalidates the current layout and begins a relayout of the node to the new layout returned in `calculateLayoutThatFits:`.
|
* @abstract Transitions the current layout with a new constrained size.
|
||||||
*
|
*
|
||||||
* @discussion Animation is optional, but will still proceed through the `transitionLayout` methods with `isAnimated == NO`.
|
* @discussion Animation is optional, but will still proceed through your `animateLayoutTransition` implementation with `isAnimated == NO`.
|
||||||
|
* If the passed constrainedSize is the the same as the node's current constrained size, this method is noop.
|
||||||
*/
|
*/
|
||||||
- (ASLayout *)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize animated:(BOOL)animated;
|
- (ASLayout *)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize animated:(BOOL)animated;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @abstract Invalidates the current layout and begins a relayout of the node with the current `constrainedSize`.
|
||||||
|
*
|
||||||
|
* @discussion Animation is optional, but will still proceed through your `animateLayoutTransition` implementation with `isAnimated == NO`.
|
||||||
|
*/
|
||||||
|
- (ASLayout *)transitionLayoutWithAnimation:(BOOL)animated;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -675,9 +675,14 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
|
|||||||
return _pendingLayout;
|
return _pendingLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (ASLayout *)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize animated:(BOOL)animated
|
- (ASLayout *)transitionLayoutWithAnimation:(BOOL)animated
|
||||||
{
|
{
|
||||||
[self invalidateCalculatedLayout];
|
[self invalidateCalculatedLayout];
|
||||||
|
[self transitionLayoutWithSizeRange:_constrainedSize animated:animated];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (ASLayout *)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize animated:(BOOL)animated
|
||||||
|
{
|
||||||
return [self measureWithSizeRange:constrainedSize completion:^{
|
return [self measureWithSizeRange:constrainedSize completion:^{
|
||||||
_transitionContext = [[_ASTransitionContext alloc] initWithLayout:_pendingLayout
|
_transitionContext = [[_ASTransitionContext alloc] initWithLayout:_pendingLayout
|
||||||
constrainedSize:constrainedSize
|
constrainedSize:constrainedSize
|
||||||
|
@ -59,6 +59,9 @@
|
|||||||
- (void)viewWillAppear:(BOOL)animated
|
- (void)viewWillAppear:(BOOL)animated
|
||||||
{
|
{
|
||||||
[super viewWillAppear:animated];
|
[super viewWillAppear:animated];
|
||||||
|
|
||||||
|
[_node measureWithSizeRange:[self nodeConstrainedSize]];
|
||||||
|
|
||||||
_ensureDisplayed = YES;
|
_ensureDisplayed = YES;
|
||||||
[_node recursivelyFetchData];
|
[_node recursivelyFetchData];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user