marinofaggiana 3 jaren geleden
bovenliggende
commit
fb4c8be38c

+ 0 - 12
iOSClient/Brand/Background.xcassets/lana.imageset/Contents.json

@@ -1,12 +0,0 @@
-{
-  "images" : [
-    {
-      "filename" : "lana.jpg",
-      "idiom" : "universal"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
iOSClient/Brand/Background.xcassets/lana.imageset/lana.jpg


+ 7 - 0
iOSClient/Extensions/UIColor+Extensions.swift

@@ -114,4 +114,11 @@ extension UIColor {
         let brightness = Float(((components[0] * 299) + (components[1] * 587) + (components[2] * 114)) / 1000)
         return (brightness > threshold)
     }
+    
+    func image(_ size: CGSize = CGSize(width: 1, height: 1)) -> UIImage {
+        return UIGraphicsImageRenderer(size: size).image { rendererContext in
+            self.setFill()
+            rendererContext.fill(CGRect(origin: .zero, size: size))
+        }
+    }
 }

+ 7 - 11
iOSClient/Select/NCSelect.swift

@@ -180,9 +180,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
         if serverUrl == "" {
             serverUrl = NCUtilityFileSystem.shared.getHomeServer(urlBase: activeAccount.urlBase, account: activeAccount.account)
         }
-                
-        // TEST
-    
+                    
         // get auto upload folder
         autoUploadFileName = NCManageDatabase.shared.getAccountAutoUploadFileName()
         autoUploadDirectory = NCManageDatabase.shared.getAccountAutoUploadDirectory(urlBase: activeAccount.urlBase, account: activeAccount.account)
@@ -190,14 +188,12 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
         (layout, sort, ascending, groupBy, directoryOnTop, titleButtonHeader, itemForLine, fillBackgroud, fillBackgroudContentMode) = NCUtility.shared.getLayoutForView(key: keyLayout,serverUrl: serverUrl)
         gridLayout.itemForLine = CGFloat(itemForLine)
         
-        if let image = UIImage(named: "lana") {
-            backgroundImageView.image = image
-            backgroundImageView.contentMode = .scaleToFill
-            collectionView.backgroundView = backgroundImageView
-        } else {
-            backgroundImageView.image = nil
-            collectionView.backgroundView = nil
-        }
+        /*
+        let image = UIColor.red.image(CGSize(width: collectionView.frame.width, height: collectionView.frame.width))
+        backgroundImageView.image = image
+        backgroundImageView.contentMode = .scaleToFill
+        collectionView.backgroundView = backgroundImageView
+        */
         
         if layout == NCGlobal.shared.layoutList {
             collectionView.collectionViewLayout = listLayout