BugFix: Media Picker: user's albums are missing

https://github.com/vector-im/vector-ios/issues/208
This commit is contained in:
giomfo 2016-04-28 18:09:17 +02:00
parent 2a4cfebc9e
commit 4790dac377

View file

@ -376,7 +376,10 @@ static void *RecordingContext = &RecordingContext;
// Update Captures collection display
if (recentCaptures.count)
{
self.recentCapturesCollectionContainerViewHeightConstraint.constant = (ceil(recentCaptures.count / 4.0) * ((self.view.frame.size.width - 6) / 4)) + 10;
// recents Collection is limited to the first 12 assets
NSInteger recentsCount = ((recentCaptures.count > 12) ? 12 : recentCaptures.count);
self.recentCapturesCollectionContainerViewHeightConstraint.constant = (ceil(recentsCount / 4.0) * ((self.view.frame.size.width - 6) / 4)) + 10;
[self.recentCapturesCollectionContainerView needsUpdateConstraints];
[self.recentCapturesCollectionView reloadData];
@ -429,7 +432,10 @@ static void *RecordingContext = &RecordingContext;
if (recentCaptures.count)
{
self.recentCapturesCollectionView.hidden = NO;
self.recentCapturesCollectionContainerViewHeightConstraint.constant = (ceil(recentCaptures.count / 4.0) * ((self.view.frame.size.width - 6) / 4)) + 10;
// recents Collection is limited to the first 12 assets
NSInteger recentsCount = ((recentCaptures.count > 12) ? 12 : recentCaptures.count);
self.recentCapturesCollectionContainerViewHeightConstraint.constant = (ceil(recentsCount / 4.0) * ((self.view.frame.size.width - 6) / 4)) + 10;
[self.recentCapturesCollectionContainerView needsUpdateConstraints];
[self.recentCapturesCollectionView reloadData];
@ -1308,7 +1314,7 @@ static void *RecordingContext = &RecordingContext;
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
// Collection is limited to the first 12 assets
return (recentCaptures.count > 12) ? 12 : recentCaptures.count;
return ((recentCaptures.count > 12) ? 12 : recentCaptures.count);
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath