mirror of
https://github.com/danog/Telegram.git
synced 2024-12-03 09:57:46 +01:00
35 lines
917 B
Objective-C
35 lines
917 B
Objective-C
#import "TGModernGalleryImageItemImageView.h"
|
|
|
|
@interface TGModernGalleryImageItemImageView ()
|
|
|
|
@end
|
|
|
|
@implementation TGModernGalleryImageItemImageView
|
|
|
|
- (void)performProgressUpdate:(CGFloat)progress
|
|
{
|
|
[super performProgressUpdate:progress];
|
|
|
|
if (_progressChanged)
|
|
_progressChanged(progress);
|
|
}
|
|
|
|
- (void)_commitImage:(UIImage *)image partial:(bool)partial loadTime:(NSTimeInterval)loadTime
|
|
{
|
|
[super _commitImage:image partial:partial loadTime:loadTime];
|
|
|
|
_isPartial = partial;
|
|
|
|
bool available = (self.currentImage != nil && self.currentImage.size.width > 1 && self.currentImage.size.height > 1);
|
|
if (_availabilityStateChanged)
|
|
_availabilityStateChanged(available && !partial);
|
|
}
|
|
|
|
- (bool)isAvailableNow
|
|
{
|
|
bool available = (self.currentImage != nil && self.currentImage.size.width > 1 && self.currentImage.size.height > 1);
|
|
return available && !_isPartial;
|
|
}
|
|
|
|
@end
|