Various fixes

This commit is contained in:
Ilya Laktyushin
2020-11-12 20:12:00 +04:00
parent 8081430ad2
commit 40e28d769d
13 changed files with 138 additions and 138 deletions

View File

@@ -67,13 +67,12 @@ NSString *const TGMediaAssetsVideoCellKind = @"TGMediaAssetsVideoCellKind";
_iconView = [[UIImageView alloc] init];
_iconView.contentMode = UIViewContentModeCenter;
[self addSubview:_iconView];
_durationLabel = [[UILabel alloc] init];
_durationLabel.textColor = [UIColor whiteColor];
_durationLabel.backgroundColor = [UIColor clearColor];
_durationLabel.textAlignment = NSTextAlignmentRight;
_durationLabel.font = TGSystemFontOfSize(12.0f);
_durationLabel.font = TGBoldSystemFontOfSize(13);
[_durationLabel sizeToFit];
[self addSubview:_durationLabel];
@@ -113,6 +112,7 @@ NSString *const TGMediaAssetsVideoCellKind = @"TGMediaAssetsVideoCellKind";
durationString = [NSString stringWithFormat:@"%d:%02d", duration / 60, duration % 60];
_durationLabel.text = durationString;
[_durationLabel sizeToFit];
if (asset.subtypes & TGMediaAssetSubtypeVideoTimelapse)
_iconView.image = TGComponentsImageNamed(@"ModernMediaItemTimelapseIcon");
@@ -235,7 +235,9 @@ NSString *const TGMediaAssetsVideoCellKind = @"TGMediaAssetsVideoCellKind";
self.checkButton.frame = (CGRect){ { self.frame.size.width - self.checkButton.frame.size.width - 2, 2 }, self.checkButton.frame.size };
_shadowView.frame = (CGRect){ { 0, self.frame.size.height - _shadowView.frame.size.height }, {self.frame.size.width, _shadowView.frame.size.height } };
_iconView.frame = CGRectMake(0, self.frame.size.height - 19, 19, 19);
_durationLabel.frame = (CGRect){ { 5, _shadowView.frame.origin.y }, {self.frame.size.width - 5 - 4, _shadowView.frame.size.height } };
CGSize durationSize = _durationLabel.frame.size;
_durationLabel.frame = CGRectMake(self.frame.size.width - floor(durationSize.width) - 5.0, self.frame.size.height - floor(durationSize.height) - 4.0, durationSize.width, durationSize.height);
}
@end