1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-12 09:29:55 +01:00
Telegram/Telegraph/TGModernGalleryImageItemImageView.m

35 lines
917 B
Mathematica
Raw Normal View History

2015-10-01 18:19:52 +02:00
#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