Commit dc21959e authored by Felix Paul Kühne's avatar Felix Paul Kühne

library: fix mode and layout setting when using the collection view so we can...

library: fix mode and layout setting when using the collection view so we can always drop stuff on folders

(cherry picked from commit 44fb1af4)
parent aae07a12
......@@ -281,6 +281,7 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
}
_reorderLayout = [[LXReorderableCollectionViewFlowLayout alloc] init];
[self.collectionView setCollectionViewLayout:_reorderLayout animated:NO];
_libraryMode = VLCLibraryModeFolder;
}
}
@synchronized(self) {
......@@ -573,6 +574,19 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
} else {
[self.collectionView reloadData];
[self updateActionBarButtonItemStateWithSelectedIndexPaths:[self.collectionView indexPathsForSelectedItems]];
if (_libraryMode == VLCLibraryModeAllFiles) {
if (self.collectionView.collectionViewLayout != _folderLayout) {
for (UIGestureRecognizer *recognizer in _collectionView.gestureRecognizers) {
if (recognizer != _folderLayout.panGestureRecognizer ||
recognizer != _folderLayout.longPressGestureRecognizer ||
recognizer != _longPressGestureRecognizer)
[self.collectionView removeGestureRecognizer:recognizer];
}
[self.collectionView setCollectionViewLayout:_folderLayout animated:NO];
[self.collectionView addGestureRecognizer:_longPressGestureRecognizer];
}
}
}
[self _displayEmptyLibraryViewIfNeeded];
......@@ -1224,7 +1238,7 @@ static NSString *kUsingTableViewToShowData = @"UsingTableViewToShowData";
NSMutableArray *toolbarItems = [self.toolbarItems mutableCopy];
toolbarItems[2] = createFolderItem;
self.toolbarItems = toolbarItems;
[self setLibraryMode:_libraryMode];
[self setLibraryMode:_previousLibraryMode];
[self updateViewContents];
}
......
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