Просмотр исходного кода

1,加载界面,关闭和隐藏方法分开,2,点击关闭的时候 不自动播放了

jsonwang 3 лет назад
Родитель
Сommit
778845ab29

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

@@ -109,8 +109,8 @@ public class BFRecordScreenController: BFBaseViewController {
         loadingView.cancelHandle = { [weak self] in
             guard let wself = self else { return }
             BFLog(message: "loadingView 点击了取消")
-//            wself.voiceFinishAutoPlay = false
-//            wself.updatePlayBtnStatus()
+            wself.voiceFinishAutoPlay = false
+            wself.updatePlayBtnStatus()
    
         }
        
@@ -2876,12 +2876,12 @@ extension BFRecordScreenController: BFTTSManagerDelegte{
             }
             
             if(voiceChangeStickerFinish(itemIndex: currItemModelIndex)){
-                loadingView.loadHidden()
+                loadingView.removeLoading()
                 //完成后自动进行播放逻辑
                 if(voiceFinishAutoPlay){
                     voiceFinishAutoPlay = false
                     play()
-//                    .updatePlayBtnStatus()
+
                 }
             }
         }

+ 8 - 3
BFRecordScreenKit/Classes/RecordScreen/View/BFLoadingView.swift

@@ -78,15 +78,20 @@ class BFLoadingView: UIView {
         isHidden = false
         loadingImage.displayGIF(data: nil, images: gifImages, repeatCount: .max, duration: duration ?? 2)
     }
-
-    // 隐藏动画
-    @objc public func loadHidden() {
+    
+    public func removeLoading(){
         isHidden = true
         loadingImage.removePlayGIF()
         
+    }
+
+    // 隐藏动画
+    @objc public func loadHidden() {
+        removeLoading()
         if cancelHandle != nil {
             cancelHandle!()
         }
+        
      
     }