瀏覽代碼

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 年之前
父節點
當前提交
55d28c5a4d
共有 3 個文件被更改,包括 11 次插入3 次删除
  1. 4 0
      Share/NCShareExtension+NCDelegate.swift
  2. 5 1
      Share/NCShareExtension.swift
  3. 2 2
      iOSClient/Brand/NCBrand.swift

+ 4 - 0
Share/NCShareExtension+NCDelegate.swift

@@ -76,6 +76,10 @@ extension NCShareExtension: NCEmptyDataSetDelegate, NCAccountRequestDelegate {
         }
         }
         self.activeAccount = activeAccount
         self.activeAccount = activeAccount
 
 
+        // COLORS
+        NCBrandColor.shared.settingThemingColor(account: activeAccount.account)
+        NCBrandColor.shared.createUserColors()
+
         // NETWORKING
         // NETWORKING
         NCCommunicationCommon.shared.setup(
         NCCommunicationCommon.shared.setup(
             account: activeAccount.account,
             account: activeAccount.account,

+ 5 - 1
Share/NCShareExtension.swift

@@ -127,7 +127,11 @@ class NCShareExtension: UIViewController {
         }
         }
 
 
         // Colors
         // Colors
-        NCBrandColor.shared.createImagesThemingColor()
+        if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
+            NCBrandColor.shared.settingThemingColor(account: activeAccount.account)
+        } else {
+            NCBrandColor.shared.createImagesThemingColor()
+        }
         NCBrandColor.shared.createUserColors()
         NCBrandColor.shared.createUserColors()
 
 
         hud.indicatorView = JGProgressHUDRingIndicatorView()
         hud.indicatorView = JGProgressHUDRingIndicatorView()

+ 2 - 2
iOSClient/Brand/NCBrand.swift

@@ -411,7 +411,6 @@ class NCBrandColor: NSObject {
         cacheImages.iconPages = UIImage(named: "icon-pages")!.image(color: brandElement, size: folderWidth)
         cacheImages.iconPages = UIImage(named: "icon-pages")!.image(color: brandElement, size: folderWidth)
     }
     }
 
 
-    #if !EXTENSION
     func settingThemingColor(account: String) {
     func settingThemingColor(account: String) {
 
 
         let darker: CGFloat = 30    // %
         let darker: CGFloat = 30    // %
@@ -490,9 +489,10 @@ class NCBrandColor: NSObject {
         }
         }
         
         
         createImagesThemingColor()
         createImagesThemingColor()
+        #if !EXTENSION
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterChangeTheming)
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterChangeTheming)
+        #endif
     }
     }
-    #endif
 
 
     private func stepCalc(steps: Int, color1: CGColor, color2: CGColor) -> [CGFloat] {
     private func stepCalc(steps: Int, color1: CGColor, color2: CGColor) -> [CGFloat] {
         var step = [CGFloat](repeating: 0, count: 3)
         var step = [CGFloat](repeating: 0, count: 3)