Browse Source

Merge branch 'dev' of https://git.yishihui.com/iOS/BFRecordScreenKit into dev

* 'dev' of https://git.yishihui.com/iOS/BFRecordScreenKit:
  删除录制时 清空变音缓存
  取消时 不选中发音人
  调整 UI 大小
  修改文字
  UI 调整
  修改文字
胡志强 3 years ago
parent
commit
fa8a58da4f

+ 4 - 2
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

@@ -872,7 +872,7 @@ public class BFRecordScreenController: BFBaseViewController {
             }else if actionType == .voiceSettingActionCancel{
                 BFLog(2, message: "取消发音人操作")
                 wself.tts?.stopTTS("")
-                wself.voiceSettingView.flushSelectVoiceStatus(voiceStatue: .isSelected)
+                wself.voiceSettingView.flushSelectVoiceStatus(voiceStatue: .isNormal)
         
             }else if actionType == .voiceSettingActionDelete{
                 BFLog(2, message: "删除发音人操作")
@@ -1443,6 +1443,8 @@ public class BFRecordScreenController: BFBaseViewController {
             }
             deleteTitles(voiceModel: model)
             
+            // add by ak 删除变音的缓存数据
+            tts?.deleteTasksCache(model.recordId ?? "")
             
             indirectionView?.deleteItem(index: isStopAtRecordRange)
             
@@ -2852,7 +2854,7 @@ extension BFRecordScreenController: BFTTSManagerDelegte{
         }
         
         BFLog(message: "TTS 进度:\(Int(progress))")
-        loadingView.titleL.text = "变中 \(Int(progress))%"
+        loadingView.titleL.text = "变中 \(Int(progress))%"
  
         
     }

+ 1 - 1
BFRecordScreenKit/Classes/RecordScreen/View/BFLoadingView.swift

@@ -34,7 +34,7 @@ class BFLoadingView: UIView {
 
     lazy var titleL: UILabel = {
         let l = UILabel()
-        l.text = "变中 10%"
+        l.text = "变中 10%"
         l.textAlignment = .center
         l.textColor = UIColor.hexColor(hexadecimal: "#389AFF")
         l.font = UIFont.systemFont(ofSize: 16)

+ 21 - 5
BFRecordScreenKit/Classes/RecordScreen/View/BFVoiceSettingView.swift

@@ -49,16 +49,30 @@ class BFVoiceSettingView: UIView {
     var curretnCategory: BFVoiceCategoryModel?
     // 当前选择的发音人
     public var selectVoice: PQVoiceModel?
+    
+    
 
+    lazy var line1:UIView = {
+        let line1 = UIView.init(frame: CGRect(x: 0, y: catagaryCollectView.frame.minY - 1, width: cScreenWidth, height: 1))
+        line1.backgroundColor = UIColor.hexColor(hexadecimal: "#272727")
+        return line1
+        
+    }()
+    lazy var line2:UIView = {
+        let line2 = UIView.init(frame: CGRect(x: 0, y: catagaryCollectView.frame.maxY + 1, width: cScreenWidth, height: 1))
+        line2.backgroundColor = UIColor.hexColor(hexadecimal: "#272727")
+        return line2
+        
+    }()
     // 分类列表
     lazy var catagaryCollectView: UICollectionView = {
         let layout = UICollectionViewFlowLayout()
         layout.scrollDirection = .horizontal
         layout.itemSize = itemSize
-        layout.minimumLineSpacing = 10
+        layout.minimumLineSpacing = 30
         layout.sectionInset = UIEdgeInsets.zero
         layout.minimumInteritemSpacing = 0
-        let collectView = UICollectionView(frame: CGRect(x: 60, y: 0, width: cScreenWidth, height: 40), collectionViewLayout: layout)
+        let collectView = UICollectionView(frame: CGRect(x: 60, y: 0, width: cScreenWidth - 60, height: 40), collectionViewLayout: layout)
         collectView.isPagingEnabled = false
         collectView.showsHorizontalScrollIndicator = false
         collectView.showsVerticalScrollIndicator = false
@@ -97,12 +111,12 @@ class BFVoiceSettingView: UIView {
         layout.scrollDirection = .vertical
         layout.itemSize = CGSize(width: adapterWidth(width: 60), height: 78)
         // 每行最小边距
-        layout.minimumLineSpacing = 10
+        layout.minimumLineSpacing = 34
         // 每列最小边距
-        layout.minimumInteritemSpacing = 0
+        layout.minimumInteritemSpacing = 20
         layout.sectionInset = UIEdgeInsets.zero
 
-        let collectView = UICollectionView(frame: CGRect(x: 0, y: 98, width: cScreenWidth, height: 242 - cSafeAreaHeight), collectionViewLayout: layout)
+        let collectView = UICollectionView(frame: CGRect(x: 32, y: 100, width: cScreenWidth - 32 * 2, height: 242 - cSafeAreaHeight), collectionViewLayout: layout)
         collectView.isPagingEnabled = false
         collectView.showsHorizontalScrollIndicator = false
         collectView.showsVerticalScrollIndicator = false
@@ -187,6 +201,8 @@ class BFVoiceSettingView: UIView {
         }
 
         catagaryBackView.addSubview(catagaryCollectView)
+        catagaryBackView.addSubview(line1)
+        catagaryBackView.addSubview(line2)
 
         catagaryBackView.addSubview(deleteBtn)
         deleteBtn.snp.makeConstraints { make in

+ 22 - 1
BFRecordScreenKit/Classes/RecordScreen/View/Cell/BFVoiceCategoryCell.swift

@@ -17,10 +17,17 @@ class BFVoiceCategoryCell: UICollectionViewCell {
     lazy var nameLab: UILabel = {
         let nameLab = UILabel()
         nameLab.textColor =  UIColor.hexColor(hexadecimal: "#616161")
-        nameLab.font = UIFont.boldSystemFont(ofSize: 15)
+        nameLab.font = UIFont.systemFont(ofSize: 15)
         nameLab.textAlignment = .center
         return nameLab
     }()
+    
+    lazy var line1:UIView = {
+        let line1 = UIView.init()
+        line1.backgroundColor = UIColor.white
+        return line1
+        
+    }()
  
 
     override init(frame: CGRect) {
@@ -28,6 +35,8 @@ class BFVoiceCategoryCell: UICollectionViewCell {
         backgroundColor = UIColor.clear
  
         contentView.addSubview(nameLab)
+        
+        contentView.addSubview(line1);
  
     }
 
@@ -50,6 +59,8 @@ class BFVoiceCategoryCell: UICollectionViewCell {
     func addData() {
         nameLab.text = category?.cateName
         nameLab.textColor = (category?.isSelected ?? false) ? UIColor.white :  UIColor.hexColor(hexadecimal: "#616161")
+        line1.isHidden = (category?.isSelected ?? false) ? false:  true
+     
     }
 
     func addLayout() {
@@ -60,6 +71,16 @@ class BFVoiceCategoryCell: UICollectionViewCell {
             make.top.equalToSuperview()
 
         }
+        
+        let itemWidth = sizeWithText(text: nameLab.text ?? "", font: UIFont.systemFont(ofSize: 15), size: CGSize(width: CGFloat.greatestFiniteMagnitude, height:15)).width
+        
+        line1.snp.remakeConstraints { make in
+            make.width.equalTo(itemWidth)
+            make.centerX.equalTo(nameLab.snp.centerX)
+            make.height.equalTo(2)
+            make.top.equalTo(nameLab.snp.bottom).offset(-2)
+
+        }
  
     }
 }