mirror of
https://github.com/danog/Telegram.git
synced 2024-12-04 10:27:46 +01:00
52 lines
1.2 KiB
Mathematica
52 lines
1.2 KiB
Mathematica
|
#import "TGModernMediaPickerLayout.h"
|
||
|
|
||
|
@interface TGModernMediaPickerLayout ()
|
||
|
{
|
||
|
bool _updatingCollectionItems;
|
||
|
}
|
||
|
|
||
|
@end
|
||
|
|
||
|
@implementation TGModernMediaPickerLayout
|
||
|
|
||
|
- (instancetype)init
|
||
|
{
|
||
|
self = [super init];
|
||
|
if (self != nil)
|
||
|
{
|
||
|
}
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
/*- (void)prepareForCollectionViewUpdates:(NSArray *)updateItems
|
||
|
{
|
||
|
_updatingCollectionItems = true;
|
||
|
|
||
|
[super prepareForCollectionViewUpdates:updateItems];
|
||
|
}
|
||
|
|
||
|
- (void)finalizeCollectionViewUpdates
|
||
|
{
|
||
|
_updatingCollectionItems = false;
|
||
|
|
||
|
[super finalizeCollectionViewUpdates];
|
||
|
}*/
|
||
|
|
||
|
- (UICollectionViewLayoutAttributes *)initialLayoutAttributesForAppearingItemAtIndexPath:(NSIndexPath *)itemIndexPath
|
||
|
{
|
||
|
if (_updatingCollectionItems || itemIndexPath.section != 0)
|
||
|
return [super initialLayoutAttributesForAppearingItemAtIndexPath:itemIndexPath];
|
||
|
|
||
|
return nil;
|
||
|
}
|
||
|
|
||
|
- (UICollectionViewLayoutAttributes *)finalLayoutAttributesForDisappearingItemAtIndexPath:(NSIndexPath *)itemIndexPath
|
||
|
{
|
||
|
if (_updatingCollectionItems || itemIndexPath.section != 0)
|
||
|
return [super finalLayoutAttributesForDisappearingItemAtIndexPath:itemIndexPath];
|
||
|
|
||
|
return [self layoutAttributesForItemAtIndexPath:itemIndexPath];
|
||
|
}
|
||
|
|
||
|
@end
|