Commit 0731b6fa authored by Tobias's avatar Tobias Committed by Felix Paul Kühne

fix #14633 fix top inset for collection view

fix insets for mini player when toggling between table and collection view

(cherry picked from commit 25c0d41a)
Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 187b0dda
......@@ -139,15 +139,17 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
[_collectionView reloadData];
}
if (setInset && _usingTableViewToShowData) {
if (setInset) {
CGSize statusBarSize = [UIApplication sharedApplication].statusBarFrame.size;
// Status bar frame doesn't change correctly on rotation
CGFloat statusBarHeight = MIN(statusBarSize.height, statusBarSize.width);
CGFloat originY = self.navigationController.navigationBar.frame.size.height + statusBarHeight;
_tableView.contentInset = UIEdgeInsetsMake(originY, 0, 0, 0);
UIScrollView *playlistView = _usingTableViewToShowData ? _tableView : _collectionView;
playlistView.contentInset = UIEdgeInsetsMake(originY, 0, 0, 0);
}
[self adjustScrollViewInsetsForMiniPlayerVisible:_miniPlaybackView.visible];
self.view = contentView;
[self displayMiniPlaybackViewIfNeeded];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment