100Years 2 долоо хоног өмнө
parent
commit
034d23f76c
24 өөрчлөгдсөн 359 нэмэгдсэн , 52 устгасан
  1. 6 2
      TSLiveWallpaper.xcodeproj/project.pbxproj
  2. 12 23
      TSLiveWallpaper/AppDelegate.swift
  3. 1 1
      TSLiveWallpaper/Business/BusinessView/TSPageNullView.swift
  4. 10 2
      TSLiveWallpaper/Business/TSAIListVC/TSAIListHistoryVC/TSAIListHistoryVC.swift
  5. 1 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataVM+Dic.swift
  6. 1 4
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserCell.swift
  7. 272 0
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserPageVC.swift
  8. 1 2
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserVC.swift
  9. 1 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoGeneratorVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC+View.swift
  10. 10 14
      TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoGeneratorVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC.swift
  11. 1 1
      TSLiveWallpaper/Business/TSAIListVC/TSAIUploadPhotoVC/TSAIPhotoRemoveVC/TSAIPhotoRemoveVC.swift
  12. 1 0
      TSLiveWallpaper/Business/TSAIResultsFrameVC/TSAIUsedPhotoVC/TSAIUsedPhotoVC.swift
  13. 8 1
      TSLiveWallpaper/Common/ViewTool/TSPhotoPickerManager/TSPhotoPickerManager.swift
  14. 3 0
      TSLiveWallpaper/ar.lproj/Localizable.strings
  15. 3 0
      TSLiveWallpaper/de.lproj/Localizable.strings
  16. 4 0
      TSLiveWallpaper/en.lproj/Localizable.strings
  17. 3 0
      TSLiveWallpaper/es.lproj/Localizable.strings
  18. 3 0
      TSLiveWallpaper/fr.lproj/Localizable.strings
  19. 3 0
      TSLiveWallpaper/it.lproj/Localizable.strings
  20. 3 0
      TSLiveWallpaper/ja.lproj/Localizable.strings
  21. 3 0
      TSLiveWallpaper/ko.lproj/Localizable.strings
  22. 3 0
      TSLiveWallpaper/pt-BR.lproj/Localizable.strings
  23. 3 0
      TSLiveWallpaper/pt-PT.lproj/Localizable.strings
  24. 3 0
      TSLiveWallpaper/zh-Hant.lproj/Localizable.strings

+ 6 - 2
TSLiveWallpaper.xcodeproj/project.pbxproj

@@ -94,6 +94,7 @@
 		A87CF8522E0296B30063CB7E /* TSAIPhotoDetailsBrowserVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A87CF8512E0296960063CB7E /* TSAIPhotoDetailsBrowserVC.swift */; };
 		A87CF8542E029B450063CB7E /* TSAIPhotoDetailsBrowserCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A87CF8532E029B3F0063CB7E /* TSAIPhotoDetailsBrowserCell.swift */; };
 		A87CF85A2E02AF070063CB7E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A87CF8582E02AF070063CB7E /* InfoPlist.strings */; };
+		A880ECEA2E41995100222C47 /* TSAIPhotoDetailsBrowserPageVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A880ECE92E41995000222C47 /* TSAIPhotoDetailsBrowserPageVC.swift */; };
 		A8843B272E40D36900C9B01D /* TSUserdPhotoDiskTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8843B262E40D35E00C9B01D /* TSUserdPhotoDiskTool.swift */; };
 		A8843B292E40E66D00C9B01D /* TSImagePhotoDiskTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8843B282E40E66C00C9B01D /* TSImagePhotoDiskTool.swift */; };
 		A8884B612E2DE7A3001B41AC /* TSAIPhotoRemoveBgView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8884B602E2DE789001B41AC /* TSAIPhotoRemoveBgView.swift */; };
