mirror of
https://code.videolan.org/videolan/vlc
synced 2024-09-04 09:11:33 +02:00
macosx: Separate more of audio collection view setup from VLCLibraryAudioDataSource, move into more logical VLCLibraryAudioViewController
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
parent
f546c78ef0
commit
55c0d4933b
@ -69,7 +69,6 @@ static NSString *VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto
|
||||
|
||||
@interface VLCLibraryAudioDataSource ()
|
||||
{
|
||||
VLCLibraryCollectionViewFlowLayout *_collectionViewFlowLayout;
|
||||
NSArray *_displayedCollection;
|
||||
enum vlc_ml_parent_type _currentParentType;
|
||||
|
||||
@ -306,7 +305,6 @@ static NSString *VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto
|
||||
- (void)setupCollectionView
|
||||
{
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.delegate = self;
|
||||
|
||||
[_collectionView registerClass:[VLCLibraryCollectionViewItem class] forItemWithIdentifier:VLCLibraryCellIdentifier];
|
||||
|
||||
@ -324,9 +322,6 @@ static NSString *VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto
|
||||
[_collectionView registerNib:mediaItemSupplementaryDetailView
|
||||
forSupplementaryViewOfKind:VLCLibraryCollectionViewMediaItemSupplementaryDetailViewKind
|
||||
withIdentifier:VLCLibraryCollectionViewMediaItemSupplementaryDetailViewIdentifier];
|
||||
|
||||
_collectionViewFlowLayout = [[VLCLibraryCollectionViewFlowLayout alloc] init];
|
||||
_collectionView.collectionViewLayout = _collectionViewFlowLayout;
|
||||
}
|
||||
|
||||
- (void)setupTableViews
|
||||
@ -431,7 +426,11 @@ static NSString *VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto
|
||||
|
||||
- (void)reloadViews
|
||||
{
|
||||
[_collectionViewFlowLayout resetLayout];
|
||||
VLCLibraryCollectionViewFlowLayout *collectionViewFlowLayout = (VLCLibraryCollectionViewFlowLayout *)_collectionView.collectionViewLayout;
|
||||
if (collectionViewFlowLayout) {
|
||||
[collectionViewFlowLayout resetLayout];
|
||||
}
|
||||
|
||||
[self.collectionView reloadData];
|
||||
[self.collectionSelectionTableView reloadData];
|
||||
[self.groupSelectionTableView reloadData];
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
#import "main/VLCMain.h"
|
||||
#import "extensions/NSString+Helpers.h"
|
||||
#import "library/VLCLibraryCollectionViewDelegate.h"
|
||||
#import "library/VLCLibraryCollectionViewFlowLayout.h"
|
||||
#import "library/VLCLibraryController.h"
|
||||
#import "library/VLCLibraryModel.h"
|
||||
#import "library/VLCLibraryNavigationStack.h"
|
||||
@ -34,6 +36,8 @@
|
||||
{
|
||||
NSArray<NSString *> *_placeholderImageNames;
|
||||
NSArray<NSString *> *_placeholderLabelStrings;
|
||||
|
||||
VLCLibraryCollectionViewDelegate *_audioLibraryCollectionViewDelegate;
|
||||
}
|
||||
@end
|
||||
|
||||
@ -100,6 +104,11 @@
|
||||
_audioLibraryCollectionView.selectable = YES;
|
||||
_audioLibraryCollectionView.allowsMultipleSelection = NO;
|
||||
_audioLibraryCollectionView.allowsEmptySelection = YES;
|
||||
|
||||
_audioLibraryCollectionViewDelegate = [[VLCLibraryCollectionViewDelegate alloc] init];
|
||||
_audioLibraryCollectionView.delegate = _audioLibraryCollectionViewDelegate;
|
||||
|
||||
_audioLibraryCollectionView.collectionViewLayout = [[VLCLibraryCollectionViewFlowLayout alloc] init];
|
||||
}
|
||||
|
||||
- (void)setupAudioTableViews
|
||||
|
Loading…
Reference in New Issue
Block a user