Browse Source

Merge branch 'feature/dev_Chris' into develop

Chris 5 years ago
parent
commit
e8669cb4bd

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/Controller/AliyunMagicCameraViewController.h

@@ -35,7 +35,7 @@
 @property (nonatomic, copy, nullable) void (^editBlock)(void);
 
 // 
-@property (nonatomic, copy, nullable) void (^hideSegmentBlock)(void);
+@property (nonatomic, copy) void (^hideSegmentBlock)(BOOL isHidden);
 
 @end
 

+ 18 - 17
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/Controller/AliyunMagicCameraViewController.m

@@ -560,11 +560,6 @@
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
     [self starPreview];
-    if (_recordingDuration >= _quVideo.minDuration) {
-        [self.magicCameraView enableFinishButton:YES];
-    } else {
-        [self.magicCameraView enableFinishButton:NO];
-    }
     _magicCameraView.musicButton.enabled = ![_clipManager partCount];
     NSLog(@"%zd",[_clipManager partCount]);
     [[UIApplication sharedApplication] setIdleTimerDisabled:YES];//录制模块禁止自动熄屏
@@ -613,6 +608,12 @@
     [self.magicCameraView refreshFocusPointWithPoint:point];
     
     [self hideFilterView:YES];
+    
+    if (self.clipManager.partCount == 0) {
+        if (self.hideSegmentBlock) {
+            self.hideSegmentBlock(false);
+        }
+    }
 }
 
 
@@ -684,6 +685,10 @@
     }
     
     NSLog(@"---------->点击了录制按钮");
