|
@@ -13,8 +13,6 @@
|
|
#import "AlivcMacro.h"
|
|
#import "AlivcMacro.h"
|
|
#import "UIColor+AlivcHelper.h"
|
|
#import "UIColor+AlivcHelper.h"
|
|
|
|
|
|
-#define finishBtnX (CGRectGetWidth(self.bounds) - 58 - 10)
|
|
|
|
-
|
|
|
|
@interface AliyunMagicCameraView ()
|
|
@interface AliyunMagicCameraView ()
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -89,7 +87,6 @@
|
|
[self addSubview:self.selBackView];
|
|
[self addSubview:self.selBackView];
|
|
|
|
|
|
[self addSubview:self.backButton];
|
|
[self addSubview:self.backButton];
|
|
- [self.selBackView addSubview:self.finishButton];
|
|
|
|
[self addSubview:self.reverseButton];
|
|
[self addSubview:self.reverseButton];
|
|
[self addSubview:self.musicButton];
|
|
[self addSubview:self.musicButton];
|
|
[self addSubview:self.filterButton];
|
|
[self addSubview:self.filterButton];
|
|
@@ -99,26 +96,17 @@
|
|
self.bottomView.backgroundColor = [AlivcUIConfig shared].kAVCBackgroundColor;
|
|
self.bottomView.backgroundColor = [AlivcUIConfig shared].kAVCBackgroundColor;
|
|
[self addSubview:self.bottomView];
|
|
[self addSubview:self.bottomView];
|
|
|
|
|
|
-
|
|
|
|
- self.deleteButton = [[UIButton alloc] initWithFrame:CGRectMake(ScreenWidth/2-40, ScreenHeight-42 - SafeBottom, 70, 40)];
|
|
|
|
- self.deleteButton.hidden = YES;
|
|
|
|
- self.deleteButton.titleLabel.font = [UIFont systemFontOfSize:14];
|
|
|
|
- [self.deleteButton setTitle:@" 回删" forState:UIControlStateNormal];
|
|
|
|
- [self.deleteButton setImage:_uiConfig.deleteImage forState:UIControlStateNormal];
|
|
|
|
- [self.deleteButton addTarget:self action:@selector(deletePartClicked) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
- [self addSubview:self.deleteButton];
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- self.circleBtn = [[MagicCameraPressCircleView alloc] initWithFrame:CGRectMake(ScreenWidth/2-40, ScreenHeight - 120 - SafeBottom, 75, 75)];
|
|
|
|
|
|
+ self.circleBtn = [[MagicCameraPressCircleView alloc] initWithFrame:CGRectMake(ScreenWidth/2-40, ScreenHeight -68 - 80 - SafeBottom, 80, 80)];
|
|
[self addSubview:self.circleBtn];
|
|
[self addSubview:self.circleBtn];
|
|
[self.circleBtn addTarget:self action:@selector(recordButtonTouchUp) forControlEvents:UIControlEventTouchUpInside];
|
|
[self.circleBtn addTarget:self action:@selector(recordButtonTouchUp) forControlEvents:UIControlEventTouchUpInside];
|
|
[self.circleBtn addTarget:self action:@selector(recordButtonTouchDown) forControlEvents:UIControlEventTouchDown];
|
|
[self.circleBtn addTarget:self action:@selector(recordButtonTouchDown) forControlEvents:UIControlEventTouchDown];
|
|
|
|
|
|
- CGFloat rateViewH = 35;
|
|
|
|
- CGFloat rateViewY = CGRectGetMinY(self.circleBtn.frame) - rateViewH - 12;
|
|
|
|
|
|
+ CGFloat rateViewH = 40;
|
|
|
|
+ CGFloat rateViewY = ScreenHeight-SafeBottom-177-rateViewH;
|
|
self.rateView = [[AliyunRateSelectView alloc] initWithItems:@[@"极慢",@"慢",@"标准",@"快",@"极快"]];
|
|
self.rateView = [[AliyunRateSelectView alloc] initWithItems:@[@"极慢",@"慢",@"标准",@"快",@"极快"]];
|
|
- self.rateView.frame = CGRectMake(40,rateViewY, ScreenWidth-80, rateViewH);
|
|
|
|
|
|
+ self.rateView.frame = CGRectMake(14,rateViewY, ScreenWidth-28, rateViewH);
|
|
|
|
+ self.rateView.layer.cornerRadius = 20;
|
|
|
|
+ self.rateView.layer.masksToBounds = YES;
|
|
self.rateView.selectedSegmentIndex = 2;
|
|
self.rateView.selectedSegmentIndex = 2;
|
|
[self.rateView addTarget:self action:@selector(rateChanged:) forControlEvents:UIControlEventValueChanged];
|
|
[self.rateView addTarget:self action:@selector(rateChanged:) forControlEvents:UIControlEventValueChanged];
|
|
[self addSubview:self.rateView];
|
|
[self addSubview:self.rateView];
|
|
@@ -126,10 +114,10 @@
|
|
|
|
|
|
self.timeLabel = [[UILabel alloc] init];
|
|
self.timeLabel = [[UILabel alloc] init];
|
|
self.timeLabel.textAlignment = NSTextAlignmentCenter;
|
|
self.timeLabel.textAlignment = NSTextAlignmentCenter;
|
|
- self.timeLabel.frame = CGRectMake(0, 0, 60, 16);
|
|
|
|
|
|
+ self.timeLabel.frame = CGRectMake(0, 0, 60, 20);
|
|
self.timeLabel.backgroundColor = [UIColor clearColor];
|
|
self.timeLabel.backgroundColor = [UIColor clearColor];
|
|
self.timeLabel.textColor = [UIColor whiteColor];
|
|
self.timeLabel.textColor = [UIColor whiteColor];
|
|
- self.timeLabel.center = CGPointMake(ScreenWidth / 2+10, ScreenHeight - 152-SafeBottom);
|
|
|
|
|
|
+ self.timeLabel.center = CGPointMake(ScreenWidth / 2+10, ScreenHeight-SafeBottom-177-20);
|
|
[self addSubview:self.timeLabel];
|
|
[self addSubview:self.timeLabel];
|
|
|
|
|
|
self.timeDotView = [[UIView alloc] initWithFrame:CGRectMake(-10, -10, 8, 8)];
|
|
self.timeDotView = [[UIView alloc] initWithFrame:CGRectMake(-10, -10, 8, 8)];
|
|
@@ -141,6 +129,8 @@
|
|
[self addSubview:self.timeDotView];
|
|
[self addSubview:self.timeDotView];
|
|
|
|
|
|
[self addSubview:self.progressView];
|
|
[self addSubview:self.progressView];
|
|
|
|
+ [self addSubview:self.deleteButton];
|
|
|
|
+ [self addSubview:self.finishButton];
|
|
|
|
|
|
[self setExclusiveTouchInButtons];
|
|
[self setExclusiveTouchInButtons];
|
|
}
|
|
}
|
|
@@ -168,7 +158,7 @@
|
|
}else{
|
|
}else{
|
|
_recording = YES;
|
|
_recording = YES;
|
|
_progressView.videoCount++;
|
|
_progressView.videoCount++;
|
|
- self.circleBtn.transform = CGAffineTransformScale(self.transform, 1.32, 1.32);
|
|
|
|
|
|
+ self.circleBtn.transform = CGAffineTransformScale(self.transform, 1.25, 1.25);
|
|
[self.circleBtn setImage:_uiConfig.videoShootImageShooting forState:UIControlStateNormal];
|
|
[self.circleBtn setImage:_uiConfig.videoShootImageShooting forState:UIControlStateNormal];
|
|
self.timeDotView.hidden = NO;
|
|
self.timeDotView.hidden = NO;
|
|
[_delegate recordButtonRecordVideo];
|
|
[_delegate recordButtonRecordVideo];
|
|
@@ -217,6 +207,7 @@
|
|
}
|
|
}
|
|
if (self.progressView.videoCount > 0 ) {
|
|
if (self.progressView.videoCount > 0 ) {
|
|
self.deleteButton.hidden = NO;
|
|
self.deleteButton.hidden = NO;
|
|
|
|
+ self.finishButton.hidden = NO;
|
|
}
|
|
}
|
|
self.timeDotView.hidden = YES;
|
|
self.timeDotView.hidden = YES;
|
|
}
|
|
}
|
|
@@ -235,6 +226,7 @@
|
|
if(percent == 0){
|
|
if(percent == 0){
|
|
[self.progressView reset];
|
|
[self.progressView reset];
|
|
self.deleteButton.hidden = YES;
|
|
self.deleteButton.hidden = YES;
|
|
|
|
+ self.finishButton.hidden = YES;
|
|
self.timeLabel.text = @"";
|
|
self.timeLabel.text = @"";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -249,12 +241,12 @@
|
|
|
|
|
|
- (void)setHide:(BOOL)hide {
|
|
- (void)setHide:(BOOL)hide {
|
|
self.deleteButton.hidden = hide;
|
|
self.deleteButton.hidden = hide;
|
|
|
|
+ self.finishButton.hidden = hide;
|
|
self.rateView.hidden = hide;
|
|
self.rateView.hidden = hide;
|
|
|
|
|
|
self.reverseButton.hidden = hide;
|
|
self.reverseButton.hidden = hide;
|
|
self.musicButton.hidden = hide;
|
|
self.musicButton.hidden = hide;
|
|
self.filterButton.hidden = hide;
|
|
self.filterButton.hidden = hide;
|
|
- self.selBackView.hidden = hide;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- (void)setBottomHide:(BOOL)hide{
|
|
- (void)setBottomHide:(BOOL)hide{
|
|
@@ -263,8 +255,10 @@
|
|
self.circleBtn.hidden = hide;
|
|
self.circleBtn.hidden = hide;
|
|
if(self.progressView.videoCount){
|
|
if(self.progressView.videoCount){
|
|
self.deleteButton.hidden = NO;
|
|
self.deleteButton.hidden = NO;
|
|
|
|
+ self.finishButton.hidden = NO;
|
|
}else{
|
|
}else{
|
|
self.deleteButton.hidden = YES;
|
|
self.deleteButton.hidden = YES;
|
|
|
|
+ self.finishButton.hidden = YES;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -272,8 +266,10 @@
|
|
- (void)setRealVideoCount:(NSInteger)realVideoCount{
|
|
- (void)setRealVideoCount:(NSInteger)realVideoCount{
|
|
if (realVideoCount) {
|
|
if (realVideoCount) {
|
|
self.deleteButton.hidden = NO;
|
|
self.deleteButton.hidden = NO;
|
|
|
|
+ self.finishButton.hidden = NO;
|
|
}else{
|
|
}else{
|
|
self.deleteButton.hidden = YES;
|
|
self.deleteButton.hidden = YES;
|
|
|
|
+ self.finishButton.hidden = YES;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-(void)setMaxDuration:(CGFloat)maxDuration{
|
|
-(void)setMaxDuration:(CGFloat)maxDuration{
|
|
@@ -292,9 +288,13 @@
|
|
_progressView = [[QUProgressView alloc] initWithFrame:CGRectMake(14, SafeTop + 20, CGRectGetWidth(self.bounds) - 28, 5)];
|
|
_progressView = [[QUProgressView alloc] initWithFrame:CGRectMake(14, SafeTop + 20, CGRectGetWidth(self.bounds) - 28, 5)];
|
|
_progressView.showBlink = NO;
|
|
_progressView.showBlink = NO;
|
|
_progressView.showNoticePoint = YES;
|
|
_progressView.showNoticePoint = YES;
|
|
- _progressView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.01];
|
|
|
|
- _progressView.layer.cornerRadius = 3;
|
|
|
|
|
|
+ _progressView.backgroundColor = rgba(0, 0, 0, 0.3);
|
|
|
|
+ _progressView.layer.cornerRadius = 2;
|
|
_progressView.layer.masksToBounds = YES;
|
|
_progressView.layer.masksToBounds = YES;
|
|
|
|
+
|
|
|
|
+ _progressView.colorProgress = [UIColor colorWithHexString:@"#FFFFFF"];
|
|
|
|
+ _progressView.colorNotice = [UIColor redColor];
|
|
|
|
+ _progressView.colorSepatorPoint = [UIColor colorWithHexString:@"#62CC74"];
|
|
}
|
|
}
|
|
return _progressView;
|
|
return _progressView;
|
|
}
|
|
}
|
|
@@ -381,25 +381,52 @@
|
|
return _filterButton;
|
|
return _filterButton;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+- (UIButton *)deleteButton{
|
|
|
|
+ if (!_deleteButton) {
|
|
|
|
+ _deleteButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
|
+ _deleteButton.backgroundColor = [UIColor clearColor];
|
|
|
|
+ _deleteButton.frame = CGRectMake(ScreenWidth/2+40+34, ScreenHeight-SafeBottom-83-45, 30, 45);
|
|
|
|
+ _deleteButton.hidden = YES;
|
|
|
|
+ _deleteButton.titleLabel.font = [UIFont systemFontOfSize:12];
|
|
|
|
+ [_deleteButton setTitle:@"回删" forState:UIControlStateNormal];
|
|
|
|
+ [_deleteButton setImage:_uiConfig.deleteImage forState:UIControlStateNormal];
|
|
|
|
+ [_deleteButton addTarget:self action:@selector(deletePartClicked) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
+
|
|
|
|
+ CGFloat titleHeight = _deleteButton.titleLabel.intrinsicContentSize.height;
|
|
|
|
+ CGFloat imageWidth = _deleteButton.imageView.frame.size.width;
|
|
|
|
+ CGFloat imageHeight = _deleteButton.imageView.frame.size.height;
|
|
|
|
+ _deleteButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, titleHeight + 4, 0);
|
|
|
|
+ _deleteButton.titleEdgeInsets = UIEdgeInsetsMake(imageHeight + 4, -imageWidth, 0, 0);
|
|
|
|
+
|
|
|
|
+ _deleteButton.layer.shadowColor = [UIColor grayColor].CGColor;
|
|
|
|
+ _deleteButton.layer.shadowOpacity = 0.5;
|
|
|
|
+ _deleteButton.layer.shadowOffset = CGSizeMake(1, 1);
|
|
|
|
+ }
|
|
|
|
+ return _deleteButton;
|
|
|
|
+}
|
|
|
|
|
|
- (UIButton *)finishButton
|
|
- (UIButton *)finishButton
|
|
{
|
|
{
|
|
if (!_finishButton) {
|
|
if (!_finishButton) {
|
|
_finishButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
_finishButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
_finishButton.backgroundColor = [UIColor clearColor];
|
|
_finishButton.backgroundColor = [UIColor clearColor];
|
|
-
|
|
|
|
- _finishButton.frame = CGRectMake(finishBtnX, 16, 58, 27);
|
|
|
|
- _finishButton.hidden = NO;
|
|
|
|
- [_finishButton setTitle:@"下一步" forState:UIControlStateNormal];
|
|
|
|
- _finishButton.titleLabel.font = [UIFont systemFontOfSize:13];
|
|
|
|
|
|
+ _finishButton.frame = CGRectMake(ScreenWidth/2+40+34+30+31, ScreenHeight-SafeBottom-83-45, 30, 45);
|
|
|
|
+ _finishButton.hidden = YES;
|
|
|
|
+ _finishButton.titleLabel.font = [UIFont systemFontOfSize:12];
|
|
|
|
+ [_finishButton setTitle:@"确定" forState:UIControlStateNormal];
|
|
[_finishButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
|
[_finishButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
|
- _finishButton.enabled = NO;
|
|
|
|
- UIColor *bgColor_disable = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.34];
|
|
|
|
- [_finishButton setBackgroundColor:bgColor_disable];
|
|
|
|
|
|
+ [_finishButton setImage:[UIImage imageNamed:@"video_btn_submit"] forState:UIControlStateNormal];
|
|
[_finishButton addTarget:self action:@selector(finishButtonClicked) forControlEvents:UIControlEventTouchUpInside];
|
|
[_finishButton addTarget:self action:@selector(finishButtonClicked) forControlEvents:UIControlEventTouchUpInside];
|
|
- _finishButton.layer.cornerRadius = 2;
|
|
|
|
|
|
|
|
|
|
+ CGFloat titleHeight = _finishButton.titleLabel.intrinsicContentSize.height;
|
|
|
|
+ CGFloat imageWidth = _finishButton.imageView.frame.size.width;
|
|
|
|
+ CGFloat imageHeight = _finishButton.imageView.frame.size.height;
|
|
|
|
+ _finishButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, titleHeight + 4, 0);
|
|
|
|
+ _finishButton.titleEdgeInsets = UIEdgeInsetsMake(imageHeight + 4, -imageWidth, 0, 0);
|
|
|
|
+
|
|
|
|
+ _finishButton.layer.shadowColor = [UIColor grayColor].CGColor;
|
|
|
|
+ _finishButton.layer.shadowOpacity = 0.5;
|
|
|
|
+ _finishButton.layer.shadowOffset = CGSizeMake(1, 1);
|
|
}
|
|
}
|
|
return _finishButton;
|
|
return _finishButton;
|
|
}
|
|
}
|
|
@@ -534,17 +561,6 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-- (void)enableFinishButton:(BOOL)enable {
|
|
|
|
- self.finishButton.enabled = enable;
|
|
|
|
- if (enable) {
|
|
|
|
- UIColor *bgColor_enable = [UIColor colorWithRed:252/255.0 green:68/255.0 blue:72/255.0 alpha:1/1.0];
|
|
|
|
- self.finishButton.backgroundColor = bgColor_enable;
|
|
|
|
- } else {
|
|
|
|
- UIColor *bgColor_disable = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.34];
|
|
|
|
- self.finishButton.backgroundColor = bgColor_disable;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
- (UIImageView *)coverImageView {
|
|
- (UIImageView *)coverImageView {
|
|
if (!_coverImageView) {
|
|
if (!_coverImageView) {
|
|
CGFloat imageWH = 32;
|
|
CGFloat imageWH = 32;
|