@@ -287,6 +288,7 @@
 		A87CF8592E02AF070063CB7E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		A87CF85C2E02AF150063CB7E /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		A87CF85D2E02AF410063CB7E /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		A880ECE92E41995000222C47 /* TSAIPhotoDetailsBrowserPageVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAIPhotoDetailsBrowserPageVC.swift; sourceTree = "<group>"; };
 		A8843B262E40D35E00C9B01D /* TSUserdPhotoDiskTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSUserdPhotoDiskTool.swift; sourceTree = "<group>"; };
 		A8843B282E40E66C00C9B01D /* TSImagePhotoDiskTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSImagePhotoDiskTool.swift; sourceTree = "<group>"; };
 		A8884B602E2DE789001B41AC /* TSAIPhotoRemoveBgView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAIPhotoRemoveBgView.swift; sourceTree = "<group>"; };
@@ -852,6 +854,7 @@
 		A86857D82DF9943E0089D222 /* TSAIPhotoDetailsVC */ = {
 			isa = PBXGroup;
 			children = (
+				A880ECE92E41995000222C47 /* TSAIPhotoDetailsBrowserPageVC.swift */,
 				A87CF8512E0296960063CB7E /* TSAIPhotoDetailsBrowserVC.swift */,
 				A87CF8532E029B3F0063CB7E /* TSAIPhotoDetailsBrowserCell.swift */,
 			);
@@ -1368,6 +1371,7 @@
 				A83A6A892E1FCF750084197A /* TSChangeLanguageVC.swift in Sources */,
 				A86857BC2DF926110089D222 /* TSAIListHistoryVC.swift in Sources */,
 				A86857932DF845F60089D222 /* TSGeneratorErrorView.swift in Sources */,
+				A880ECEA2E41995100222C47 /* TSAIPhotoDetailsBrowserPageVC.swift in Sources */,
 				A86857C02DF926870089D222 /* TSPageNullView.swift in Sources */,
 				A8F8BCD32E03FD5400EF4AA6 /* TSAIUploadPhotoVC+Video.swift in Sources */,
 				A86857942DF845F60089D222 /* TSGeneratorView.swift in Sources */,
@@ -1477,7 +1481,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;
@@ -1518,7 +1522,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;

+ 12 - 23
TSLiveWallpaper/AppDelegate.swift

@@ -130,14 +130,8 @@ extension AppDelegate {
 extension AppDelegate {
     
     func handleKingfisher(){
-//        moveCacheSmoothly()
-//        let cache = ImageCache( name: "permanent_image_cache")
-        //        guard let cachesURL = fileManager.urls(for: .cachesDirectory, in: .userDomainMask).first else {
-        //            dePrint("Cache Kingfisher 没有缓存,不用迁移")
-        //            return
-        //        }
-        
-//        cleanOldKFCacheData()
+
+        cleanOldKFCacheData()
         
         let cache = try! ImageCache(
             name: "permanent_image_cache",
@@ -150,29 +144,24 @@ extension AppDelegate {
     
     
     func cleanOldKFCacheData() {
-        //因为把kf 缓存从 cache 切换到了documentDirectory,所以清理下旧缓存数据
-        if UserDefaults.standard.string(forKey: "documentDirectory_permanent_image_cache") == nil {
-            UserDefaults.standard.set("1", forKey: "documentDirectory_permanent_image_cache")
+        //去除kf图片存储逻辑,切换到手动写的documentDirectory,所以清理下旧数据
+        let key = "documentDirectory_permanent_image_cache"
+        if UserDefaults.standard.string(forKey: key) == nil {
+            UserDefaults.standard.set("1", forKey: key)
             UserDefaults.standard.synchronize()
+
+            TSFileManagerTool.removeItem(from: TSFileManagerTool.cacheDirectory.appendingPathComponent("com.onevcat.Kingfisher.ImageCache.permanent_image_cache"))
+            TSFileManagerTool.removeItem(from: TSBusinessFileManager.saveVideoPathURL)
             
             TSDBKeyManager.clearAll()
-            
-            let fileManager = FileManager.default
-            guard let cachesURL = fileManager.urls(for: .cachesDirectory, in: .userDomainMask).first else {
-                dePrint("Cache Kingfisher 没有缓存,不用迁移")
-                return
-            }
-            let srcURL = cachesURL.appendingPathComponent("com.onevcat.Kingfisher.ImageCache.permanent_image_cache")
-            do {
-                dePrint("srcURL=\(srcURL)")
-                try fileManager.removeItem(at: srcURL)
-            } catch {
-                debugPrint("尝试删除文件失败: \(error.localizedDescription)")
+            TSRMShared.writeThread {
+                TSRMShared.realm.delete(TSRMShared.realm.objects(TSDBActionInfoModel.self))
             }
             dePrint("删除 Cache Kingfisher 流程结束")
         }
     }
     
+    
 //    func moveCacheSmoothly(){
 //        // 1. 获取旧文件路径的图片
 //        let fileManager = FileManager.default

+ 1 - 1
TSLiveWallpaper/Business/BusinessView/TSPageNullView.swift

@@ -13,7 +13,7 @@ class TSPageNullView: TSBaseView {
     }()
     
     lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel.createLabel(text:"There's nothing here yet".localized ,font:.font(size: 14.0),textColor: .white.withAlphaComponent(0.6),textAlignment: .center,numberOfLines: 0)
+        let titleLabel = UILabel.createLabel(text:"No Creation yet. Your creations will be listed here".localized ,font:.font(size: 14.0),textColor: .white.withAlphaComponent(0.6),textAlignment: .center,numberOfLines: 0)
         return titleLabel
     }()
     

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

@@ -58,7 +58,6 @@ class TSAIListHistoryVC: TSBaseVC {
         updateDataView()
         NotificationCenter.default.addObserver(self, selector: #selector(operationChanged(_:)), name: .kGenerateBasePhotoOperation, object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(updateDataView), name: .kAIPhotoDataChanged, object: nil)
-        
         NotificationCenter.default.addObserver(self, selector: #selector(updateVipView), name: .kPurchaseDidChanged, object: nil)
         updateVipView()
     }
@@ -97,6 +96,9 @@ class TSAIListHistoryVC: TSBaseVC {
     
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
+        
+//        let historys = TSRMShared.realm.objects(TSDBActionInfoModel.self)
+//        dePrint("historys.count=\(historys.count)")
     }
     
     @objc func clickNavRight() {
@@ -152,7 +154,11 @@ extension TSAIListHistoryVC: UICollectionViewDataSource ,UICollectionViewDelegat
             }
             
             let currentIndex = dataModelArray.firstIndex(of: dbModel) ?? 0
-            let vc = TSAIPhotoDetailsBrowserVC(dataModelArray: dataModelArray, currentIndex: currentIndex)
+            
+            
+//            let vc = TSAIPhotoDetailsBrowserVC(dataModelArray: dataModelArray, currentIndex: currentIndex)
+            let vc = TSAIPhotoDetailsBrowserPageVC(dataItems: dataModelArray, startIndex: currentIndex)
+            
             vc.deleteBlock = { [weak self]  model in
                 guard let self = self else { return }
                 TSRMShared.aiListDB.deleteListModel(id: model.id)
@@ -160,6 +166,8 @@ extension TSAIListHistoryVC: UICollectionViewDataSource ,UICollectionViewDelegat
             }
             kPresentModalVC(target: self, modelVC: vc)
             
+            
+
 //            let cyModel = dbModel
 //            let gennerateVC = TSAIListPhotoGeneratorVC(generatorModel: TSAIListPhotoGeneratorModel(upLoadImage: UIImage(), generatorStyle: cyModel.request.generatorStyle),infoModel: cyModel) { model in }
 //            gennerateVC.modalPresentationStyle = .overFullScreen

+ 1 - 1
TSLiveWallpaper/Business/TSAIListVC/TSAIListVC/VM/TSAIListDataVM+Dic.swift

@@ -28,9 +28,9 @@ extension TSAIListDataVM {
         return[
             1:[
                 TSGenerateModel(json: ptp_Colorize)!,
+                TSGenerateModel(json: ptp_Recreate)!,
                 TSGenerateModel(json: ptp_Enhance)!,
                 TSGenerateModel(json: ptp_Descratch)!,
-                TSGenerateModel(json: ptp_Recreate)!,
                 TSGenerateModel(json: ptp_AdjustLight)!,
             ]
         ]

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

@@ -43,10 +43,7 @@ class TSAIPhotoDetailsVideoCell: TSAIPhotoDetailsBaseBrowserCell {
     }
     
     var videoPlayerVC: TSAIListVideoPlayerVC?
-    override func creatUI() {
-        
-    }
-    
+
     func addVideoView(){
         self.videoPlayerVC = TSAIListVideoPlayerVC(videoURL: self.model.response.videoURL)
         self.bgContentView.addSubview(self.videoPlayerVC!.view)

+ 272 - 0
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserPageVC.swift

@@ -0,0 +1,272 @@
+//
+//  TSAIPhotoDetailsBrowserPageVC.swift
+//  TSLiveWallpaper
+//
+//  Created by 100Years on 2025/8/4.
+//
+
+class TSAIPhotoDetailsBrowserPageVC: TSBaseVC {
+    
+    var deleteBlock:((TSActionInfoModel)->Void)?
+    var browserPageVC:TSAIPhotoBrowserPageVC
+    public init(dataItems: [Any], startIndex: Int = 0) {
+        browserPageVC = TSAIPhotoBrowserPageVC(dataItems: dataItems, startIndex: startIndex)
+        super.init()
+    }
+    
+    @MainActor required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    lazy var shareBtn: TSVerticalButton = {
+        let shareBtn = TSVerticalButton()
+        shareBtn.setUpButton(title: "Share".localized,
+                             image: .share,
+                              font: .font(name:.ZillaSlab,size: 14,weight: .medium),
+                             titleColor: .white,
+                             autoMirrored: false){ [weak self]  in
+            guard let self = self else { return }
+            clickShare()
+        }
+        shareBtn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10)
+        shareBtn.titleLabel?.layer.shadowColor = UIColor.black.cgColor
+        shareBtn.titleLabel?.layer.shadowOffset = CGSize(width: 0, height: 2)
+        shareBtn.titleLabel?.layer.shadowRadius = 3
+        shareBtn.titleLabel?.layer.shadowOpacity = 0.4
+        shareBtn.titleLabel?.layer.masksToBounds = false
+        return shareBtn
+    }()
+
+    lazy var saveBtn: UIButton = {
+        let saveBtn = kCreateNormalSubmitBtn(title: "Save".localized) { [weak self]  in
+            guard let self = self else { return }
+            clickSaveBtn()
+        }
+        return saveBtn
+    }()
+    var navRightBtn:UIButton = UIButton()
+    
+    override func createView() {
+        addPullDownClosePage()
+        addNormalNavBarView()
+        setPageTitle("Result".localized)
+        navRightBtn = setNavigationItem("", imageName: "ai_delete", direction: .right, action: #selector(clickNavRight))
+        contentView.snp.updateConstraints { make in
+            make.top.equalTo(0)
+        }
+        
+        self.addChild(browserPageVC)
+        contentView.addSubview(browserPageVC.view)
+        
+        let bottomBtnTop:CGFloat = -12-k_Height_safeAreaInsetsBottom()
+        contentView.addSubview(shareBtn)
+        shareBtn.snp.makeConstraints { make in
+            make.leading.equalTo(16)
+            make.width.equalTo(shareBtn.intrinsicContentSize.width)
+            make.height.equalTo(48)
+            make.bottom.equalTo(bottomBtnTop)
+        }
+        
+        contentView.addSubview(saveBtn)
+        saveBtn.snp.makeConstraints { make in
+            make.leading.equalTo(shareBtn.snp.trailing).offset(40)
+            make.trailing.equalTo(-16.0)
+            make.height.equalTo(48)
+            make.bottom.equalTo(bottomBtnTop)
+        }
+        
+    }
+    
+    override func createFrame() {
+        browserPageVC.view.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+    }
+    
+    override func dealThings() {
+ 
+    
+    }
+}
+
+
+extension TSAIPhotoDetailsBrowserPageVC {
+    
+    var currentIndex:Int{
+        return browserPageVC.currentIndex
+    }
+    
+    var currentModel:TSActionInfoModel?{
+        if let model = browserPageVC.dataItems.safeObj(At: currentIndex) as? TSActionInfoModel{
+            return model
+        }
+        return nil
+    }
+    
+    //保存功能
+    @objc func clickSaveBtn(){
+        guard let infoModel = currentModel else { return }
+        if infoModel.modelType != .example{
+            if kJudgeVip(externalBool: true, vc: self) { return } //判断 vip
+        }
+        
+        if infoModel.isVideo{
+            TSDownloadManager.getDownLoadVideo(urlString: infoModel.response.resultUrl) { url, success in
+                if let url = url {
+                    PhotoManagerShared.saveVideoToAlbum(videoURL: url) { [weak self] success, error in
+                        guard let self = self else { return }
+                        if success {
+                            kSaveSuccesswShared.show(atView:self.view)
+                        }else{
+                            debugPrint(error)
+                        }
+                    }
+                }
+            }
+        }else{
+            if let image = TSImagePhotoDiskTool.getLocalImage(urlString: infoModel.response.resultUrl){
+                PhotoManagerShared.saveImageToAlbum(image) { [weak self] success, error in
+                    guard let self = self else { return }
+                    if success {
+                        kSaveSuccesswShared.show(atView:self.view)
+                    }else{
+                        debugPrint(error)
+                    }
+                }
+            }
+        }
+    }
+    
+    func clickShare() {
+        guard let infoModel = currentModel else { return }
+        if infoModel.modelType != .example{
+            if kJudgeVip(externalBool: true, vc: self) { return } //判断 vip
+        }
+        if infoModel.isVideo{
+            TSDownloadManager.getDownLoadVideo(urlString: infoModel.response.resultUrl) { url, success in
+                if let url = url {
+                    kShareContent(target: self, anyData: url)
+                }
+            }
+        }else{
+            if let image = TSImagePhotoDiskTool.getLocalImage(urlString: infoModel.response.resultUrl){
+                kShareContent(target: self, anyData: image)
+            }
+        }
+    }
+    
+    @objc func clickNavRight() {
+        TSCustomAlertController.show(in: self, config: TSCustomAlertController.AlertConfig(
+            message: "Are you sure to delete?".localized,
+            cancelTitle: "Delete".localized,
+            cancelColor: .red,
+            confirmTitle: "Retain".localized,
+            confirmColor: .white,
+            cancelAction: { [weak self]  in
+                guard let self = self else { return }
+                if let currentModel = currentModel {
+                    self.deleteBlock?(currentModel)
+                }
+                
+                browserPageVC.removePage(at: currentIndex, animated: true)
+                if browserPageVC.dataItems.count <= 0 {
+                    self.navBarClickLeftAction()
+                }
+            }
+        ))
+    }
+    
+    func reloadUI() {
+        guard let currentModel = currentModel else { return }
+        kSetBtnVipIcon(btn: saveBtn, show: currentModel.modelType == .normal)
+    }
+}
+
+class TSAIPhotoBrowserPageVC: TSBasePageVC {
+    override func viewController(at index: Int) -> UIViewController? {
+          guard index >= 0 && index < dataItems.count else { return nil }
+          if let model = dataItems[index] as? TSActionInfoModel {
+              return TSAIPhotoDetailsBrowserBaseVC.createBrowserVC(with: model)
+          }
+          return nil
+      }
+    
+    override func indexOfViewController(_ viewController: UIViewController) -> Int? {
+          guard let vc = viewController as? TSAIPhotoDetailsBrowserBaseVC,
+                let index = dataItems.firstIndex(where: { ($0 as? TSActionInfoModel) == vc.model }) else {
+              return nil
+          }
+          return index
+      }
+    
+    override func dealThings() {
+ 
+    }
+}
+
+class TSAIPhotoDetailsBrowserBaseVC: TSBaseVC {
+    
+    var model:TSActionInfoModel
+
+    init(model: TSActionInfoModel) {
+        self.model = model
+        super.init()
+    }
+    
+    
+    @MainActor required init?(coder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    override func createView() {
+        setNavBarViewHidden(true)
+    }
+    
+    
+    // 工厂方法
+    static func createBrowserVC(with model: TSActionInfoModel) -> TSAIPhotoDetailsBrowserBaseVC {
+        if model.isVideo {
+            return TSAIPhotoDetailsBrowserVideoVC(model: model)
+        }else{
+            return TSAIPhotoDetailsBrowserImageVC(model: model)
+        }
+    }
+    
+}
+
+class TSAIPhotoDetailsBrowserImageVC: TSAIPhotoDetailsBrowserBaseVC {
+    lazy var netWorkImageView: UIImageView = UIImageView.createImageView()
+
+    override func createView() {
+        super.createView()
+        
+        contentView.addSubview(netWorkImageView)
+        netWorkImageView.snp.makeConstraints { make in
+            make.edges.equalToSuperview()
+        }
+    }
+    
+    override func dealThings() {
+        netWorkImageView.image = TSImagePhotoDiskTool.getLocalImage(urlString: model.response.resultUrl)
+    }
+}
+
+class TSAIPhotoDetailsBrowserVideoVC: TSAIPhotoDetailsBrowserBaseVC {
+    
+    lazy var netWorkImageView: UIImageView = UIImageView.createImageView()
+    var videoPlayerVC: TSAIListVideoPlayerVC?
+
+    override func createView() {
+        super.createView()
+        
+        self.videoPlayerVC = TSAIListVideoPlayerVC(videoURL: self.model.response.videoURL)
+        self.contentView.addSubview(self.videoPlayerVC!.view)
+        self.videoPlayerVC!.view.snp.remakeConstraints { make in
+            make.center.equalToSuperview()
+            make.width.equalTo(k_ScreenWidth)
+            make.height.equalTo(k_ScreenHeight)
+        }
+        self.videoPlayerVC?.runloppPlay()
+    }
+    
+}

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

@@ -34,7 +34,6 @@ class TSAIPhotoDetailsBrowserVC: TSBaseVC {
     }
     
 
-    
     lazy var collectionView: UICollectionView = {
 
         let layout = UICollectionViewFlowLayout()
@@ -72,7 +71,7 @@ class TSAIPhotoDetailsBrowserVC: TSBaseVC {
         shareBtn.setUpButton(title: "Share".localized,
                              image: .share,
                               font: .font(name:.ZillaSlab,size: 14,weight: .medium),
-                             titleColor: .white.withAlphaComponent(0.8),
+                             titleColor: .white,
                              autoMirrored: false){ [weak self]  in
             guard let self = self else { return }
             clickShare()

+ 1 - 1
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoGeneratorVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC+View.swift

@@ -31,7 +31,7 @@ extension TSAIPhotoDetailsVC{
         shareBtn.setUpButton(title: "Share".localized,
                              image: .share,
                               font: .font(name:.ZillaSlab,size: 14,weight: .medium),
-                        titleColor: .white.withAlphaComponent(0.8),
+                        titleColor: .white,
                              autoMirrored: false){ [weak self]  in
             guard let self = self else { return }
             clickShare()

+ 10 - 14
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoGeneratorVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC.swift

@@ -87,10 +87,8 @@ class TSAIPhotoDetailsVC: TSBaseVC {
                 }
             }
         }else{
-            TSImageStoreTool.downloadImageWithProgress(urlString: infoModel.response.resultUrl) { image in
-                if let image = image {
-                    kShareContent(target: self, anyData: image)
-                }
+            if let image = TSImagePhotoDiskTool.getLocalImage(urlString: infoModel.response.resultUrl){
+                kShareContent(target: self, anyData: image)
             }
         }
     }
@@ -115,16 +113,14 @@ class TSAIPhotoDetailsVC: TSBaseVC {
                 }
             }
         }else{
-            TSImageStoreTool.downloadImageWithProgress(urlString: infoModel.response.resultUrl) { image in
-                if let image = image {
-                    PhotoManagerShared.saveImageToAlbum(image) { [weak self] success, error in
-                        guard let self = self else { return }
-                        if success {
-                            isSavePhotoMark = true
-                            kSaveSuccesswShared.show(atView:self.view)
-                        }else{
-                            debugPrint(error)
-                        }
+            if let image = TSImagePhotoDiskTool.getLocalImage(urlString: infoModel.response.resultUrl){
+                PhotoManagerShared.saveImageToAlbum(image) { [weak self] success, error in
+                    guard let self = self else { return }
+                    if success {
+                        isSavePhotoMark = true
+                        kSaveSuccesswShared.show(atView:self.view)
+                    }else{
+                        debugPrint(error)
                     }
                 }
             }

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

@@ -40,7 +40,7 @@ class TSAIRemovePhotoBgVC: TSBaseVC {
         shareBtn.setUpButton(title: "Share".localized,
                              image: .share,
                               font: .font(name:.ZillaSlab,size: 14,weight: .medium),
-                        titleColor: .white.withAlphaComponent(0.8),
+                        titleColor: .white,
                              autoMirrored: false){ [weak self]  in
             guard let self = self else { return }
             clickShare()

+ 1 - 0
TSLiveWallpaper/Business/TSAIResultsFrameVC/TSAIUsedPhotoVC/TSAIUsedPhotoVC.swift

@@ -44,6 +44,7 @@ class TSAIUsedPhotoVC: TSBaseVC {
     
     lazy var pageNullView: TSPageNullView = {
         let pageNullView = TSPageNullView()
+        pageNullView.titleLabel.text = "You haven’t used any photos yet.".localized
         pageNullView.isHidden = true
         return pageNullView
     }()

+ 8 - 1
TSLiveWallpaper/Common/ViewTool/TSPhotoPickerManager/TSPhotoPickerManager.swift

@@ -157,7 +157,7 @@ class TSPhotoPickerManager: NSObject{
             guard let self = self else { return }
             if authorized {
                 var customCameraConfig = CameraConfiguration()
-                customCameraConfig.isSaveSystemAlbum = true
+                customCameraConfig.isSaveSystemAlbum = false
                 customCameraConfig.sessionPreset = .hd1920x1080
                 customCameraConfig.editor.toolsView = .init(toolOptions: [cropSize])
                 customCameraConfig.editor.cropSize.aspectRatios = aspectRatios
@@ -167,6 +167,13 @@ class TSPhotoPickerManager: NSObject{
                 let cameraController = CameraController(config: customCameraConfig, type: .photo,delegate: self)
                 viewController?.present(cameraController, animated: true, completion: nil)
                 self.cameraController = cameraController
+                
+//                let picker = UIImagePickerController()
+//                picker.delegate = self
+//                picker.sourceType = .camera
+//                picker.cameraCaptureMode = .photo
+//                viewController?.present(picker, animated: true)
+//                self.imagePicker = picker
             } else {
                 self.showCameraPermissionAlert()
             }

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

@@ -217,3 +217,6 @@
 "%d Video Generations" = "%d جيلًا من الفيديو";
 "Faster&Higher Quality" = "أسرع وأعلى جودة";
 "100% Ad-Free" = "خالٍ من الإعلانات بنسبة 100%";
+
+"No Creation yet. Your creations will be listed here" = "لا يوجد إبداع بعد. سيتم إدراج إبداعاتك هنا.";
+"You haven’t used any photos yet." = "لم تستخدم أي صور بعد.";

+ 3 - 0
TSLiveWallpaper/de.lproj/Localizable.strings

@@ -208,3 +208,6 @@
 "%d Video Generations" = "%d Videogenerationen";
 "Faster&Higher Quality" = "Schneller und höhere Qualität";
 "100% Ad-Free" = "100 % werbefrei";
+
+"No Creation yet. Your creations will be listed here" = "Noch keine Kreation. Deine Kreationen werden hier aufgelistet";
+"You haven’t used any photos yet." = "Sie haben noch keine Fotos verwendet.";

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

@@ -216,3 +216,7 @@
 "%d Video Generations" = "%d Video Generations";
 "Faster&Higher Quality" = "Faster & Higher Quality";
 "100% Ad-Free" = "100% Ad-Free";
+
+
+"No Creation yet. Your creations will be listed here" = "No Creation yet. Your creations will be listed here";
+"You haven’t used any photos yet." = "You haven’t used any photos yet.";

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

@@ -221,3 +221,6 @@
 "%d Video Generations" = "%d generaciones de vídeo";
 "Faster&Higher Quality" = "Más rápido y de mayor calidad";
 "100% Ad-Free" = "100% libre de publicidad";
+
+"No Creation yet. Your creations will be listed here" = "Aún no hay creación. Tus creaciones se listarán aquí.";
+"You haven’t used any photos yet." = "Aún no has utilizado ninguna fotografía";

+ 3 - 0
TSLiveWallpaper/fr.lproj/Localizable.strings

@@ -209,3 +209,6 @@
 "%d Video Generations" = "%d générations vidéo";
 "Faster&Higher Quality" = "Plus rapide et de meilleure qualité";
 "100% Ad-Free" = "100% sans publicité";
+
+"No Creation yet. Your creations will be listed here" = "Aucune création pour le moment. Vos créations seront listées ici.";
+"You haven’t used any photos yet." = "Vous n’avez pas encore utilisé de photos.";

+ 3 - 0
TSLiveWallpaper/it.lproj/Localizable.strings

@@ -218,3 +218,6 @@
 "%d Video Generations" = "%d Generazioni Video";
 "Faster&Higher Quality" = "Più veloce e di qualità superiore";
 "100% Ad-Free" = "100% senza pubblicità";
+
+"No Creation yet. Your creations will be listed here" = "Nessuna creazione ancora. Le tue creazioni saranno elencate qui";
+"You haven’t used any photos yet." = "Non hai ancora utilizzato alcuna foto.";

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

@@ -215,3 +215,6 @@
 "%d Video Generations" = "%d ビデオ世代";
 "Faster&Higher Quality" = "より速く、より高品質";
 "100% Ad-Free" = "100%広告なし";
+
+"No Creation yet. Your creations will be listed here" = "まだ作品がありません。あなたの作品はここに表示されます";
+"You haven’t used any photos yet." = "まだ写真を使用していません。";

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

@@ -215,3 +215,6 @@
 "%d Video Generations" = "%d개의 비디오 세대";
 "Faster&Higher Quality" = "더 빠르고 더 높은 품질";
 "100% Ad-Free" = "100% 광고 없음";
+
+"No Creation yet. Your creations will be listed here" = "아직 만든 것이 없습니다. 만든 것이 여기에 나열됩니다.";
+"You haven’t used any photos yet." = "아직 사진을 사용하지 않았습니다.";

+ 3 - 0
TSLiveWallpaper/pt-BR.lproj/Localizable.strings

@@ -209,3 +209,6 @@
 "%d Video Generations" = "%d Gerações de Vídeo";
 "Faster&Higher Quality" = "Mais rápido e com mais qualidade";
 "100% Ad-Free" = "100% sem anúncios";
+
+"No Creation yet. Your creations will be listed here" = "Nenhuma criação ainda. Suas criações serão listadas aqui.";
+"You haven’t used any photos yet." = "Você ainda não usou nenhuma foto.";

+ 3 - 0
TSLiveWallpaper/pt-PT.lproj/Localizable.strings

@@ -209,3 +209,6 @@
 "%d Video Generations" = "%d Gerações de Vídeo";
 "Faster&Higher Quality" = "Mais rápido e com mais qualidade";
 "100% Ad-Free" = "100% sem anúncios";
+
+"No Creation yet. Your creations will be listed here" = "Nenhuma criação ainda. Suas criações serão listadas aqui.";
+"You haven’t used any photos yet." = "Você ainda não usou nenhuma foto.";

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

@@ -215,3 +215,6 @@
 "%d Video Generations" = "%d 代視頻";
 "Faster&Higher Quality" = "更快、更高品質";
 "100% Ad-Free" = "100% 無廣告";
+
+"No Creation yet. Your creations will be listed here" = "尚未創作。您的作品將在此列出";
+"You haven’t used any photos yet." = "您尚未使用任何照片。";