Skip to content
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

Merged
merged 3 commits into from
Oct 31, 2017

Conversation

appleguy
Copy link
Member

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.

…led for UIKit passthrough cells.

This allows rotation to work properly when rotating UIKit passthrough
cells that need to change width.
@appleguy appleguy changed the title [ASCollectionView] Call -invalidateFlowLayoutDelegateMetrics when rotating. [ASCollectionView] Call -invalidateFlowLayoutDelegateMetrics when rotating. #trivial Oct 16, 2017
Copy link
Member

@Adlai-Holler Adlai-Holler left a 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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delightful!

Copy link
Member Author

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

@@ -367,6 +367,7 @@ - (void)scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICol

- (void)relayoutItems
{
[self invalidateFlowLayoutDelegateMetrics];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@appleguy Now that #431 is merged, please update this PR. Also, should [self invalidateFlowLayoutDelegateMetrics]; be called inside the invalidation block?

@appleguy
Copy link
Member Author

@nguyenhuy @Adlai-Holler thanks guys - ready for another look

Copy link
Member

@nguyenhuy nguyenhuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nguyenhuy nguyenhuy merged commit 63efdbd into master Oct 31, 2017
bernieperez pushed a commit to AtomTickets/Texture that referenced this pull request Apr 25, 2018
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants