mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-27 22:39:48 +00:00
Add support for "hidden" smart asset group
This commit is contained in:
@@ -17,7 +17,8 @@ typedef enum
|
||||
TGMediaAssetGroupSubtypeBursts,
|
||||
TGMediaAssetGroupSubtypeScreenshots,
|
||||
TGMediaAssetGroupSubtypeAnimated,
|
||||
TGMediaAssetGroupSubtypeRegular
|
||||
TGMediaAssetGroupSubtypeRegular,
|
||||
TGMediaAssetGroupSubtypeHidden
|
||||
} TGMediaAssetGroupSubtype;
|
||||
|
||||
@interface TGMediaAssetGroup : NSObject
|
||||
|
||||
@@ -245,6 +245,10 @@
|
||||
|
||||
case PHAssetCollectionSubtypeSmartAlbumAnimated:
|
||||
return TGMediaAssetGroupSubtypeAnimated;
|
||||
|
||||
case PHAssetCollectionSubtypeSmartAlbumAllHidden:
|
||||
return TGMediaAssetGroupSubtypeHidden;
|
||||
|
||||
default:
|
||||
return TGMediaAssetGroupSubtypeRegular;
|
||||
}
|
||||
@@ -360,6 +364,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
case PHAssetCollectionSubtypeSmartAlbumAllHidden:
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -61,10 +61,6 @@
|
||||
PHFetchOptions *options = [[PHFetchOptions alloc] init];
|
||||
options.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"startDate" ascending:true]];
|
||||
|
||||
//PHFetchResult *moments = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeMoment subtype:PHAssetCollectionSubtypeAny options:options];
|
||||
//TGMediaAssetMomentList *momentList = [[TGMediaAssetMomentList alloc] initWithPHFetchResult:moments];
|
||||
//[groups insertObject:momentList atIndex:0];
|
||||
|
||||
return groups;
|
||||
}];
|
||||
};
|
||||
|
||||
@@ -276,8 +276,7 @@ const CGFloat TGMediaGroupCellHeight = 86.0f;
|
||||
_countLabel.text = [[NSString alloc] initWithFormat:@"%ld", (long)assetGroup.assetCount];
|
||||
[self setNeedsLayout];
|
||||
|
||||
[self configureThumbnailsWithAssets:[assetGroup latestAssets]];
|
||||
|
||||
bool hideThumbnail = false;
|
||||
UIImage *iconImage = nil;
|
||||
switch (assetGroup.subtype)
|
||||
{
|
||||
@@ -313,10 +312,14 @@ const CGFloat TGMediaGroupCellHeight = 86.0f;
|
||||
iconImage = TGComponentsImageNamed(@"MediaGroupSelfPortraits");
|
||||
break;
|
||||
|
||||
case TGMediaAssetGroupSubtypeHidden:
|
||||
hideThumbnail = true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
[self configureThumbnailsWithAssets:hideThumbnail ? @[] : [assetGroup latestAssets]];
|
||||
|
||||
_iconView.image = iconImage;
|
||||
_iconView.hidden = (iconImage == nil);
|
||||
_shadowView.hidden = _iconView.hidden;
|
||||
|
||||
Reference in New Issue
Block a user