Browse Source

fix:3.6.6(3) 修改一批 bug

100Years 2 months ago
parent
commit
851b659e23
23 changed files with 126 additions and 50 deletions
  1. 2 2
      TSLiveWallpaper.xcodeproj/project.pbxproj
  2. 22 0
      TSLiveWallpaper/Assets.xcassets/AIList/video_pause.imageset/Contents.json
  3. BIN
      TSLiveWallpaper/Assets.xcassets/AIList/video_pause.imageset/video_pause@2x.png
  4. BIN
      TSLiveWallpaper/Assets.xcassets/AIList/video_pause.imageset/video_pause@3x.png
  5. 4 4
      TSLiveWallpaper/Business/General/TSAppUpdateAlertVC/TSAppUpdateAlertVC.swift
  6. 1 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIAgeImageHintVC/TSAIListHintBaseVC.swift
  7. 3 2
      TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/TSAIListHistoryVC.swift
  8. 10 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/View/TSAIListHistoryCell.swift
  9. 8 8
      TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/View/TSGennerateCellView.swift
  10. 29 18
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVideoPlayerVC/TSAIListVideoPlayerVC.swift
  11. 1 2
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserCell.swift
  12. 4 2
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserVC.swift
  13. 1 2
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC+Video.swift
  14. 24 5
      TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIUploadPhotoVC+View.swift
  15. 2 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIUploadPhotoVC.swift
  16. 5 2
      TSLiveWallpaper/Business/TSTabBarController/TSTabBarController.swift
  17. 4 0
      TSLiveWallpaper/Common/ViewTool/TSPhotoPickerManager/TSPhotoPickerManager.swift
  18. 1 0
      TSLiveWallpaper/ar.lproj/Localizable.strings
  19. 1 0
      TSLiveWallpaper/en.lproj/Localizable.strings
  20. 1 0
      TSLiveWallpaper/es.lproj/Localizable.strings
  21. 1 0
      TSLiveWallpaper/ja.lproj/Localizable.strings
  22. 1 0
      TSLiveWallpaper/ko.lproj/Localizable.strings
  23. 1 0
      TSLiveWallpaper/zh-Hant.lproj/Localizable.strings

+ 2 - 2
TSLiveWallpaper.xcodeproj/project.pbxproj

@@ -1434,7 +1434,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_APP_SANDBOX = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -1474,7 +1474,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_APP_SANDBOX = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;

+ 22 - 0
TSLiveWallpaper/Assets.xcassets/AIList/video_pause.imageset/Contents.json

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

BIN
TSLiveWallpaper/Assets.xcassets/AIList/video_pause.imageset/video_pause@2x.png


BIN
TSLiveWallpaper/Assets.xcassets/AIList/video_pause.imageset/video_pause@3x.png


+ 4 - 4
TSLiveWallpaper/Business/General/TSAppUpdateAlertVC/TSAppUpdateAlertVC.swift

@@ -73,13 +73,13 @@ extension TSAppUpdateAlertVC {
             make.trailing.equalTo(-12)
             make.width.height.equalTo(96)
         }
-        
-        let infoLab = UILabel.createLabel(text: "🎨 Fresh styles, more vibrant than ever\n✨ Trendy effects for more magic\n⚡ Even faster speed".localized,font: .font(size: 14),textColor: .white)
+        let text:String = "🎨 Fresh styles, more vibrant than ever".localized + "\n" + "✨ Trendy effects for more magic".localized + "\n" + "⚡ Even faster speed".localized
+        let infoLab = UILabel.createLabel(text: text,font: .font(size: 14),textColor: .white)
         alertContent.addSubview(infoLab)
         infoLab.snp.makeConstraints { make in
             make.top.equalTo(titleLab.snp.bottom).offset(40)
-            make.leading.equalTo(leading)
-            make.trailing.equalTo(-leading)
+            make.left.equalTo(leading)
+            make.right.equalTo(-leading)
         }
         
         infoLab.setLineSpacing(10.0)

