jsonwang 3 anni fa
parent
commit
468a69b5f8
16 ha cambiato i file con 44 aggiunte e 14 eliminazioni
  1. BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/soundBtn.imageset/soundBtn.png
  2. BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/soundBtn.imageset/soundBtn@2x.png
  3. BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/soundBtn.imageset/soundBtn@3x.png
  4. BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn.imageset/subtitleBtn.png
  5. BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn.imageset/subtitleBtn@2x.png
  6. BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn.imageset/subtitleBtn@3x.png
  7. 23 0
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_off.imageset/Contents.json
  8. BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_off.imageset/subtitleBtn_off.png
  9. BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_off.imageset/subtitleBtn_off@2x.png
  10. BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_off.imageset/subtitleBtn_off@3x.png
  11. 3 3
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_on.imageset/Contents.json
  12. BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_on.imageset/subtitleBtn_on.png
  13. BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_on.imageset/subtitleBtn_on@2x.png
  14. BIN
      BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_on.imageset/subtitleBtn_on@3x.png
  15. 14 9
      BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift
  16. 4 2
      BFRecordScreenKit/Classes/RecordScreen/View/BFStripSwithView.swift

BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/soundBtn.imageset/soundBtn.png


BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/soundBtn.imageset/soundBtn@2x.png


BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/soundBtn.imageset/soundBtn@3x.png


BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn.imageset/subtitleBtn.png


BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn.imageset/subtitleBtn@2x.png


BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn.imageset/subtitleBtn@3x.png


+ 23 - 0
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_off.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "subtitleBtn_off.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "subtitleBtn_off@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "subtitleBtn_off@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_off.imageset/subtitleBtn_off.png


BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_off.imageset/subtitleBtn_off@2x.png


BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_off.imageset/subtitleBtn_off@3x.png


+ 3 - 3
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn.imageset/Contents.json → BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_on.imageset/Contents.json

