소스 검색

fix

Signed-off-by: Marino Faggiana <8616947+marinofaggiana@users.noreply.github.com>
Marino Faggiana 1 년 전
부모
커밋
c98b8eb0e7
4개의 변경된 파일23개의 추가작업 그리고 18개의 파일을 삭제
  1. 2 2
      Nextcloud.xcodeproj/project.pbxproj
  2. 1 1
      iOSClient/AppDelegate.swift
  3. 18 13
      iOSClient/NCImageCache.swift
  4. 2 2
      iOSClient/Networking/NCService.swift

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -4885,7 +4885,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 18;
+				CURRENT_PROJECT_VERSION = 19;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -4950,7 +4950,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 18;
+				CURRENT_PROJECT_VERSION = 19;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;

+ 1 - 1
iOSClient/AppDelegate.swift

@@ -143,6 +143,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         }
 
         NCBrandColor.shared.createUserColors()
+        NCImageCache.shared.createImagesCache()
 
         // Push Notification & display notification
         application.registerForRemoteNotifications()
@@ -194,7 +195,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         NextcloudKit.shared.nkCommonInstance.writeLog("[INFO] Application did become active")
 
         NCImageCache.shared.createMediaCache(account: account)
-        NCImageCache.shared.createImagesCache()
 
         NCSettingsBundleHelper.setVersionAndBuildNumber()
         NCSettingsBundleHelper.checkAndExecuteSettings(delay: 0.5)

+ 18 - 13
iOSClient/NCImageCache.swift

@@ -201,10 +201,6 @@ import NextcloudKit
 
     func createImagesCache() {
 
-        let brandElement = NCBrandColor.shared.brandElement
-        guard brandElement != self.brandElementColor else { return }
-        self.brandElementColor = brandElement
-
         let yellowFavorite = NCBrandColor.shared.yellowFavorite
         let utility = NCUtility()
 
@@ -220,15 +216,6 @@ import NextcloudKit
         images.offlineFlag = UIImage(named: "offlineFlag")!
         images.local = UIImage(named: "local")!
 
-        let folderWidth: CGFloat = UIScreen.main.bounds.width / 3
-        images.folderEncrypted = UIImage(named: "folderEncrypted")!.image(color: brandElement, size: folderWidth)
-        images.folderSharedWithMe = UIImage(named: "folder_shared_with_me")!.image(color: brandElement, size: folderWidth)
-        images.folderPublic = UIImage(named: "folder_public")!.image(color: brandElement, size: folderWidth)
-        images.folderGroup = UIImage(named: "folder_group")!.image(color: brandElement, size: folderWidth)
-        images.folderExternal = UIImage(named: "folder_external")!.image(color: brandElement, size: folderWidth)
-        images.folderAutomaticUpload = UIImage(named: "folderAutomaticUpload")!.image(color: brandElement, size: folderWidth)
-        images.folder = UIImage(named: "folder")!.image(color: brandElement, size: folderWidth)
-
         images.checkedYes = utility.loadImage(named: "checkmark.circle.fill", color: .systemBlue)
         images.checkedNo = utility.loadImage(named: "circle", color: .systemGray)
 
@@ -238,6 +225,24 @@ import NextcloudKit
         images.buttonRestore = UIImage(named: "restore")!.image(color: .systemGray, size: 50)
         images.buttonTrash = UIImage(named: "trash")!.image(color: .systemGray, size: 50)
 
+        createImagesBrandCache()
+    }
+
+    func createImagesBrandCache() {
+
+        let brandElement = NCBrandColor.shared.brandElement
+        guard brandElement != self.brandElementColor else { return }
+        self.brandElementColor = brandElement
+
+        let folderWidth: CGFloat = UIScreen.main.bounds.width / 3
+        images.folderEncrypted = UIImage(named: "folderEncrypted")!.image(color: brandElement, size: folderWidth)
+        images.folderSharedWithMe = UIImage(named: "folder_shared_with_me")!.image(color: brandElement, size: folderWidth)
+        images.folderPublic = UIImage(named: "folder_public")!.image(color: brandElement, size: folderWidth)
+        images.folderGroup = UIImage(named: "folder_group")!.image(color: brandElement, size: folderWidth)
+        images.folderExternal = UIImage(named: "folder_external")!.image(color: brandElement, size: folderWidth)
+        images.folderAutomaticUpload = UIImage(named: "folderAutomaticUpload")!.image(color: brandElement, size: folderWidth)
+        images.folder = UIImage(named: "folder")!.image(color: brandElement, size: folderWidth)
+
         images.iconContacts = UIImage(named: "icon-contacts")!.image(color: brandElement, size: folderWidth)
         images.iconTalk = UIImage(named: "icon-talk")!.image(color: brandElement, size: folderWidth)
         images.iconCalendar = UIImage(named: "icon-calendar")!.image(color: brandElement, size: folderWidth)

+ 2 - 2
iOSClient/Networking/NCService.swift

@@ -175,7 +175,7 @@ class NCService: NSObject {
         NextcloudKit.shared.getCapabilities(options: NKRequestOptions(queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)) { account, data, error in
             guard error == .success, let data = data else {
                 NCBrandColor.shared.settingThemingColor(account: account)
-                NCImageCache.shared.createImagesCache()
+                NCImageCache.shared.createImagesBrandCache()
                 return
             }
 
@@ -187,7 +187,7 @@ class NCService: NSObject {
             // Theming
             if NCGlobal.shared.capabilityThemingColor != NCBrandColor.shared.themingColor || NCGlobal.shared.capabilityThemingColorElement != NCBrandColor.shared.themingColorElement || NCGlobal.shared.capabilityThemingColorText != NCBrandColor.shared.themingColorText {
                 NCBrandColor.shared.settingThemingColor(account: account)
-                NCImageCache.shared.createImagesCache()
+                NCImageCache.shared.createImagesBrandCache()
             }
 
             // Sharing & Comments