+    if (self.hideSegmentBlock) {
+        self.hideSegmentBlock(true);
+    }
+    
     self.downTime = CFAbsoluteTimeGetCurrent();
     self.downVideoCount = [_clipManager partCount];
     if (_clipManager.partCount<=0) { 
@@ -750,6 +755,9 @@
 
 - (void)filterButtonClicked {
     [self hideFilterView:NO];
+    if (self.hideSegmentBlock) {
+        self.hideSegmentBlock(true);
+    }
 }
 
 - (void)hideFilterView:(BOOL)hidden {
@@ -784,14 +792,12 @@
     _magicCameraView.progressView.videoCount--;
     [self.magicCameraView recordingPercent:_clipManager.duration];
     _recordingDuration = _clipManager.duration;
-    [_magicCameraView enableFinishButton:[_clipManager partCount]];
     _magicCameraView.musicButton.enabled = ![_clipManager partCount];
     
-    if (_recordingDuration >= _quVideo.minDuration) {
-        [self.magicCameraView enableFinishButton:YES];
-        self.magicCameraView.finishButton.enabled = YES;
-    } else {
-        [self.magicCameraView enableFinishButton:NO];
+    if (self.clipManager.partCount == 0) {
+        if (self.hideSegmentBlock) {
+            self.hideSegmentBlock(false);
+        }
     }
 }
 
@@ -951,12 +957,7 @@
     // 注释允许多段录制
     //[_recorder finishRecording];
     self.upVideoCount = [_clipManager partCount];
-    
-    if (_recordingDuration >= _quVideo.minDuration) {
-        [self.magicCameraView enableFinishButton:YES];
-    } else {
-         [self.magicCameraView enableFinishButton:NO];
-    }
+        
     _magicCameraView.musicButton.enabled = ![_clipManager partCount];
     [_magicCameraView destroy];
     _magicCameraView.userInteractionEnabled =YES;

+ 0 - 10
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/View/AliyunMagicCameraView.h

@@ -203,14 +203,4 @@
  */
 -(void)refreshFocusPointWithPoint:(CGPoint)point;
 
-
-/**
- 禁用或启用完成按钮
-
- @param enable 是否启用
- */
-- (void)enableFinishButton:(BOOL)enable;
-
-
-
 @end

+ 61 - 45
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoRecord/View/AliyunMagicCameraView.m

@@ -13,8 +13,6 @@
 #import "AlivcMacro.h"
 #import "UIColor+AlivcHelper.h"
 
-#define finishBtnX  (CGRectGetWidth(self.bounds) - 58 - 10)
-
 @interface AliyunMagicCameraView ()
 
 /**
@@ -89,7 +87,6 @@
     [self addSubview:self.selBackView];
     
     [self addSubview:self.backButton];
-    [self.selBackView addSubview:self.finishButton];
     [self addSubview:self.reverseButton];
     [self addSubview:self.musicButton];
     [self addSubview:self.filterButton];
@@ -99,26 +96,17 @@
     self.bottomView.backgroundColor = [AlivcUIConfig shared].kAVCBackgroundColor;
     [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.circleBtn addTarget:self action:@selector(recordButtonTouchUp) forControlEvents:UIControlEventTouchUpInside];
     [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.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 addTarget:self action:@selector(rateChanged:) forControlEvents:UIControlEventValueChanged];
     [self addSubview:self.rateView];
@@ -126,10 +114,10 @@
     
     self.timeLabel = [[UILabel alloc] init];
     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.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.timeDotView = [[UIView alloc] initWithFrame:CGRectMake(-10, -10, 8, 8)];
@@ -141,6 +129,8 @@
     [self addSubview:self.timeDotView];
     
     [self addSubview:self.progressView];
+    [self addSubview:self.deleteButton];
+    [self addSubview:self.finishButton];
     
     [self setExclusiveTouchInButtons];
 }
@@ -168,7 +158,7 @@
             }else{
                 _recording = YES;
                 _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.timeDotView.hidden = NO;
                 [_delegate recordButtonRecordVideo];
@@ -217,6 +207,7 @@
     }    
     if (self.progressView.videoCount > 0 ) {
         self.deleteButton.hidden = NO;
+        self.finishButton.hidden = NO;
     }
     self.timeDotView.hidden = YES;
 }
@@ -235,6 +226,7 @@
     if(percent == 0){
         [self.progressView reset];
         self.deleteButton.hidden = YES;
+        self.finishButton.hidden = YES;
         self.timeLabel.text = @"";
     }
 }
@@ -249,12 +241,12 @@
 
 - (void)setHide:(BOOL)hide {
     self.deleteButton.hidden = hide;
+    self.finishButton.hidden = hide;
     self.rateView.hidden = hide;
     
     self.reverseButton.hidden = hide;
     self.musicButton.hidden = hide;
     self.filterButton.hidden = hide;
-    self.selBackView.hidden = hide;
 }
 
 - (void)setBottomHide:(BOOL)hide{
@@ -263,8 +255,10 @@
     self.circleBtn.hidden = hide;
     if(self.progressView.videoCount){
         self.deleteButton.hidden = NO;
+        self.finishButton.hidden = NO;
     }else{
         self.deleteButton.hidden = YES;
+        self.finishButton.hidden = YES;
     }
     
 }
@@ -272,8 +266,10 @@
 - (void)setRealVideoCount:(NSInteger)realVideoCount{
     if (realVideoCount) {
         self.deleteButton.hidden = NO;
+        self.finishButton.hidden = NO;
     }else{
         self.deleteButton.hidden = YES;
+        self.finishButton.hidden = YES;
     }
 }
 -(void)setMaxDuration:(CGFloat)maxDuration{
@@ -292,9 +288,13 @@
         _progressView = [[QUProgressView alloc] initWithFrame:CGRectMake(14, SafeTop + 20, CGRectGetWidth(self.bounds) - 28, 5)];
         _progressView.showBlink = NO;
         _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.colorProgress = [UIColor colorWithHexString:@"#FFFFFF"];
+        _progressView.colorNotice = [UIColor redColor];
+        _progressView.colorSepatorPoint = [UIColor colorWithHexString:@"#62CC74"];
     }
     return _progressView;
 }
@@ -381,25 +381,52 @@
     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
 {
     if (!_finishButton) {
         _finishButton = [UIButton buttonWithType:UIButtonTypeCustom];
         _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.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.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;
 }
@@ -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 {
     if (!_coverImageView) {
         CGFloat imageWH = 32;

+ 5 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishViewController.swift

@@ -228,8 +228,13 @@ extension PublishViewController :JXSegmentedListContainerViewDataSource {
                 let editVc = AlivcShortVideoRoute.shared().alivcViewController(with: AlivcViewControlType.edit)
                 self?.navigationController?.pushViewController(editVc, animated: true)
             }
+            videoVc.hideSegmentBlock = {
+                [weak self] (isHidden) in
+                self?.segmentedView.isHidden = isHidden
+            }
             return videoVc
             
+            
 //            let videoVc = PublishVideoRecorderController()
 //            videoVc.dismissClosure = {
 //                [weak self] in