+ 1 - 1
TSLiveWallpaper/Business/TSAIListVC/TSAIAgeImageHintVC/TSAIListHintBaseVC.swift

@@ -76,7 +76,7 @@ class TSAIListHintBaseVC: TSBaseVC {
             return Config(imageMaxBitSize: kUploadImageMaxBit10Size,
                           goodImageNamed: "hint_Enlighten_good",
                           badImageNamed: "hint_Enlighten_bad",
-                          titleText: "Enlighten Tips".localized,
+                          titleText: "Adjust Light Tips".localized,
                           titleSubText: "",
                           goodText: "Suitable".localized,
                           goodInfoText: "Over-dark or over-light, overexposed, or underexposed photos".localized,

+ 3 - 2
TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/TSAIListHistoryVC.swift

@@ -203,9 +203,10 @@ extension TSAIListHistoryVC: UICollectionViewDataSource ,UICollectionViewDelegat
             let vc = TSAIPhotoDetailsBrowserVC()
             vc.currentIndex = dataModelArray.firstIndex(of: dbModel) ?? 0
             vc.dataModelArray = dataModelArray
-            vc.deleteBlock = { [weak self]  index in
+            vc.deleteBlock = { [weak self]  model in
                 guard let self = self else { return }
-                removeDelete(index: index)
+                TSRMShared.aiListDB.deleteListModel(id: model.id)
+                updateDataView()
             }
             kPresentModalVC(target: self, modelVC: vc)
             

+ 10 - 1
TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/View/TSAIListHistoryCell.swift

@@ -99,9 +99,18 @@ class TSAIListHistoryCell: TSBaseCollectionCell {
         return videoIconImageView
     }()
     
+    @objc func handleLongPress(_ gestureRecognizer: UILongPressGestureRecognizer) {
+        // 确保只在手势开始时触发一次
+        guard gestureRecognizer.state == .began else { return }
+        buttonTapped?("delete")
+    }
     
     override func creatUI() {
-
+        
+        let longPressRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPress(_:)))
+        longPressRecognizer.minimumPressDuration = 0.5 // 设置最小长按时间(秒)
+        contentView.addGestureRecognizer(longPressRecognizer)
+        
         contentView.layer.borderWidth = 3
         contentView.layer.borderColor = "#DFD7C0".uiCGColor
         

+ 8 - 8
TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/View/TSGennerateCellView.swift

@@ -41,9 +41,9 @@ class TSGennerateCellView: TSBaseView {
         contentView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clickContentView)))
         
 
-        let longPressRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPress(_:)))
-        longPressRecognizer.minimumPressDuration = 0.5 // 设置最小长按时间(秒)
-        contentView.addGestureRecognizer(longPressRecognizer)
+//        let longPressRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPress(_:)))
+//        longPressRecognizer.minimumPressDuration = 0.5 // 设置最小长按时间(秒)
+//        contentView.addGestureRecognizer(longPressRecognizer)
         
         
         contentView.addSubview(infoLabel)
@@ -77,11 +77,11 @@ class TSGennerateCellView: TSBaseView {
         }
     }
     
