浏览代码

variable item grid

marinofaggiana 4 年之前
父节点
当前提交
b19a02f591

+ 1 - 1
Nextcloud.xcodeproj/project.pbxproj

@@ -2812,7 +2812,7 @@
 			repositoryURL = "https://github.com/realm/realm-cocoa";
 			requirement = {
 				kind = exactVersion;
-				version = 10.4.0;
+				version = 10.5.0;
 			};
 		};
 		F786D58B253454BF00E3DD7B /* XCRemoteSwiftPackageReference "ios-communication-library" */ = {

+ 5 - 5
Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

@@ -33,17 +33,17 @@
         "repositoryURL": "https://github.com/realm/realm-cocoa",
         "state": {
           "branch": null,
-          "revision": "580bb8043a607d8669e185ed33ed77de45c0cdfb",
-          "version": "10.4.0"
+          "revision": "c236b2c1270fe41ba7c101a1d17ef56494987cb9",
+          "version": "10.5.0"
         }
       },
       {
-        "package": "RealmCore",
+        "package": "RealmDatabase",
         "repositoryURL": "https://github.com/realm/realm-core",
         "state": {
           "branch": null,
-          "revision": "9b2eb9020f97f0930a3f351be95ac320bdf44cf8",
-          "version": "10.1.4"
+          "revision": "7390723ae39b432bd00f093ea84e3b79534a202c",
+          "version": "10.3.2"
         }
       },
       {

+ 17 - 0
iOSClient/Main/Colleaction Common/NCCollectionCommon.swift

@@ -279,6 +279,23 @@ class NCGridLayout: UICollectionViewFlowLayout {
         get {
             if let collectionView = collectionView {
                 
+                switch collectionView.frame.width {
+                case 0..<400:
+                    itemForLine = 3
+                case 400..<600:
+                    itemForLine = 4
+                case 600..<800:
+                    itemForLine = 5
+                case 800..<1000:
+                    itemForLine = 6
+                case 1000..<1200:
+                    itemForLine = 7
+                case 1200...:
+                    itemForLine = 8
+                default:
+                    itemForLine = 3
+                }
+                
                 let itemWidth: CGFloat = (collectionView.frame.width - marginLeftRight * 2 - marginLeftRight * (itemForLine - 1)) / itemForLine
                 let itemHeight: CGFloat = itemWidth + heightLabelPlusButton