Browse Source

fix:修改一批 bug

100Years 2 months ago
parent
commit
09d5fcba78

+ 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 = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				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 = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				ENABLE_APP_SANDBOX = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;

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

@@ -13,8 +13,9 @@ class TSAppUpdateAlertVC: TSBaseVC {
     }()
     
 
-    lazy var closeBtn: UIButton = {
-        let closeBtn = UIButton.createButton(image:.appUpdateClose){ [weak self]  in
+    lazy var closeBtn: TSUIExpandedTouchButton = {
+        let closeBtn = TSUIExpandedTouchButton()
+        closeBtn.setUpButton(image:.appUpdateClose){ [weak self]  in
             guard let self = self else { return }
             self.dismiss(animated: true)
         }
@@ -24,7 +25,7 @@ class TSAppUpdateAlertVC: TSBaseVC {
     override func createView() {
         setNavBarViewHidden(true)
         
-        view.backgroundColor = .black.withAlphaComponent(0.6)
+        view.backgroundColor = .black.withAlphaComponent(0.8)
         contentView.addSubview(alertContent)
         alertContent.snp.makeConstraints { make in
             make.leading.equalTo(32)

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

@@ -94,7 +94,7 @@ class TSAIListHistoryCell: TSBaseCollectionCell {
     }()
     
     lazy var videoIconImageView: UIImageView = {
-        let videoIconImageView = UIImageView.createImageView(image:.videoIcon,contentMode: .scaleToFill)
+        let videoIconImageView = UIImageView.createImageView(image:.videoIcon,contentMode: .scaleToFill,autoMirrored:false)
         videoIconImageView.isHidden = true
         return videoIconImageView
     }()

+ 1 - 1
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/TSAIListVM.swift

@@ -108,7 +108,7 @@ class TSAIListVM {
         sectionModel.addSubItemModel(
             createItemModel(
                 leftImageName:"aiList_Enlighten",
-                leftTitle: "Enlighten".localized,
+                leftTitle: "Adjust Light".localized,
                 leftSubTitle: "Easily fix lighting issues on photos".localized,
                 rightViewStyle: 0,
                 tapBlock: { [weak self] model, _, _ in

+ 20 - 10
TSLiveWallpaper/Business/TSAIListVC/TSAIListVideoPlayerVC/TSAIListVideoPlayerVC.swift

@@ -20,6 +20,9 @@ class TSAIListVideoPlayerVC: UIViewController {
     
     private let videoURL: URL
     
+    
+    public var isRunloppPlay:Bool = false
+    
     // MARK: - UI Components
     private lazy var playerContainerView: UIView = {
         let view = UIView()
@@ -36,6 +39,8 @@ class TSAIListVideoPlayerVC: UIViewController {
         return button
     }()
     
+    
+    
     private lazy var progressSlider: TSProgressSlider = {
         let slider = TSProgressSlider()
         slider.minimumTrackTintColor = UIColor.themeColor
@@ -90,7 +95,7 @@ class TSAIListVideoPlayerVC: UIViewController {
     
     // MARK: - Setup
     private func setupUI() {
-        view.backgroundColor = "#111111".uiColor
+        view.backgroundColor = .clear
         playerContainerView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(playPauseTapped)))
         view.addSubview(playerContainerView)
         playerContainerView.addSubview(playPauseButton)
@@ -116,8 +121,8 @@ class TSAIListVideoPlayerVC: UIViewController {
         controlsContainerView.addSubview(durationLabel)
         
         progressSlider.snp.makeConstraints { make in
-            make.leading.equalTo(16)
-            make.trailing.equalTo(-16)
+            make.left.equalTo(16)
+            make.right.equalTo(-16)
             make.top.equalTo(0)
             make.height.equalTo(10)
         }
@@ -134,13 +139,13 @@ class TSAIListVideoPlayerVC: UIViewController {
         currentTimeLabel.snp.makeConstraints { make in
             make.height.equalTo(13)
             make.centerY.equalTo(label)
-            make.trailing.equalTo(label.snp.leading)
+            make.right.equalTo(label.snp.left)
         }
         
         durationLabel.snp.makeConstraints { make in
             make.height.equalTo(13)
             make.centerY.equalTo(label)
-            make.leading.equalTo(label.snp.trailing)
+            make.left.equalTo(label.snp.right)
         }
     }
 
@@ -184,17 +189,17 @@ class TSAIListVideoPlayerVC: UIViewController {
         }
     }
     
-    @objc private func playPlay() {
+    @objc func playPlay() {
         player?.play()
         playPauseButton.isHidden = true
-//        playPauseButton.setImage(UIImage(named: "pause"), for: .normal)
+        controlsContainerView.isHidden = true
         isPlaying = true
     }
     
     @objc func playPause() {
         player?.pause()
         playPauseButton.isHidden = false
-//        playPauseButton.setImage(UIImage(named: "play"), for: .normal)
+        controlsContainerView.isHidden = false
         isPlaying = false
     }
     
@@ -206,11 +211,16 @@ class TSAIListVideoPlayerVC: UIViewController {
     
     func playerDidFinish() {
         player?.seek(to: CMTime.zero)
-        playPauseButton.isHidden = false
-//        playPauseButton.setImage(UIImage(named: "play"), for: .normal)
         isPlaying = false
         progressSlider.value = 0
         currentTimeLabel.text = "00:00"
+        
+        if isRunloppPlay {
+            player?.play()
+        }else{
+            playPauseButton.isHidden = false
+            controlsContainerView.isHidden = false
+        }
     }
     // MARK: - Progress Slider
     @objc private func sliderValueChanged(_ sender: UISlider) {

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

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

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

@@ -21,5 +21,7 @@ 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()
     }
 }

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

@@ -111,11 +111,13 @@ class TSTabBarController: UITabBarController {
         refreshView()
         NotificationCenter.default.addObserver(self, selector: #selector(refreshView), name: .kAppUpdateNotification, object: nil)
     }
-    
+    let updateAlertVC = TSAppUpdateAlertVC()
     @objc func refreshView() {
         if TSAppUpdateManager.isNeedUpdate,TSAppUpdateManager.isDisplayedUpdateAlert == false{
-            kPresentModalVC(target: self, modelVC: TSAppUpdateAlertVC(),transitionStyle: .crossDissolve){
-                TSAppUpdateManager.isDisplayedUpdateAlert = true
+            kMainAfter(1.0) {
+                kPresentModalVC(target: self, modelVC: self.updateAlertVC,transitionStyle: .crossDissolve){
+                    TSAppUpdateManager.isDisplayedUpdateAlert = true
+                }
             }
         }
 //        showRedDotOnLastItem(show: TSAppUpdateManager.tabbarDotShow == 1)

+ 11 - 4
TSLiveWallpaper/Common/Purchase/TSPurchaseManager.swift

@@ -51,16 +51,23 @@ public class PurchaseManager: NSObject {
         return convertExpireDate(from: time)
     }
 
+    lazy var dateformat: DateFormatter = {
+        let format = DateFormatter()
+        format.locale = .current
+        format.dateStyle = .medium
+//        format.dateFormat = "yyyy-MM-dd"
+        return format
+    }()
     public var expiredDateString: String {
         if vipType == .lifetime{
             return "Lifetime"
         } else {
             if let expDate = expiredDate {
-                let format = DateFormatter()
-                format.locale = .current
-                format.dateFormat = "yyyy-MM-dd"
-                return format.string(from: expDate)
+                return dateformat.string(from: expDate)
             } else {
+#if DEBUG
+                return dateformat.string(from: Date())
+#endif
                 return "--"
             }
         }

+ 16 - 20
TSLiveWallpaper/Data/TSDBManager/TSDBManager.swift

@@ -65,15 +65,7 @@ class TSDBHistory: Object {
     func deleteAll() {
 
         for index in listModels.indices {
-            if let model = listModels[safe: index] {
-                if let response =  model.response {
-                    TSImageStoreTool.removeImage(urlString:response.resultUrl)
-                }
-                
-                if let request =  model.request {
-                    TSImageStoreTool.removeImage(urlString:request.imageUrl)
-                }
-            }
+            deleteResources(index: index)
         }
 
         TSRMShared.writeThread {
@@ -89,24 +81,28 @@ class TSDBHistory: Object {
     
     func deleteListModel(index:Int) {
         TSRMShared.writeThread {
-            
-            if let model = listModels[safe: index] {
-                if let response =  model.response {
-                    TSImageStoreTool.removeImage(urlString:response.resultUrl)
-                    TSImageStoreTool.removeImage(urlString:response.previewUrl)
+            deleteResources(index:index)
+            listModels.remove(at: index)
+            debugPrint("listModels.remove(at: \(index))")
+        }
+    }
+
+    func deleteResources(index:Int) {
+        if let model = listModels[safe: index] {
+            if let response =  model.response {
+                TSImageStoreTool.removeImage(urlString:response.resultUrl)
+                TSImageStoreTool.removeImage(urlString:response.previewUrl)
+                if !response.videoDocument.isEmpty {
                     TSFileManagerTool.removeItem(from: response.videoDocument.fillDocumentURL)
                 }
                 
-                if let request =  model.request {
-                    TSImageStoreTool.removeImage(urlString:request.imageUrl)
-                }
             }
             
-            listModels.remove(at: index)
-            debugPrint("listModels.remove(at: \(index))")
+            if let request =  model.request {
+                TSImageStoreTool.removeImage(urlString:request.imageUrl)
+            }
         }
     }
-
     
     func updateData(_ actionInfoModel:TSActionInfoModel,uuid:String? = nil){
         let dbModel = TSDBActionInfoModel.createDBModel(actionInfoModel: actionInfoModel)

+ 1 - 1
TSLiveWallpaper/Data/TSRealmManager/TSRealmManager.swift

@@ -26,7 +26,7 @@ class TSRealmManager {
          3.6.6 ->7
          **/
    
-        let newSchemaVersion: UInt64 = 8
+        let newSchemaVersion: UInt64 = 7
         // 获取默认配置
         var config = Realm.Configuration.defaultConfiguration
         // 设置新版本号

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

@@ -107,7 +107,7 @@
 "Well-exposed or severely damaged photos" = "الصور المعرضة جيدًا أو التالفة بشدة";
 "Over-dark or over-light, overexposed, or underexposed photos" = "الصور شديدة الظلام أو شديدة الإضاءة، أو شديدة التعرض، أو قليلة التعرض";
 "Recreate Tips" = "نصائح إعادة الإنشاء";
-"Recreate" = "إعادة إنشاء";
+"Recreate" = "إعادة إنشاء الصورة";
 "Bring new life to old photos" = "إضفاء حياة جديدة على الصور القديمة";
 "Adjust Light" = "ضبط الضوء";
 "Easily fix lighting issues on photos" = "إصلاح مشاكل الإضاءة في الصور بسهولة";

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

@@ -107,7 +107,7 @@
 "Well-exposed or severely damaged photos" = "Fotos bien expuestas o muy dañadas";
 "Over-dark or over-light, overexposed, or underexposed photos" = "Fotos demasiado oscuras o demasiado claras, sobreexpuestas o subexpuestas";
 "Recreate Tips" = "Consejos para recrear";
-"Recreate" = "Recrear";
+"Recreate" = "Recrear foto";
 "Bring new life to old photos" = "Dale nueva vida a fotos antiguas";
 "Adjust Light" = "Ajustar la luz";
 "Easily fix lighting issues on photos" = "Solucione fácilmente los problemas de iluminación en las fotografías";

+ 3 - 3
TSLiveWallpaper/ja.lproj/Localizable.strings

@@ -35,16 +35,16 @@
 "No network, please check your network and try again." = "ネットワーク接続がありません。ネットワーク接続を確認し、もう一度お試しください。";
 "Your photo may contain nudity, gore or violence that does not comply with the health policy, please replace the photo and try again." = "あなたの写真には、健康ポリシーに違反する裸体、残虐な表現、または暴力が含まれている可能性があります。写真を置き換え、もう一度お試しください。";
 "Process in the background" = "バックグラウンドで処理中";
-"History" = "履歴";
+"History" = "履歴記録";
 "Upgrade" = "アップグレード";
 "Well-exposed or severely damaged photos" = "露出が適切または深刻な損傷を受けた写真";
 "Over-dark or over-light, overexposed, or underexposed photos" = "過度に暗く、過度に明るく、露出過多、または露出不足の写真";
 "Recreate Tips" = "再作成のヒント";
-"Recreate" = "再作成";
+"Recreate" = "写真の変形";
 "Bring new life to old photos" = "古い写真に新しい命を吹き込む";
 "Adjust Light" = "ライトを調整する";
 "Easily fix lighting issues on photos" = "写真の照明問題を簡単に修正";
-"View" = "表示";
+"View" = "閲覧";
 "Example" = "例";
 "Limited Time Discount" = "期間限定割引";
 "Allow us to access to upload photos to process and save processed photos to your device." = "写真を読み込んで処理し、処理済みの写真をデバイスに保存するために、アクセスを許可してください。";

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

@@ -40,7 +40,7 @@
 "Well-exposed or severely damaged photos" = "잘 노출되었거나 심하게 손상된 사진";
 "Over-dark or over-light, overexposed, or underexposed photos" = "과도하게 어두우거나 밝은, 과노출 또는 저노출 사진";
 "Recreate Tips" = "재창조 팁";
-"Recreate" = "재창조";
+"Recreate" = "사진 재생성";
 "Bring new life to old photos" = "옛 사진에 새로운 생명을 불어넣습니다";
 "Adjust Light" = "조명 조절";
 "Easily fix lighting issues on photos" = "사진의 조명 문제를 쉽게 수정합니다";

+ 5 - 5
TSLiveWallpaper/zh-Hant.lproj/Localizable.strings

@@ -35,12 +35,12 @@
 "No network, please check your network and try again." = "無網路連接,請檢查網路並重新嘗試。";
 "Your photo may contain nudity, gore or violence that does not comply with the health policy, please replace the photo and try again." = "您的照片可能包含裸露、血腥或暴力內容,不符合健康政策,請更換照片並重新嘗試。";
 "Process in the background" = "在後台處理";
-"History" = "歷史";
+"History" = "歷史記錄";
 "Upgrade" = "升級";
 "Well-exposed or severely damaged photos" = "曝光良好或嚴重損壞的照片";
 "Over-dark or over-light, overexposed, or underexposed photos" = "過暗、過亮、曝光過度或曝光不足的照片";
 "Recreate Tips" = "重新創建提示";
-"Recreate" = "重新創建";
+"Recreate" = "重塑照片";
 "Bring new life to old photos" = "為舊照片注入新生命";
 "Adjust Light" = "調整光線";
 "Easily fix lighting issues on photos" = "輕鬆修復照片的照明問題";
@@ -119,9 +119,9 @@
 "Retain" = "保留";
 "Delete" = "刪除";
 "Delete this error history?" = "刪除此錯誤記錄?";
-"Due Date:" = "截止日期:";
-"Share us" = "分享我們";
-"Rate us" = "評分";
+"Due Date:" = "過期時間:";
+"Share us" = "分享我們";
+"Rate us" = "點贊我們";
 "User Agreement" = "使用者協議";
 "Privacy Policy" = "隱私政策";
 "About us" = "關於我們";