3 Commity 59bf676b83 ... dae0d7d7e2

Autor SHA1 Wiadomość Data
  jsonwang dae0d7d7e2 Merge branch 'dev' of https://git.yishihui.com/iOS/BFRecordScreenKit into dev 3 lat temu
  jsonwang ad4a020198 1,修改色值 2, 修改返回参数 3 lat temu
  jsonwang daa09432ae 1,音乐裁剪界面关闭后显示功能键 2,修改音频下载失败文案,3,音乐裁剪界面添加动画 3 lat temu

+ 18 - 7
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

@@ -423,9 +423,19 @@ public class BFRecordScreenController: BFBaseViewController {
     lazy var musicCutView: BFMusicCutView = {
         let musicCutView = BFMusicCutView(frame: CGRect(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
         musicCutView.isHidden = true
-        musicCutView.cutTimeHandle = {[weak self] startTime  ,endTime ,musicInfo in
+        musicCutView.cutTimeHandle = {[weak self] iscancel  ,endTime ,musicInfo in
             guard let wself = self else { return }
-            wself.hadChoosed(music:musicInfo)
+            
+            if(!iscancel){
+                wself.hadChoosed(music:musicInfo)
+            }
+        
+            //add by ak
+            wself.soundSettingBtn.isHidden = false
+            wself.cameraFlipBtn.isHidden = false
+            wself.voiceSettingBtn.isHidden = false
+            wself.subtitleBtn.isHidden = false
+            wself.addMusicBtn.isHidden = false
         }
         return musicCutView
     }()
@@ -1460,10 +1470,11 @@ public class BFRecordScreenController: BFBaseViewController {
             guard let wself = self else { return }
             wself.musicCutView.isHidden = false
             wself.musicCutView.bgmData = model
-//            UIView.animate(withDuration: 0.2) {
-//                // 显示裁剪视图
-//                v.frame = CGRect(x: 0, y: cScreenHeigth - 220, width: cScreenWidth, height: 100)
-//            }
+            wself.musicCutView.frame = CGRect(x: 0, y: cScreenHeigth + 220, width: cScreenWidth, height: cScreenHeigth)
+            UIView.animate(withDuration: 0.1) {
+                // 显示裁剪视图
+                wself.musicCutView.frame = CGRect(x: 0, y:0, width: cScreenWidth, height: cScreenHeigth)
+            }
         }
     }
 
@@ -2670,7 +2681,7 @@ public class BFRecordScreenController: BFBaseViewController {
                     model.wavFilePath = musicUrl
                     wself.loadingView.removeLoading()
                 }else{
-                    cShowHUB(superView: wself.view, msg: "音乐下载失败")
+                    cShowHUB(superView: wself.view, msg: "音乐下载失败,请重新尝试")
                     wself.bgmModel = nil
 //                    wself.addMusicBtn.setTitle("选择音乐", for: .normal)
                     wself.addMusicBtn.config()

+ 7 - 4
BFRecordScreenKit/Classes/RecordScreen/View/BFMusicCutView.swift

@@ -20,7 +20,7 @@ public enum MusiceCutActionType: Int {
 class BFMusicCutView: UIView, UIGestureRecognizerDelegate {
     var waveLayers: [CAShapeLayer] = Array<CAShapeLayer>.init()
     // 裁剪时间回调
-    var cutTimeHandle: ((_ startTime: Float64, _ endTime: Float64, _ bgmData: PQVoiceModel?) -> Void)?
+    var cutTimeHandle: ((_ isCancel: Bool, _ endTime: Float64, _ bgmData: PQVoiceModel?) -> Void)?
 
     let normalMargin: CGFloat = cDefaultMargin * 2
 
@@ -306,7 +306,7 @@ class BFMusicCutView: UIView, UIGestureRecognizerDelegate {
                 if index < Int(startTotal) {
                     (progressImage.layer.sublayers?[index] as? CAShapeLayer)?.strokeColor = UIColor.hexColor(hexadecimal: "#202020").cgColor
                 } else {
-                    (progressImage.layer.sublayers?[index] as? CAShapeLayer)?.strokeColor = UIColor.white.cgColor
+                    (progressImage.layer.sublayers?[index] as? CAShapeLayer)?.strokeColor = UIColor.hexColor(hexadecimal: "#505050").cgColor
                 }
                 (progressImage.layer.sublayers?[totalCount - index - 1] as? CAShapeLayer)?.setNeedsDisplay()
             }
@@ -334,7 +334,7 @@ class BFMusicCutView: UIView, UIGestureRecognizerDelegate {
                     if tempIndex >= totalCount - 1 {
                         tempIndex = totalCount - 1
                     }
-                    (progressImage.layer.sublayers?[tempIndex] as? CAShapeLayer)?.strokeColor = UIColor.hexColor(hexadecimal: "#389AFF").cgColor
+                    (progressImage.layer.sublayers?[tempIndex] as? CAShapeLayer)?.strokeColor = UIColor.hexColor(hexadecimal: "#1B5692").cgColor
                     (progressImage.layer.sublayers?[tempIndex] as? CAShapeLayer)?.setNeedsDisplay()
                 }
             }
@@ -352,6 +352,9 @@ class BFMusicCutView: UIView, UIGestureRecognizerDelegate {
 
     @objc func cancelAction() {
         hidden()
+        if cutTimeHandle != nil, bgmData != nil {
+            cutTimeHandle!(true, 0, bgmData)
+        }
     }
 
     @objc func okBtnAction() {
@@ -362,7 +365,7 @@ class BFMusicCutView: UIView, UIGestureRecognizerDelegate {
         BFLog(message: "最后设置的开始时间是\(bgmData?.startCMTime.seconds ?? 0.0)")
 
         if cutTimeHandle != nil, bgmData != nil {
-            cutTimeHandle!(0, 0, bgmData)
+            cutTimeHandle!(false, 0, bgmData)
         }
     }
 }