[ASPagerNode] Fix content insets are wrong in pager node if root node of ASViewController and transition back (#2736)

* Fix content insets are wrong in pager node if root node of ASViewController and transition back

* Add unit test

* Improve test

* Fix test

* Move tests to ASPagerNodeTests
This commit is contained in:
Michael Schneider
2016-12-12 16:05:09 -08:00
committed by appleguy
parent d874eed78a
commit 57cd6a3ba8
2 changed files with 73 additions and 6 deletions

View File

@@ -1232,10 +1232,6 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
- (void)layoutSubviews
{
if (_zeroContentInsets) {
self.contentInset = UIEdgeInsetsZero;
}
// Flush any pending invalidation action if needed.
ASCollectionViewInvalidationStyle invalidationStyle = _nextLayoutInvalidationStyle;
_nextLayoutInvalidationStyle = ASCollectionViewInvalidationStyleNone;
@@ -1254,6 +1250,10 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
// To ensure _maxSizeForNodesConstrainedSize is up-to-date for every usage, this call to super must be done last
[super layoutSubviews];
if (_zeroContentInsets) {
self.contentInset = UIEdgeInsetsZero;
}
// Update range controller immediately if possible & needed.
// Calling -updateIfNeeded in here with self.window == nil (early in the collection view's life)