1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-04 02:17:51 +01:00
Telegram/Telegraph/TGDocumentMessageIconModel.m
2014-07-10 18:11:09 +04:00

48 lines
1.2 KiB
Objective-C

#import "TGDocumentMessageIconModel.h"
#import "TGDocumentMessageIconView.h"
@implementation TGDocumentMessageIconModel
- (Class)viewClass
{
return [TGDocumentMessageIconView class];
}
- (void)bindViewToContainer:(UIView *)container viewStorage:(TGModernViewStorage *)viewStorage
{
[super bindViewToContainer:container viewStorage:viewStorage];
TGDocumentMessageIconView *view = (TGDocumentMessageIconView *)[self boundView];
view.fileExtension = _fileExtension;
[view setProgress:_progress animated:false];
[view setOverlayType:_overlayType animated:false];
}
- (void)setProgress:(float)progress animated:(bool)animated
{
if (ABS(_progress - progress) > FLT_EPSILON)
{
_progress = progress;
[((TGDocumentMessageIconView *)self.boundView) setProgress:_progress animated:animated];
}
}
- (void)setOverlayType:(int)overlayType
{
[self setOverlayType:overlayType animated:false];
}
- (void)setOverlayType:(int)overlayType animated:(bool)animated
{
if (_overlayType != overlayType)
{
_overlayType = overlayType;
[((TGDocumentMessageIconView *)self.boundView) setOverlayType:_overlayType animated:animated];
}
}
@end