-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ASCollectionView] Call -invalidateFlowLayoutDelegateMetrics when rotating. #trivial #616
Conversation
…led for UIKit passthrough cells. This allows rotation to work properly when rotating UIKit passthrough cells that need to change width.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems right to me, although we'll have to keep an eye out and keep evolving it since UICVFL is such an intricate machine. Let's go forward with it 👍
BOOL fixedHorizontally = (ASScrollDirectionContainsHorizontalDirection(scrollDirection) == NO); | ||
|
||
BOOL changedInNonScrollingDirection = (fixedHorizontally && newBounds.size.width != lastUsedSize.width) || (fixedVertically && newBounds.size.height != lastUsedSize.height); | ||
BOOL changedInNonScrollingDirection = (fixedHorizontally && newSize.width != lastUsedSize.width) || | ||
(fixedVertically && newSize.height != lastUsedSize.height); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delightful!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-D thanks for sharing your aesthetic approval, always good to see & re-align as a team
Source/ASCollectionView.mm
Outdated
@@ -367,6 +367,7 @@ - (void)scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICol | |||
|
|||
- (void)relayoutItems | |||
{ | |||
[self invalidateFlowLayoutDelegateMetrics]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nguyenhuy @Adlai-Holler thanks guys - ready for another look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…ating. #trivial (TextureGroup#616) * [ASCollectionView] Ensure -invalidateFlowLayoutDelegateMetrics is called for UIKit passthrough cells. This allows rotation to work properly when rotating UIKit passthrough cells that need to change width. * [ASCollectionView] No need to verify node is still in model to handle view-only notifications.
This allows rotation to work properly when rotating UIKit passthrough
cells that need to change width.
This diff was written and tested for use with #431, but it's fundamentally the same with the current HEAD.