@@ -1,17 +1,17 @@
 {
   "images" : [
     {
-      "filename" : "subtitleBtn.png",
+      "filename" : "subtitleBtn_on.png",
       "idiom" : "universal",
       "scale" : "1x"
     },
     {
-      "filename" : "subtitleBtn@2x.png",
+      "filename" : "subtitleBtn_on@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
-      "filename" : "subtitleBtn@3x.png",
+      "filename" : "subtitleBtn_on@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_on.imageset/subtitleBtn_on.png


BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_on.imageset/subtitleBtn_on@2x.png


BIN
BFRecordScreenKit/Assets/BFRecordScreenKit.xcassets/subtitleBtn_on.imageset/subtitleBtn_on@3x.png


+ 14 - 9
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

@@ -135,7 +135,7 @@ public class BFRecordScreenController: BFBaseViewController {
         l.font = UIFont.systemFont(ofSize: 13)
         l.textColor = .white
         l.shadowColor = .black
-        l.shadowOffset = CGSize(width: 1, height: 1)
+        l.shadowOffset = CGSize(width: 0, height: 1)
         l.text = "00:00"
         return l
     }()
@@ -170,6 +170,7 @@ public class BFRecordScreenController: BFBaseViewController {
         btn.backgroundColor = ThemeStyleColor
         btn.setTitle("按住 录音", for: .normal)
         btn.addCorner(corner: 6)
+        btn.titleLabel?.font = UIFont.boldSystemFont(ofSize: 18)
         btn.adjustsImageWhenHighlighted = false
         btn.addTarget(self, action: #selector(startRecord), for: .touchDown)
         btn.addTarget(self, action: #selector(endRecord), for: .touchUpInside)
@@ -179,9 +180,11 @@ public class BFRecordScreenController: BFBaseViewController {
 
     lazy var deleteRecordBtn: UIButton = {
         let btn = UIButton(type: .custom)
-        btn.backgroundColor = .red
+       
+        btn.backgroundColor =  UIColor.hexColor(hexadecimal: "#FF0000", alpha: 1)
         btn.setTitle("删除录制", for: .normal)
         btn.adjustsImageWhenHighlighted = false
+        btn.titleLabel?.font = UIFont.boldSystemFont(ofSize: 18)
         btn.addCorner(corner: 6)
         btn.addTarget(self, action: #selector(deleteRecordAction), for: .touchUpInside)
         btn.isHidden = true
@@ -257,7 +260,7 @@ public class BFRecordScreenController: BFBaseViewController {
     // 字幕设置
     lazy var subtitleBtn: UIButton = {
         let btn = UIButton(type: .custom)
-        btn.setImage(imageInRecordScreenKit(by: "subtitleBtn"), for: .normal)
+        btn.setImage(imageInRecordScreenKit(by: "subtitleBtn_on"), for: .normal)
         btn.addTarget(self, action: #selector(subTitleClick), for: .touchUpInside)
         return btn
     }()
@@ -725,6 +728,8 @@ public class BFRecordScreenController: BFBaseViewController {
     /// 设置字幕样式和位置
     /// - Parameter settingModel: 样式model
     func setSubtitleStyle(settingModel: BFSubTitileSettingModel) {
+       
+        subtitleBtn.setImage(imageInRecordScreenKit(by:  settingModel.subtitleIsShow ? "subtitleBtn_on" : "subtitleBtn_off"), for: .normal)
         if settingModel.subtitleIsShow {
             // 设置样式
             subtitleLabel.strokeColor = settingModel.strokeColor
@@ -757,7 +762,7 @@ public class BFRecordScreenController: BFBaseViewController {
         progreddL.snp.makeConstraints { make in
             make.width.equalTo(100)
             make.centerX.equalToSuperview()
-            make.top.equalToSuperview()
+            make.top.equalToSuperview().offset(-8)
             make.height.equalTo(18)
         }
 
@@ -798,16 +803,16 @@ public class BFRecordScreenController: BFBaseViewController {
         //            make.height.equalTo(124)
         //        }
 
-        subtitleBtn.snp.makeConstraints { make in
+        soundSettingBtn.snp.makeConstraints { make in
             make.right.equalToSuperview().offset(-12)
             make.top.equalToSuperview().offset(98)
             make.width.equalTo(40)
             make.height.equalTo(62)
         }
-
-        soundSettingBtn.snp.makeConstraints { make in
-            make.right.equalTo(subtitleBtn)
-            make.top.equalTo(subtitleBtn.snp.bottom).offset(18)
+        
+        subtitleBtn.snp.makeConstraints { make in
+            make.right.equalTo(soundSettingBtn)
+            make.top.equalTo(soundSettingBtn.snp.bottom).offset(18)
             make.width.equalTo(40)
             make.height.equalTo(62)
         }

+ 4 - 2
BFRecordScreenKit/Classes/RecordScreen/View/BFStripSwithView.swift

@@ -14,7 +14,7 @@ open class BFStripSwithView: UIView {
     var currentIndex: Int = 0
     var itemSpace: CGFloat = 4
     var itemHeight: CGFloat = 6
-    var itemNormalColor: UIColor = UIColor.white
+    var itemNormalColor: UIColor = UIColor.hexColor(hexadecimal: "#FFFFFF", alpha: 0.3)
     var itemSelectedColor: UIColor = UIColor.hexColor(hexadecimal: "#389AFF")
     var strips: Int = 2
     var currentItem: UIButton?
@@ -69,6 +69,8 @@ open class BFStripSwithView: UIView {
                 itemBtn.tag = index + 1
 //                itemBtn.addTarget(self, action: #selector(changeSwitch(sender:)), for: .touchUpInside)
                 itemBtn.addCorner(corner: itemHeight / 2)
+                itemBtn.layer.borderWidth = 0.5
+                itemBtn.layer.borderColor = UIColor.hexColor(hexadecimal: "#000000", alpha: 0.3).cgColor
                 itemBtn.backgroundColor = itemNormalColor
                 if itemBtn.tag == currentIndex + 1 {
                     currentItem = itemBtn
@@ -98,7 +100,7 @@ open class BFStripSwithView: UIView {
             return
         }
         currentItem = sender
-        UIView.animate(withDuration: 0.1) { [weak self] in
+        UIView.animate(withDuration: 0.01) { [weak self] in
             self?.selectedBtn.center.x = CGFloat(sender!.center.x)
         }
     }