-    @objc func handleLongPress(_ gestureRecognizer: UILongPressGestureRecognizer) {
-        // 确保只在手势开始时触发一次
-        guard gestureRecognizer.state == .began else { return }
-        longPressHandel?()
-    }
+//    @objc func handleLongPress(_ gestureRecognizer: UILongPressGestureRecognizer) {
+//        // 确保只在手势开始时触发一次
+//        guard gestureRecognizer.state == .began else { return }
+//        longPressHandel?()
+//    }
     
     func setProgress(progress:Float) {
         refreshBtn.isHidden = true

+ 29 - 18
TSLiveWallpaper/Business/TSAIListVC/TSAIListVideoPlayerVC/TSAIListVideoPlayerVC.swift

@@ -16,7 +16,11 @@ class TSAIListVideoPlayerVC: UIViewController {
     private var player: AVPlayer?
     private var playerLayer: AVPlayerLayer?
     private var timeObserverToken: Any?
-    private var isPlaying = false
+    private var isPlaying = false{
+        didSet{
+            playPauseButton.setImage(isPlaying ? .videoPause : .videoPlay, for: .normal)
+        }
+    }
     
     private let videoURL: URL
     
@@ -30,17 +34,15 @@ class TSAIListVideoPlayerVC: UIViewController {
         return view
     }()
     
-    private lazy var playPauseButton: UIButton = {
-        let button = UIButton()
+    private lazy var playPauseButton: TSUIExpandedTouchButton = {
+        let button = TSUIExpandedTouchButton()
         button.setImage(.videoPlay, for: .normal)
         button.tintColor = .white
-//        button.addTarget(self, action: #selector(playPauseTapped), for: .touchUpInside)
-        button.isUserInteractionEnabled = false
+        button.addTarget(self, action: #selector(playPauseTapped), for: .touchUpInside)
         return button
     }()
     
-    
-    
+
     private lazy var progressSlider: TSProgressSlider = {
         let slider = TSProgressSlider()
         slider.minimumTrackTintColor = UIColor.themeColor
@@ -93,17 +95,28 @@ class TSAIListVideoPlayerVC: UIViewController {
         removePeriodicTimeObserver()
     }
     
+    @objc private func clickBgView() {
+        setControlsView(isHidden: !controlsContainerView.isHidden)
+    }
+    
+    func setControlsView(isHidden:Bool) {
+        playPauseButton.isHidden = isHidden
+        controlsContainerView.isHidden = isHidden
+    }
+    
     // MARK: - Setup
     private func setupUI() {
         view.backgroundColor = .clear
-        playerContainerView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(playPauseTapped)))
+        playerContainerView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clickBgView)))
         view.addSubview(playerContainerView)
-        playerContainerView.addSubview(playPauseButton)
+    
 
         playerContainerView.snp.makeConstraints { make in
             make.edges.equalToSuperview()
         }
-
+        
+        
+        playerContainerView.addSubview(playPauseButton)
         playPauseButton.snp.makeConstraints { make in
             make.centerX.equalToSuperview()
             make.centerY.equalToSuperview()//.offset(-50)
@@ -180,6 +193,11 @@ class TSAIListVideoPlayerVC: UIViewController {
         }
     }
     
+    func runloppPlay() {
+        self.isRunloppPlay = true
+        setControlsView(isHidden: true)
+        playPlay()
+    }
     // MARK: - Player Controls
     @objc private func playPauseTapped() {
         if isPlaying {
@@ -191,15 +209,11 @@ class TSAIListVideoPlayerVC: UIViewController {
     
     @objc func playPlay() {
         player?.play()
-        playPauseButton.isHidden = true
-        controlsContainerView.isHidden = true
         isPlaying = true
     }
     
     @objc func playPause() {
         player?.pause()
-        playPauseButton.isHidden = false
-        controlsContainerView.isHidden = false
         isPlaying = false
     }
     
@@ -216,10 +230,7 @@ class TSAIListVideoPlayerVC: UIViewController {
         currentTimeLabel.text = "00:00"
         
         if isRunloppPlay {
-            player?.play()
-        }else{
-            playPauseButton.isHidden = false
-            controlsContainerView.isHidden = false
+            playPlay()
         }
     }
     // MARK: - Progress Slider

+ 1 - 2
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserCell.swift

@@ -76,8 +76,7 @@ extension TSAIPhotoDetailsBrowserCell {
             make.width.equalTo(k_ScreenWidth)
             make.height.equalTo(k_ScreenHeight)
         }
-        self.videoPlayerVC?.isRunloppPlay = true
-        self.videoPlayerVC?.playPlay()
+        self.videoPlayerVC?.runloppPlay()
     }
     
     func removeVideoView(){

+ 4 - 2
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserVC.swift

@@ -7,7 +7,7 @@
 private let cellId = "TSAIPhotoDetailsBrowserCell"
 class TSAIPhotoDetailsBrowserVC: TSBaseVC {
     
-    var deleteBlock:((Int)->Void)?
+    var deleteBlock:((TSActionInfoModel)->Void)?
     var dataModelArray:[TSActionInfoModel] = []
 
     var currentModel:TSActionInfoModel?{
@@ -141,9 +141,11 @@ class TSAIPhotoDetailsBrowserVC: TSBaseVC {
             confirmColor: .white,
             cancelAction: { [weak self]  in
                 guard let self = self else { return }
+                if let currentModel = currentModel {
+                    self.deleteBlock?(currentModel)
+                }
                 dataModelArray.remove(at: currentIndex)
                 collectionView.deleteItems(at: [IndexPath(item: currentIndex, section: 0)])
-                self.deleteBlock?(currentIndex)
                 if dataModelArray.count <= 0 {
                     self.navBarClickLeftAction()
                 }

+ 1 - 2
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC+Video.swift

@@ -21,7 +21,6 @@ extension TSAIPhotoDetailsVC {
         self.videoPlayerVC.view.frame = self.contentView.bounds
         self.contentView.insertSubview(self.videoPlayerVC.view, at: 0)
         self.videoPlayerVC.setControlsBottom(bottem: -80-k_Height_safeAreaInsetsBottom())
-        self.videoPlayerVC.isRunloppPlay = true
-        self.videoPlayerVC.playPlay()
+        self.videoPlayerVC.runloppPlay()
     }
 }

+ 24 - 5
TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIUploadPhotoVC+View.swift

@@ -7,9 +7,16 @@
 
 extension TSAIUploadPhotoVC {
     
+    func creatUploadImageView() -> UIImageView {
+        let uploadImageView = UIImageView()
+        uploadImageView.isUserInteractionEnabled = true
+        uploadImageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action:#selector(clickBgView)))
+        return uploadImageView
+    }
+    
+    
     func creatUploadImageBgView() -> UIView {
         let bgView = UIView()
-        bgView.addGestureRecognizer(UITapGestureRecognizer(target: self, action:#selector(clickBgView)))
         let bgImageView = UIImageView.createImageView(imageName: "ailist_upload_big_bg")
         bgImageView.contentMode = .scaleToFill
         bgView.addSubview(bgImageView)
@@ -21,18 +28,30 @@ extension TSAIUploadPhotoVC {
         upLoadView.snp.makeConstraints { make in
             make.top.equalTo(244*kDesignScale)
             make.centerX.equalToSuperview()
-            make.width.lessThanOrEqualTo(k_ScreenWidth - 80)
+            make.width.lessThanOrEqualTo(k_ScreenWidth)
         }
         uploadImageView.contentMode = .scaleAspectFit
         bgView.addSubview(uploadImageView)
         uploadImageView.snp.makeConstraints { make in
-            make.top.leading.equalTo(0)
-            make.bottom.trailing.equalTo(0)
+           make.height.equalTo(k_ScreenWidth)
+           make.center.equalToSuperview()
+           make.width.equalTo(k_ScreenWidth)
         }
         
         return bgView
     }
-    
+
+    func updateUploadImageViewFrame() {
+        if let image = upLoadImage {
+            uploadImageView.snp.updateConstraints { make in
+                make.height.equalTo(kGetScaleHeight(originalSize: image.size, width: k_ScreenWidth))
+            }
+        }else{
+            uploadImageView.snp.updateConstraints { make in
+                make.height.equalTo(k_ScreenWidth)
+            }
+        }
+    }
     
     func creatUpLoadView() -> UIView {
         let bgView = UIView()

+ 2 - 1
TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIUploadPhotoVC.swift

@@ -28,7 +28,7 @@ class TSAIUploadPhotoVC: TSBaseVC {
 
     //上传区域
     lazy var upLoadView: UIView = creatUpLoadView()
-    lazy var uploadImageView: UIImageView = UIImageView()
+    lazy var uploadImageView: UIImageView = creatUploadImageView()
     lazy var uploadImageBgView: UIView = creatUploadImageBgView()
     //视频描述
     lazy var textView: TSAIUploadPhotoTextView = creatTextView()
@@ -59,6 +59,7 @@ class TSAIUploadPhotoVC: TSBaseVC {
                 uploadImageView.image = nil
                 submitBtn.isEnabled = false
             }
+            updateUploadImageViewFrame()
         }
     }
 

+ 5 - 2
TSLiveWallpaper/Business/TSTabBarController/TSTabBarController.swift

@@ -114,10 +114,13 @@ class TSTabBarController: UITabBarController {
     let updateAlertVC = TSAppUpdateAlertVC()
     @objc func refreshView() {
         if TSAppUpdateManager.isNeedUpdate,TSAppUpdateManager.isDisplayedUpdateAlert == false{
+        
             kMainAfter(1.0) {
-                kPresentModalVC(target: self, modelVC: self.updateAlertVC,transitionStyle: .crossDissolve){
+                self.updateAlertVC.modalPresentationStyle = .overFullScreen
+                self.updateAlertVC.modalTransitionStyle = .crossDissolve
+                self.present(self.updateAlertVC, animated: true,completion: {
                     TSAppUpdateManager.isDisplayedUpdateAlert = true
-                }
+                })
             }
         }
 //        showRedDotOnLastItem(show: TSAppUpdateManager.tabbarDotShow == 1)

+ 4 - 0
TSLiveWallpaper/Common/ViewTool/TSPhotoPickerManager/TSPhotoPickerManager.swift

@@ -68,6 +68,10 @@ class TSPhotoPickerManager: NSObject {
         viewController?.present(imagePicker, animated: true){
             TSToastShared.hideLoading()
         }
+        
+        kMainAfter(3.0) {
+            TSToastShared.hideLoading()
+        }
     }
     
     /// 显示权限提示

+ 1 - 0
TSLiveWallpaper/ar.lproj/Localizable.strings

@@ -138,3 +138,4 @@
 "⚡ Even faster speed" = "⚡ سرعة أكبر";
 "Update now to unlock the best experience" = "قم بالتحديث الآن لتستمتع بأفضل تجربة";
 "Update" = "تحديث";
+"Adjust Light Tips" = "نصائح لضبط الإضاءة";

+ 1 - 0
TSLiveWallpaper/en.lproj/Localizable.strings

@@ -137,3 +137,4 @@
 "⚡ Even faster speed" = "⚡ Even faster speed";
 "Update now to unlock the best experience" = "Update now to unlock the best experience";
 "Update" = "Update";
+"Adjust Light Tips" = "Adjust Light Tips";

+ 1 - 0
TSLiveWallpaper/es.lproj/Localizable.strings

@@ -138,3 +138,4 @@
 "⚡ Even faster speed" = "⚡ Velocidad aún más rápida";
 "Update now to unlock the best experience" = "Actualiza ahora para disfrutar de la mejor experiencia";
 "Update" = "Actualizar";
+"Adjust Light Tips" = "Consejos para ajustar la luz";

+ 1 - 0
TSLiveWallpaper/ja.lproj/Localizable.strings

@@ -136,3 +136,4 @@
 "Verifying receipt..." = "領収書の検証中...";
 "Failed to validate receipt" = "領収書の検証に失敗しました";
 "%d%" = "%d%%";
+"Adjust Light Tips" = "光調整のヒント";

+ 1 - 0
TSLiveWallpaper/ko.lproj/Localizable.strings

@@ -136,3 +136,4 @@
 "Verifying receipt..." = "영수증 확인 중...";
 "Failed to validate receipt" = "영수증 확인에 실패했습니다.";
 "%d%" = "%d%%";
+"Adjust Light Tips" = "조명 조절 팁";

+ 1 - 0
TSLiveWallpaper/zh-Hant.lproj/Localizable.strings

@@ -136,3 +136,4 @@
 "Verifying receipt..." = "驗證收據...";
 "Failed to validate receipt" = "無法驗證收據";
 "%d%" = "%d%%";
+"Adjust Light Tips" = "光線調整提示";