|
@@ -56,11 +56,11 @@
|
|
|
|
|
|
- (void)setupCollectionView {
|
|
|
UICollectionViewFlowLayout *followLayout = [[UICollectionViewFlowLayout alloc] init];
|
|
|
- followLayout.itemSize = CGSizeMake(ScreenWidth / 8.0 , ScreenWidth / 8.0);
|
|
|
+ followLayout.itemSize = CGSizeMake(ScreenWidth / 8.0 , 72);
|
|
|
followLayout.minimumLineSpacing = 0;
|
|
|
followLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
|
|
|
|
|
|
- _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 12, ScreenWidth, ScreenWidth / 8.0) collectionViewLayout:followLayout];
|
|
|
+ _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 38, ScreenWidth, 72) collectionViewLayout:followLayout];
|
|
|
_collectionView.dataSource = (id<UICollectionViewDataSource>)self;
|
|
|
[_collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"cell"];
|
|
|
[self addSubview:_collectionView];
|
|
@@ -69,29 +69,29 @@
|
|
|
- (void)setupSubviews {
|
|
|
|
|
|
_progressView = [[UIImageView alloc] initWithImage:[AliyunImage imageNamed:@"progress"]];
|
|
|
- _progressView.bounds = CGRectMake(0, 0, ScreenWidth / 8.0, ScreenWidth / 8.0);
|
|
|
+ _progressView.bounds = CGRectMake(0, 0, ScreenWidth / 8.0, 72);
|
|
|
_progressView.center = CGPointMake(0, CGRectGetMidY(self.bounds) + 6);
|
|
|
[self addSubview:_progressView];
|
|
|
|
|
|
- _durationLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 0, ScreenWidth - 200, 12)];
|
|
|
- _durationLabel.textColor = RGBToColor(240, 84, 135);
|
|
|
- _durationLabel.textAlignment = 1;
|
|
|
- _durationLabel.font = [UIFont systemFontOfSize:12];
|
|
|
+ _durationLabel = [[UILabel alloc] initWithFrame:CGRectMake(14, 0, ScreenWidth - 200, 18)];
|
|
|
+ _durationLabel.textColor = [UIColor whiteColor];
|
|
|
+ _durationLabel.textAlignment = UITextAlignmentLeft;
|
|
|
+ _durationLabel.font = [UIFont systemFontOfSize:13];
|
|
|
[self addSubview:_durationLabel];
|
|
|
|
|
|
_imageViewWith = ScreenWidth / 8.0 * 0.35;
|
|
|
_imageViewLeft = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"video_edit_left"]];
|
|
|
- _imageViewLeft.frame = CGRectMake(0, 12, _imageViewWith, ScreenWidth / 8.0);
|
|
|
+ _imageViewLeft.frame = CGRectMake(0, 38, _imageViewWith, 72);
|
|
|
_imageViewLeft.userInteractionEnabled = YES;
|
|
|
_imageViewRight = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"video_edit_right"]];
|
|
|
- _imageViewRight.frame = CGRectMake(ScreenWidth - _imageViewWith, 12, _imageViewWith, ScreenWidth / 8.0);
|
|
|
+ _imageViewRight.frame = CGRectMake(ScreenWidth - _imageViewWith, 38, _imageViewWith, 72);
|
|
|
_imageViewRight.userInteractionEnabled = YES;
|
|
|
|
|
|
|
|
|
- _topLineView = [[UIImageView alloc]initWithFrame:CGRectMake(_imageViewWith - 3 , 12, ScreenWidth - _imageViewWith *2 + 6, 3)];
|
|
|
+ _topLineView = [[UIImageView alloc]initWithFrame:CGRectMake(_imageViewWith - 3 , 38, ScreenWidth - _imageViewWith *2 + 6, 3)];
|
|
|
_topLineView.backgroundColor = [AliyunIConfig config].cutTopLineColor;
|
|
|
|
|
|
- _underLineView = [[UIImageView alloc]initWithFrame:CGRectMake(_imageViewWith - 3, _imageViewLeft.frame.size.height + 12 - 3 , ScreenWidth - _imageViewWith *2 + 6, 3)];
|
|
|
+ _underLineView = [[UIImageView alloc]initWithFrame:CGRectMake(_imageViewWith - 3, _imageViewLeft.frame.size.height + 38 - 3 , ScreenWidth - _imageViewWith *2 + 6, 3)];
|
|
|
_underLineView.backgroundColor = [AliyunIConfig config].cutBottomLineColor;
|
|
|
|
|
|
[self addSubview:_topLineView];
|
|
@@ -101,8 +101,8 @@
|
|
|
[self addSubview:_imageViewRight];
|
|
|
|
|
|
|
|
|
- _imageViewLeftMask = [[UIImageView alloc]initWithFrame:CGRectMake(0, 12, 0, _imageViewLeft.frame.size.height)];
|
|
|
- _imageViewRightMask = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_imageViewRight.frame), 12, 0, _imageViewLeft.frame.size.height)];
|
|
|
+ _imageViewLeftMask = [[UIImageView alloc]initWithFrame:CGRectMake(0, 38, 0, _imageViewLeft.frame.size.height)];
|
|
|
+ _imageViewRightMask = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_imageViewRight.frame), 38, 0, _imageViewLeft.frame.size.height)];
|
|
|
|
|
|
_imageViewLeftMask.backgroundColor = [AliyunIConfig config].backgroundColor;
|
|
|
_imageViewLeftMask.alpha = 0.8;
|
|
@@ -113,14 +113,14 @@
|
|
|
[self addSubview:_imageViewRightMask];
|
|
|
|
|
|
_imageViewBackground = [[UIImageView alloc] initWithImage:[AliyunImage imageNamed:@"paster_time_edit_slider_bg"]];
|
|
|
- _imageViewBackground.frame = CGRectMake(CGRectGetMaxX(_imageViewLeft.frame), CGRectGetMinY(_imageViewLeft.frame), CGRectGetMinX(_imageViewRight.frame) - CGRectGetMaxX(_imageViewLeft.frame), ScreenWidth / 8.0);
|
|
|
+ _imageViewBackground.frame = CGRectMake(CGRectGetMaxX(_imageViewLeft.frame), CGRectGetMinY(_imageViewLeft.frame), CGRectGetMinX(_imageViewRight.frame) - CGRectGetMaxX(_imageViewLeft.frame), 72);
|
|
|
[self addSubview:_imageViewBackground];
|
|
|
|
|
|
}
|
|
|
|
|
|
- (void)loadThumbnailData {
|
|
|
|
|
|
- _durationLabel.text = [NSString stringWithFormat:@"%.2f",_cutInfo.endTime - _cutInfo.startTime];
|
|
|
+ _durationLabel.text = [NSString stringWithFormat:@"已选取%.1fs",_cutInfo.endTime - _cutInfo.startTime];
|
|
|
CMTime startTime = kCMTimeZero;
|
|
|
NSMutableArray *array = [NSMutableArray array];
|
|
|
// CMTime addTime = CMTimeMake(1000,1000);
|
|
@@ -233,8 +233,8 @@
|
|
|
_imageViewLeftMask.frame = maskFrame;
|
|
|
|
|
|
_cutInfo.startTime = left;
|
|
|
- _imageViewBackground.frame = CGRectMake(CGRectGetMaxX(_imageViewLeft.frame), CGRectGetMinY(_imageViewLeft.frame), CGRectGetMinX(_imageViewRight.frame) - CGRectGetMaxX(_imageViewLeft.frame), ScreenWidth / 8.0);
|
|
|
- _durationLabel.text = [NSString stringWithFormat:@"%.2f",_cutInfo.endTime - _cutInfo.startTime];
|
|
|
+ _imageViewBackground.frame = CGRectMake(CGRectGetMaxX(_imageViewLeft.frame), CGRectGetMinY(_imageViewLeft.frame), CGRectGetMinX(_imageViewRight.frame) - CGRectGetMaxX(_imageViewLeft.frame), 72);
|
|
|
+ _durationLabel.text = [NSString stringWithFormat:@"已选取%.1fs",_cutInfo.endTime - _cutInfo.startTime];
|
|
|
if ([_delegate respondsToSelector:@selector(cutBarDidMovedToTime:)]) {
|
|
|
[_delegate cutBarDidMovedToTime:left];
|
|
|
}
|
|
@@ -251,8 +251,8 @@
|
|
|
maskFrame.origin.x = frame.origin.x + frame.size.width;
|
|
|
maskFrame.size.width = ScreenWidth - maskFrame.origin.x;
|
|
|
_imageViewRightMask.frame = maskFrame;
|
|
|
- _imageViewBackground.frame = CGRectMake(CGRectGetMaxX(_imageViewLeft.frame), CGRectGetMinY(_imageViewLeft.frame), CGRectGetMinX(_imageViewRight.frame) - CGRectGetMaxX(_imageViewLeft.frame), ScreenWidth / 8.0);
|
|
|
- _durationLabel.text = [NSString stringWithFormat:@"%.2f", _cutInfo.endTime - _cutInfo.startTime];
|
|
|
+ _imageViewBackground.frame = CGRectMake(CGRectGetMaxX(_imageViewLeft.frame), CGRectGetMinY(_imageViewLeft.frame), CGRectGetMinX(_imageViewRight.frame) - CGRectGetMaxX(_imageViewLeft.frame), 72);
|
|
|
+ _durationLabel.text = [NSString stringWithFormat:@"已选取%.1fs", _cutInfo.endTime - _cutInfo.startTime];
|
|
|
if ([_delegate respondsToSelector:@selector(cutBarDidMovedToTime:)]) {
|
|
|
[_delegate cutBarDidMovedToTime:right];
|
|
|
}
|