Browse Source

Merge pull request #1287 from nextcloud/small-fixes

Small fixes
Marino Faggiana 4 years ago
parent
commit
63ca4494c1
33 changed files with 342 additions and 341 deletions
  1. 1 0
      Cartfile.resolved
  2. 12 12
      Nextcloud.xcodeproj/project.pbxproj
  3. 10 12
      iOSClient/Activity/NCActivity.storyboard
  4. 0 2
      iOSClient/Favorites/CCFavorites.h
  5. 1 1
      iOSClient/Main/AppDelegate+Swift.swift
  6. 5 2
      iOSClient/Main/CCMain+Swift.swift
  7. 0 2
      iOSClient/Main/CCMain.h
  8. 3 3
      iOSClient/Main/CCMore.swift
  9. 0 43
      iOSClient/Main/Cell/CCCellMain.h
  10. 0 47
      iOSClient/Main/Cell/CCCellMain.m
  11. 74 0
      iOSClient/Main/Cell/CCCellMain.swift
  12. 1 1
      iOSClient/Main/Cell/CCCellMain.xib
  13. 0 38
      iOSClient/Main/Cell/CCCellMainTransfer.h
  14. 0 38
      iOSClient/Main/Cell/CCCellMainTransfer.m
  15. 55 0
      iOSClient/Main/Cell/CCCellMainTransfer.swift
  16. 6 8
      iOSClient/Main/Cell/CCCellMainTransfer.xib
  17. 13 1
      iOSClient/Main/Cell/NCGridCell.swift
  18. 15 7
      iOSClient/Main/Cell/NCGridMediaCell.swift
  19. 13 0
      iOSClient/Main/Cell/NCImageCellProtocol.swift
  20. 12 1
      iOSClient/Main/Cell/NCListCell.swift
  21. 24 6
      iOSClient/Main/Layout/NCLayout.swift
  22. 11 10
      iOSClient/Main/Main.storyboard
  23. 9 38
      iOSClient/Main/NCMainCommon.swift
  24. 24 26
      iOSClient/Media/NCMedia.swift
  25. 26 25
      iOSClient/Networking/NCOperationQueue.swift
  26. 1 1
      iOSClient/Nextcloud-Bridging-Header.h
  27. 2 2
      iOSClient/Notification/NCNotification.storyboard
  28. 4 6
      iOSClient/Offline/NCOffline.storyboard
  29. 1 0
      iOSClient/Settings/CCSettings.m
  30. 0 1
      iOSClient/Synchronize/CCSynchronize.h
  31. 0 1
      iOSClient/Transfers/CCTransfers.m
  32. 4 6
      iOSClient/Trash/NCTrash.storyboard
  33. 15 1
      iOSClient/Utility/CCUtility.m

+ 1 - 0
Cartfile.resolved

@@ -20,6 +20,7 @@ github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
 github "marinofaggiana/TOPasscodeViewController" "0.0.6"
 github "marinofaggiana/XLForm" "eb9381ad8129f60402bf412250fb31b95a628a08"
+github "nextcloud/ios-communication-library" "ca1c77cfcfa8bbf097f79409fca633071c836c14"
 github "nextcloud/ios-communication-library" "78433e184af02d01f25b6b6fc355492a4e0a93cc"
 github "realm/realm-cocoa" "v4.4.1"
 github "rechsteiner/Parchment" "v1.7.0"

+ 12 - 12
Nextcloud.xcodeproj/project.pbxproj

@@ -14,6 +14,9 @@
 		2C33C48623E2C475005F963B /* Notification Service Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 2C33C47F23E2C475005F963B /* Notification Service Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
 		2CB7D1CA23E2EDCB00376EF9 /* NCPushNotificationEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */; };
 		3704EB2A23D5A58400455C5B /* NCMenu.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3704EB2923D5A58400455C5B /* NCMenu.storyboard */; };
+		370D26AD248A3BB800121797 /* CCCellMainTransfer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370D26AC248A3BB800121797 /* CCCellMainTransfer.swift */; };
+		370D26AF248A3D7A00121797 /* NCImageCellProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370D26AE248A3D7A00121797 /* NCImageCellProtocol.swift */; };
+		370D26B1248A3E1A00121797 /* CCCellMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370D26B0248A3E1A00121797 /* CCCellMain.swift */; };
 		371B5A2E23D0B04500FAFAE9 /* NCMainMenuTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 371B5A2D23D0B04500FAFAE9 /* NCMainMenuTableViewController.swift */; };
 		371B5A3323D0BD5500FAFAE9 /* FloatingPanel.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 371B5A3223D0BD5500FAFAE9 /* FloatingPanel.framework */; };
 		3757A35523D9D76300EC369E /* NCMenuPanelController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3757A35423D9D76300EC369E /* NCMenuPanelController.swift */; };
@@ -237,10 +240,8 @@
 		F77B0E4F1D118A16002130FE /* CCManageAutoUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = F7ACE42F1BAC0268006C0017 /* CCManageAutoUpload.m */; };
 		F77B0E5F1D118A16002130FE /* CCSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = F7ACE4311BAC0268006C0017 /* CCSettings.m */; };
 		F77B0E8F1D118A16002130FE /* CCSection.m in Sources */ = {isa = PBXBuildFile; fileRef = F78F6FAF1CC8CCB700F4EA25 /* CCSection.m */; };
-		F77B0E921D118A16002130FE /* CCCellMainTransfer.m in Sources */ = {isa = PBXBuildFile; fileRef = F70211F81BAC56E9003FC03E /* CCCellMainTransfer.m */; };
 		F77B0E981D118A16002130FE /* CCManageAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = F7ACE42D1BAC0268006C0017 /* CCManageAccount.m */; };
 		F77B0EA61D118A16002130FE /* NSString+TruncateToWidth.m in Sources */ = {isa = PBXBuildFile; fileRef = F73049B91CB567F000C7C320 /* NSString+TruncateToWidth.m */; };
-		F77B0EC61D118A16002130FE /* CCCellMain.m in Sources */ = {isa = PBXBuildFile; fileRef = F70211F51BAC56E9003FC03E /* CCCellMain.m */; };
 		F77B0ED11D118A16002130FE /* Acknowledgements.m in Sources */ = {isa = PBXBuildFile; fileRef = F7ACE42A1BAC0268006C0017 /* Acknowledgements.m */; };
 		F77B0ED51D118A16002130FE /* PHAsset+Utility.m in Sources */ = {isa = PBXBuildFile; fileRef = F777F0311C29717F00CE81CB /* PHAsset+Utility.m */; };
 		F77B0ED91D118A16002130FE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F67BAD1A24D27800EE80DA /* main.m */; };
@@ -405,6 +406,9 @@
 		2C33C48123E2C475005F963B /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
 		2C33C48A23E2CC26005F963B /* Notification_Service_Extension-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Notification_Service_Extension-Bridging-Header.h"; sourceTree = "<group>"; };
 		3704EB2923D5A58400455C5B /* NCMenu.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCMenu.storyboard; sourceTree = "<group>"; };
+		370D26AC248A3BB800121797 /* CCCellMainTransfer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CCCellMainTransfer.swift; sourceTree = "<group>"; };
+		370D26AE248A3D7A00121797 /* NCImageCellProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCImageCellProtocol.swift; sourceTree = "<group>"; };
+		370D26B0248A3E1A00121797 /* CCCellMain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CCCellMain.swift; sourceTree = "<group>"; };
 		371B5A2D23D0B04500FAFAE9 /* NCMainMenuTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMainMenuTableViewController.swift; sourceTree = "<group>"; };
 		371B5A3223D0BD5500FAFAE9 /* FloatingPanel.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FloatingPanel.framework; path = Carthage/Build/iOS/FloatingPanel.framework; sourceTree = "<group>"; };
 		3757A35423D9D76300EC369E /* NCMenuPanelController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMenuPanelController.swift; sourceTree = "<group>"; };
@@ -421,10 +425,7 @@
 		F700510222DF6897003A3356 /* Parchment.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Parchment.framework; path = Carthage/Build/iOS/Parchment.framework; sourceTree = "<group>"; };
 		F700510422DF6A89003A3356 /* NCShare.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShare.swift; sourceTree = "<group>"; };
 		F7020FCD2233D7F700B7297D /* NCCreateFormUploadVoiceNote.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadVoiceNote.swift; sourceTree = "<group>"; };
-		F70211F51BAC56E9003FC03E /* CCCellMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCCellMain.m; sourceTree = "<group>"; };
 		F70211F61BAC56E9003FC03E /* CCCellMain.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CCCellMain.xib; sourceTree = "<group>"; };
-		F70211F71BAC56E9003FC03E /* CCCellMainTransfer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCellMainTransfer.h; sourceTree = "<group>"; };
-		F70211F81BAC56E9003FC03E /* CCCellMainTransfer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCCellMainTransfer.m; sourceTree = "<group>"; };
 		F70211F91BAC56E9003FC03E /* CCCellMainTransfer.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CCCellMainTransfer.xib; sourceTree = "<group>"; };
 		F70211FA1BAC56E9003FC03E /* CCMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMain.h; sourceTree = "<group>"; };
 		F70211FB1BAC56E9003FC03E /* CCMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CCMain.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
@@ -832,7 +833,6 @@
 		F7FCFFD61D70798C000E6E29 /* CCPeekPop.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = CCPeekPop.storyboard; sourceTree = "<group>"; };
 		F7FCFFDD1D707B83000E6E29 /* CCPeekPop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPeekPop.h; sourceTree = "<group>"; };
 		F7FCFFDE1D707B83000E6E29 /* CCPeekPop.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPeekPop.m; sourceTree = "<group>"; };
-		F7FFEACE1F82BB23005E5C17 /* CCCellMain.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCCellMain.h; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -1223,13 +1223,12 @@
 		F78ACD3E21903BA20088454D /* Cell */ = {
 			isa = PBXGroup;
 			children = (
-				F7FFEACE1F82BB23005E5C17 /* CCCellMain.h */,
-				F70211F51BAC56E9003FC03E /* CCCellMain.m */,
+				370D26B0248A3E1A00121797 /* CCCellMain.swift */,
 				F70211F61BAC56E9003FC03E /* CCCellMain.xib */,
-				F70211F71BAC56E9003FC03E /* CCCellMainTransfer.h */,
-				F70211F81BAC56E9003FC03E /* CCCellMainTransfer.m */,
+				370D26AC248A3BB800121797 /* CCCellMainTransfer.swift */,
 				F70211F91BAC56E9003FC03E /* CCCellMainTransfer.xib */,
 				F78ACD3F21903CC20088454D /* NCGridCell.swift */,
+				370D26AE248A3D7A00121797 /* NCImageCellProtocol.swift */,
 				F78ACD4521903D010088454D /* NCGridCell.xib */,
 				F77444F322281649000D5EB0 /* NCGridMediaCell.swift */,
 				F77444F422281649000D5EB0 /* NCGridMediaCell.xib */,
@@ -2227,6 +2226,7 @@
 				F7E09CE323E3088000FB3E9E /* NCMainRefreshControl.swift in Sources */,
 				F77B0DF41D118A16002130FE /* CCMain.m in Sources */,
 				F7AE00F8230E81CB007ACF8A /* NCBrowserWeb.swift in Sources */,
+				370D26AF248A3D7A00121797 /* NCImageCellProtocol.swift in Sources */,
 				F7E9C41B20F4CA870040CF18 /* CCTransfers.m in Sources */,
 				37C83A0F24532BA600618A3B /* CCMain+Swift.swift in Sources */,
 				F77B0DF51D118A16002130FE /* CCUtility.m in Sources */,
@@ -2236,6 +2236,7 @@
 				F710D1FE24057E5E00A6033D /* NCActionSheetHeader.swift in Sources */,
 				F77B0DFF1D118A16002130FE /* OCNetworking.m in Sources */,
 				F790110E21415BF600D7B136 /* NCViewerRichdocument.swift in Sources */,
+				370D26AD248A3BB800121797 /* CCCellMainTransfer.swift in Sources */,
 				F78ACD4021903CC20088454D /* NCGridCell.swift in Sources */,
 				37ECC83B23D0C7410082EFA2 /* NCMenuAction.swift in Sources */,
 				F75B0ABD244C4DBB00E58DCA /* NCNetworkingNotificationCenter.swift in Sources */,
@@ -2331,7 +2332,6 @@
 				F769454422E9F142000A798A /* NCShareUserMenuView.swift in Sources */,
 				F77B0E8F1D118A16002130FE /* CCSection.m in Sources */,
 				F7CA1ED720E7E3FE002CC65E /* PKDownloadButton.m in Sources */,
-				F77B0E921D118A16002130FE /* CCCellMainTransfer.m in Sources */,
 				F77B0E981D118A16002130FE /* CCManageAccount.m in Sources */,
 				F755BD9B20594AC7008C5FBB /* NCService.swift in Sources */,
 				F711CCD2246AC99E0009B204 /* OCHTTPRequestOperation.m in Sources */,
@@ -2364,12 +2364,12 @@
 				F7A321551E9E2A070069AD1B /* CCFavorites.m in Sources */,
 				F711CCCA246AC99E0009B204 /* NCXMLGetAppPasswordParser.m in Sources */,
 				F704FA5C232A343F00BBA952 /* IMImagemeterViewer.swift in Sources */,
+				370D26B1248A3E1A00121797 /* CCCellMain.swift in Sources */,
 				F711CCDA246AC99E0009B204 /* OCActivity.m in Sources */,
 				F7CA1ED220E7E3FE002CC65E /* PKCircleView.m in Sources */,
 				F745B253222D88AE00346520 /* NCLoginQRCode.swift in Sources */,
 				F7169A1C1EE590930086BD69 /* NCShares.m in Sources */,
 				F769454822E9F20D000A798A /* NCShareNetworking.swift in Sources */,
-				F77B0EC61D118A16002130FE /* CCCellMain.m in Sources */,
 				F7C9555521F0C5470024296E /* NCActivity.swift in Sources */,
 				F711CCD0246AC99E0009B204 /* OCXMLServerErrorsParser.m in Sources */,
 				F7CA1ED820E7E3FE002CC65E /* PKBorderedButton.m in Sources */,

+ 10 - 12
iOSClient/Activity/NCActivity.storyboard

@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="nhT-TJ-YvX">
-    <device id="retina5_9" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="nhT-TJ-YvX">
+    <device id="retina5_9" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -13,24 +11,24 @@
         <!--Activity-->
         <scene sceneID="bVi-HG-3eX">
             <objects>
-                <viewController storyboardIdentifier="NCActivity.storyboard" id="nhT-TJ-YvX" customClass="NCActivity" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="NCActivity.storyboard" extendedLayoutIncludesOpaqueBars="YES" id="nhT-TJ-YvX" customClass="NCActivity" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="vOO-VC-ekK">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="20" sectionFooterHeight="1" translatesAutoresizingMaskIntoConstraints="NO" id="X49-xg-JXO">
-                                <rect key="frame" x="0.0" y="44" width="375" height="734"/>
+                                <rect key="frame" x="0.0" y="44" width="375" height="768"/>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <prototypes>
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="tableCell" rowHeight="120" id="ggj-aE-fnh" customClass="activityTableViewCell" customModule="Nextcloud" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="20" width="375" height="120"/>
+                                        <rect key="frame" x="0.0" y="28" width="375" height="120"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="ggj-aE-fnh" id="i35-U4-bEk">
-                                            <rect key="frame" x="0.0" y="0.0" width="375" height="119.66666666666667"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="120"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fcO-YL-MuT">
-                                                    <rect key="frame" x="88" y="5.0000000000000018" width="277" height="24.666666666666671"/>
+                                                    <rect key="frame" x="88" y="5" width="277" height="25"/>
                                                     <fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -58,7 +56,7 @@
                                                     </constraints>
                                                 </imageView>
                                                 <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="KpO-no-BMl">
-                                                    <rect key="frame" x="50" y="39.666666666666657" width="325" height="60"/>
+                                                    <rect key="frame" x="50" y="40" width="325" height="60"/>
                                                     <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="60" id="deQ-wc-jNT" userLabel="height = 60"/>
@@ -127,8 +125,8 @@
                         <constraints>
                             <constraint firstItem="USa-eR-a1s" firstAttribute="trailing" secondItem="X49-xg-JXO" secondAttribute="trailing" id="5we-Fh-GVu"/>
                             <constraint firstItem="X49-xg-JXO" firstAttribute="top" secondItem="USa-eR-a1s" secondAttribute="top" id="SfR-9z-HeQ"/>
+                            <constraint firstAttribute="bottom" secondItem="X49-xg-JXO" secondAttribute="bottom" id="aHq-g4-dUG"/>
                             <constraint firstItem="X49-xg-JXO" firstAttribute="leading" secondItem="USa-eR-a1s" secondAttribute="leading" id="pfF-ag-f7x"/>
-                            <constraint firstItem="USa-eR-a1s" firstAttribute="bottom" secondItem="X49-xg-JXO" secondAttribute="bottom" id="yw8-JS-Pfi"/>
                         </constraints>
                         <viewLayoutGuide key="safeArea" id="USa-eR-a1s"/>
                     </view>

+ 0 - 2
iOSClient/Favorites/CCFavorites.h

@@ -24,8 +24,6 @@
 #import <UIKit/UIKit.h>
 #import <DZNEmptyDataSet/UIScrollView+EmptyDataSet.h>
 
-#import "CCCellMain.h"
-#import "CCCellMainTransfer.h"
 #import "CCUtility.h"
 #import "CCMain.h"
 #import "CCGraphics.h"

+ 1 - 1
iOSClient/Main/AppDelegate+Swift.swift

@@ -27,7 +27,7 @@ extension AppDelegate {
             navBarAppearance.configureWithOpaqueBackground()
             
             navBarAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
-            navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+            navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.tabBar
 
             viewController.navigationController?.navigationBar.standardAppearance = navBarAppearance
         } else {

+ 5 - 2
iOSClient/Main/CCMain+Swift.swift

@@ -18,8 +18,10 @@ extension CCMain {
                 navBarAppearance.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
                 navBarAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
                 navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.backgroundView
-                self.navigationController?.navigationBar.standardAppearance = navBarAppearance
                 self.navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance
+                navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.tabBar
+                self.navigationController?.navigationBar.standardAppearance = navBarAppearance
+
             } else {
                 self.navigationController?.navigationBar.barStyle = .default
                 self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
@@ -40,8 +42,9 @@ extension CCMain {
                 navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.backgroundView
                 navBarAppearance.shadowColor = .clear
                 navBarAppearance.shadowImage = UIImage()
-                self.navigationController?.navigationBar.standardAppearance = navBarAppearance
                 self.navigationController?.navigationBar.scrollEdgeAppearance = navBarAppearance
+                navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.tabBar
+                self.navigationController?.navigationBar.standardAppearance = navBarAppearance
             } else {
                 self.navigationController?.navigationBar.barStyle = .default
                 self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]

+ 0 - 2
iOSClient/Main/CCMain.h

@@ -29,8 +29,6 @@
 
 #import "NSString+TruncateToWidth.h"
 #import "CCLogin.h"
-#import "CCCellMain.h"
-#import "CCCellMainTransfer.h"
 #import "CCGraphics.h"
 #import "CCSection.h"
 #import "CCUtility.h"

+ 3 - 3
iOSClient/Main/CCMore.swift

@@ -183,9 +183,9 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
     }
 
     @objc func changeTheming() {
-        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: false)
+        appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: true)
 
-        viewQuota.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        viewQuota.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
         progressQuota.progressTintColor = NCBrandColor.sharedInstance.brandElement
     }
 
@@ -271,7 +271,7 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         let selectionColor: UIView = UIView()
         selectionColor.backgroundColor = NCBrandColor.sharedInstance.select
         cell.selectedBackgroundView = selectionColor
-        cell.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        cell.backgroundColor = NCBrandColor.sharedInstance.backgroundCell
         cell.accessoryType = UITableViewCell.AccessoryType.disclosureIndicator
 
         if (indexPath.section == 0) {

+ 0 - 43
iOSClient/Main/Cell/CCCellMain.h

@@ -1,43 +0,0 @@
-//
-//  CCCellMain.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 05/05/15.
-//  Copyright (c) 2015 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <UIKit/UIKit.h>
-#import <MGSwipeTableCell/MGSwipeTableCell.h>
-
-@interface CCCellMain : MGSwipeTableCell
-
-@property(nonatomic, weak) IBOutlet UIImageView *file;
-@property(nonatomic, weak) IBOutlet UIImageView *status;
-@property(nonatomic, weak) IBOutlet UIImageView *favorite;
-@property(nonatomic, weak) IBOutlet UIImageView *local;
-@property(nonatomic, weak) IBOutlet UIImageView *comment;
-@property(nonatomic, weak) IBOutlet UIImageView *shared;
-@property(nonatomic, weak) IBOutlet UIView *viewShared;
-@property(nonatomic, weak) IBOutlet UIImageView *more;
-@property(nonatomic, weak) IBOutlet UILabel *labelTitle;
-@property(nonatomic, weak) IBOutlet UILabel *labelInfoFile;
-
-
-@property(nonatomic, weak) IBOutlet NSLayoutConstraint *labelTitleTrailingConstraint;
-
-@end

+ 0 - 47
iOSClient/Main/Cell/CCCellMain.m

@@ -1,47 +0,0 @@
-//
-//  CCCellMain.m
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 05/05/15.
-//  Copyright (c) 2015 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCCellMain.h"
-#import "NCBridgeSwift.h"
-
-@implementation CCCellMain
-
-- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
-{
-    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
-    if (self) {
-        // Initialization code
-        
-    }
-    return self;
-}
-
-- (void)setSelected:(BOOL)selected animated:(BOOL)animated
-{
-    [super setSelected:selected animated:animated];
-
-    // Configure the view for the selected state
-    self.contentView.preservesSuperviewLayoutMargins = NO;
-}
-
-@end

+ 74 - 0
iOSClient/Main/Cell/CCCellMain.swift

@@ -0,0 +1,74 @@
+//
+//  CCCellMain.swift
+//  Nextcloud
+//
+//  Created by Philippe Weidmann on 05.06.20.
+//  Copyright © 2020 Marino Faggiana. All rights reserved.
+//
+
+import UIKit
+import MGSwipeTableCell
+
+class CCCellMain: MGSwipeTableCell, NCImageCellProtocol {
+
+    @IBOutlet weak var file: UIImageView!
+    @IBOutlet weak var status: UIImageView!
+    @IBOutlet weak var favorite: UIImageView!
+    @IBOutlet weak var local: UIImageView!
+    @IBOutlet weak var comment: UIImageView!
+    @IBOutlet weak var shared: UIImageView!
+    @IBOutlet weak var viewShared: UIView!
+    @IBOutlet weak var more: UIImageView!
+    @IBOutlet weak var labelTitle: UILabel!
+    @IBOutlet weak var labelInfoFile: UILabel!
+
+    @IBOutlet weak var labelTitleTrailingConstraint: NSLayoutConstraint!
+
+    var filePreviewImageView : UIImageView {
+        get{
+         return file
+        }
+    }
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        self.initCell()
+    }
+    
+    override func prepareForReuse() {
+        super.prepareForReuse()
+        self.initCell()
+    }
+
+    override func setSelected(_ selected: Bool, animated: Bool) {
+        super.setSelected(selected, animated: animated)
+
+        self.contentView.preservesSuperviewLayoutMargins = false
+    }
+    
+    func initCell() {
+        separatorInset = UIEdgeInsets.init(top: 0, left: 60, bottom: 0, right: 0)
+        accessoryType = UITableViewCell.AccessoryType.none
+        file.image = nil
+        file.layer.cornerRadius = 6
+        file.layer.masksToBounds = true
+        status.image = nil
+        favorite.image = nil
+        shared.image = nil
+        local.image = nil
+        comment.image = nil
+        shared.isUserInteractionEnabled = false
+        backgroundColor = NCBrandColor.sharedInstance.backgroundView
+        
+        // change color selection
+        let selectionColor = UIView()
+        selectionColor.backgroundColor = NCBrandColor.sharedInstance.select
+        selectedBackgroundView = selectionColor
+        tintColor = NCBrandColor.sharedInstance.brandElement
+        
+        labelTitle.textColor = NCBrandColor.sharedInstance.textView
+        
+        file.backgroundColor = nil
+    }
+
+}

+ 1 - 1
iOSClient/Main/Cell/CCCellMain.xib

@@ -9,7 +9,7 @@
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CustomCellFileAndDirectory"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="0.0" reuseIdentifier="CellMain" id="2" customClass="CCCellMain">
+        <tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="0.0" reuseIdentifier="CellMain" id="2" customClass="CCCellMain" customModule="Nextcloud" customModuleProvider="target">
             <rect key="frame" x="0.0" y="0.0" width="600" height="60"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2" id="sQq-jC-UEV">

+ 0 - 38
iOSClient/Main/Cell/CCCellMainTransfer.h

@@ -1,38 +0,0 @@
-//
-//  CCCellMainTransfer.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 05/05/15.
-//  Copyright (c) 2015 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <UIKit/UIKit.h>
-#import "PKDownloadButton.h"
-
-@interface CCCellMainTransfer : UITableViewCell
-
-@property(nonatomic, weak) IBOutlet UIImageView *file;
-@property(nonatomic, weak) IBOutlet UIImageView *status;
-@property(nonatomic, weak) IBOutlet UIImageView *user;
-
-@property(nonatomic, weak) IBOutlet UILabel *labelTitle;
-@property(nonatomic, weak) IBOutlet UILabel *labelInfoFile;
-
-@property(nonatomic, weak) IBOutlet PKStopDownloadButton *transferButton;
-
-@end

+ 0 - 38
iOSClient/Main/Cell/CCCellMainTransfer.m

@@ -1,38 +0,0 @@
-//
-//  CCCellMainTransfer.m
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 05/05/15.
-//  Copyright (c) 2015 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCCellMainTransfer.h"
-
-@implementation CCCellMainTransfer
-
-- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
-{
-    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
-    if (self) {
-        // Initialization code
-        
-    }
-    return self;
-}
-
-@end

+ 55 - 0
iOSClient/Main/Cell/CCCellMainTransfer.swift

@@ -0,0 +1,55 @@
+//
+//  CCCellMainTransfer.swift
+//  Nextcloud
+//
+//  Created by Philippe Weidmann on 05.06.20.
+//  Copyright © 2020 Marino Faggiana. All rights reserved.
+//
+
+import UIKit
+
+class CCCellMainTransfer: UITableViewCell, NCImageCellProtocol {
+
+    @IBOutlet weak var file: UIImageView!
+    @IBOutlet weak var status: UIImageView!
+    @IBOutlet weak var user: UIImageView!
+
+    @IBOutlet weak var labelTitle: UILabel!
+    @IBOutlet weak var labelInfoFile: UILabel!
+
+    @IBOutlet weak var transferButton: PKStopDownloadButton!
+
+    var filePreviewImageView: UIImageView {
+        get {
+            return file
+        }
+    }
+
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        self.initCell()
+    }
+
+    override func prepareForReuse() {
+        super.prepareForReuse()
+        self.initCell()
+    }
+
+    func initCell() {
+        separatorInset = UIEdgeInsets.init(top: 0, left: 60, bottom: 0, right: 0)
+        accessoryType = UITableViewCell.AccessoryType.none
+        file.image = nil
+        file.layer.cornerRadius = 6
+        file.layer.masksToBounds = true
+        status.image = nil
+        user.image = nil
+        backgroundColor = NCBrandColor.sharedInstance.backgroundView
+
+        labelTitle.textColor = NCBrandColor.sharedInstance.textView
+        transferButton.tintColor = NCBrandColor.sharedInstance.optionItem
+        labelTitle.isEnabled = true
+        labelInfoFile.isEnabled = true
+        file.backgroundColor = nil
+    }
+
+}

+ 6 - 8
iOSClient/Main/Cell/CCCellMainTransfer.xib

@@ -1,21 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CustomCellFileAndDirectory"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="0.0" reuseIdentifier="CellMainTransfer" id="2" customClass="CCCellMainTransfer">
+        <tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="0.0" reuseIdentifier="CellMainTransfer" id="2" customClass="CCCellMainTransfer" customModule="Nextcloud" customModuleProvider="target">
             <rect key="frame" x="0.0" y="0.0" width="600" height="60"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2" id="sQq-jC-UEV">
-                <rect key="frame" x="0.0" y="0.0" width="600" height="59.5"/>
+                <rect key="frame" x="0.0" y="0.0" width="600" height="60"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QNC-8X-DAC" userLabel="labelTitle">
@@ -25,7 +23,7 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" tag="102" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p7I-KN-FVZ" userLabel="labelInfoFile">
-                        <rect key="frame" x="65" y="31" width="484" height="15"/>
+                        <rect key="frame" x="65" y="31.5" width="484" height="15"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.63921568627450975" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>

+ 13 - 1
iOSClient/Main/Cell/NCGridCell.swift

@@ -24,7 +24,7 @@
 import Foundation
 import UIKit
 
-class NCGridCell: UICollectionViewCell {
+class NCGridCell: UICollectionViewCell, NCImageCellProtocol {
     
     @IBOutlet weak var imageItem: UIImageView!
     
@@ -36,6 +36,13 @@ class NCGridCell: UICollectionViewCell {
     @IBOutlet weak var labelTitle: UILabel!
     @IBOutlet weak var buttonMore: UIButton!
 
+    var filePreviewImageView : UIImageView {
+        get{
+         return imageItem
+        }
+    }
+
+    
     var delegate: NCGridCellDelegate?
     
     var objectId = ""
@@ -47,6 +54,11 @@ class NCGridCell: UICollectionViewCell {
         buttonMore.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "more"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem), for: UIControl.State.normal)
     }
     
+    override func prepareForReuse() {
+        super.prepareForReuse()
+        imageItem.backgroundColor = nil
+    }
+    
     @IBAction func touchUpInsideMore(_ sender: Any) {
         delegate?.tapMoreGridItem(with: objectId, sender: sender)
     }

+ 15 - 7
iOSClient/Main/Cell/NCGridMediaCell.swift

@@ -24,19 +24,27 @@
 import Foundation
 import UIKit
 
-class NCGridMediaCell: UICollectionViewCell {
-    
+class NCGridMediaCell: UICollectionViewCell, NCImageCellProtocol {
+
     @IBOutlet weak var imageItem: UIImageView!
-    
+
     @IBOutlet weak var imageVisualEffect: UIVisualEffectView!
-    
+
     @IBOutlet weak var imageSelect: UIImageView!
     @IBOutlet weak var imageStatus: UIImageView!
     @IBOutlet weak var imageFavorite: UIImageView!
     @IBOutlet weak var imageLocal: UIImageView!
-    
-    override func awakeFromNib() {
-        super.awakeFromNib()
+
+    var filePreviewImageView: UIImageView {
+        get {
+            return imageItem
+        }
+    }
+
+    override func prepareForReuse() {
+        super.prepareForReuse()
+        imageItem.image = nil
+        imageItem.backgroundColor = UIColor.lightGray
     }
 }
 

+ 13 - 0
iOSClient/Main/Cell/NCImageCellProtocol.swift

@@ -0,0 +1,13 @@
+//
+//  NCImageCellProtocol.swift
+//  Nextcloud
+//
+//  Created by Philippe Weidmann on 05.06.20.
+//  Copyright © 2020 Marino Faggiana. All rights reserved.
+//
+
+import Foundation
+
+protocol NCImageCellProtocol {
+    var filePreviewImageView: UIImageView {get}
+}

+ 12 - 1
iOSClient/Main/Cell/NCListCell.swift

@@ -24,7 +24,7 @@
 import Foundation
 import UIKit
 
-class NCListCell: UICollectionViewCell {
+class NCListCell: UICollectionViewCell, NCImageCellProtocol {
     
     @IBOutlet weak var imageItem: UIImageView!
     @IBOutlet weak var imageItemLeftConstraint: NSLayoutConstraint!
@@ -45,6 +45,12 @@ class NCListCell: UICollectionViewCell {
     @IBOutlet weak var buttonMore: UIButton!
     
     @IBOutlet weak var separator: UIView!
+    
+    var filePreviewImageView : UIImageView {
+        get{
+         return imageItem
+        }
+    }
 
     var delegate: NCListCellDelegate?
     
@@ -59,6 +65,11 @@ class NCListCell: UICollectionViewCell {
         separator.backgroundColor = NCBrandColor.sharedInstance.separator
     }
     
+    override func prepareForReuse() {
+        super.prepareForReuse()
+        imageItem.backgroundColor = nil
+    }
+    
     @IBAction func touchUpInsideShare(_ sender: Any) {
         delegate?.tapShareListItem(with: objectId, sender: sender)
     }

+ 24 - 6
iOSClient/Main/Layout/NCLayout.swift

@@ -111,8 +111,9 @@ class NCGridLayout: UICollectionViewFlowLayout {
 
 class NCGridMediaLayout: UICollectionViewFlowLayout {
     
-    var preferenceWidth: CGFloat = 110
-    var marginLeftRight: CGFloat = 1
+    var increasing = true
+    var itemPerLine: CGFloat = 3
+    var marginLeftRight: CGFloat = 6
     var numItems: Int = 0
     
     override init() {
@@ -120,8 +121,8 @@ class NCGridMediaLayout: UICollectionViewFlowLayout {
         
         sectionHeadersPinToVisibleBounds = false
         
-        minimumInteritemSpacing = 1
-        minimumLineSpacing = 1
+        minimumInteritemSpacing = 0
+        minimumLineSpacing = marginLeftRight
         
         self.scrollDirection = .vertical
         self.sectionInset = UIEdgeInsets(top: 0, left: marginLeftRight, bottom: 0, right:  marginLeftRight)
@@ -135,9 +136,9 @@ class NCGridMediaLayout: UICollectionViewFlowLayout {
         get {
             if let collectionView = collectionView {
                 
-                self.numItems = Int(collectionView.frame.width / preferenceWidth)
-                let itemWidth: CGFloat = (collectionView.frame.width - (marginLeftRight * 2) - CGFloat(numItems)) / CGFloat(numItems)
+                let itemWidth: CGFloat = (collectionView.frame.width - marginLeftRight * 2 - marginLeftRight * (itemPerLine - 1)) / itemPerLine
                 let itemHeight: CGFloat = itemWidth
+                
                 return CGSize(width: itemWidth, height: itemHeight)
             }
             
@@ -153,3 +154,20 @@ class NCGridMediaLayout: UICollectionViewFlowLayout {
         return proposedContentOffset
     }
 }
+extension UICollectionView {
+
+var centerPoint : CGPoint {
+
+    get {
+        return CGPoint(x: self.center.x + self.contentOffset.x, y: self.center.y + self.contentOffset.y);
+    }
+}
+
+var centerCellIndexPath: IndexPath? {
+
+    if let centerIndexPath: IndexPath  = self.indexPathForItem(at: self.centerPoint) {
+        return centerIndexPath
+    }
+    return nil
+}
+}

+ 11 - 10
iOSClient/Main/Main.storyboard

@@ -479,17 +479,18 @@
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="50" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="aKC-5k-tLM">
-                                <rect key="frame" x="0.0" y="88" width="414" height="649"/>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" rowHeight="50" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="aKC-5k-tLM">
+                                <rect key="frame" x="0.0" y="88" width="414" height="643"/>
+                                <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
                                 <inset key="separatorInset" minX="56" minY="0.0" maxX="0.0" maxY="0.0"/>
                                 <view key="tableFooterView" contentMode="scaleToFill" id="xPg-6F-Qcc">
-                                    <rect key="frame" x="0.0" y="106" width="414" height="44"/>
+                                    <rect key="frame" x="0.0" y="123.5" width="414" height="44"/>
                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                     <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 </view>
                                 <prototypes>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" rowHeight="50" id="V1G-2M-Q0I" customClass="CCCellMore" customModule="Nextcloud" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="28" width="414" height="50"/>
+                                        <rect key="frame" x="0.0" y="55.5" width="414" height="50"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" multipleTouchEnabled="YES" contentMode="center" tableViewCell="V1G-2M-Q0I" id="mMB-QG-hoe">
                                             <rect key="frame" x="0.0" y="0.0" width="414" height="50"/>
@@ -529,10 +530,10 @@
                                 </connections>
                             </tableView>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="J2k-UZ-XQQ" userLabel="View Quota">
-                                <rect key="frame" x="0.0" y="737" width="414" height="60"/>
+                                <rect key="frame" x="0.0" y="731" width="414" height="66"/>
                                 <subviews>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DAP-np-Q1J">
-                                        <rect key="frame" x="35" y="2" width="344" height="20"/>
+                                        <rect key="frame" x="35" y="8" width="344" height="20"/>
                                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="o78-Yq-dPq"/>
@@ -542,10 +543,10 @@
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="uGf-Fa-QQ3">
-                                        <rect key="frame" x="35" y="25" width="344" height="2"/>
+                                        <rect key="frame" x="35" y="31" width="344" height="2"/>
                                     </progressView>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vfl-ZC-XFd">
-                                        <rect key="frame" x="35" y="29" width="344" height="20"/>
+                                        <rect key="frame" x="35" y="35" width="344" height="20"/>
                                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="B11-kS-b2d"/>
@@ -557,13 +558,13 @@
                                 </subviews>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <constraints>
-                                    <constraint firstAttribute="height" constant="60" id="Cch-sg-vfH"/>
+                                    <constraint firstAttribute="height" constant="66" id="Cch-sg-vfH"/>
                                     <constraint firstItem="uGf-Fa-QQ3" firstAttribute="top" secondItem="DAP-np-Q1J" secondAttribute="bottom" constant="3" id="DmS-I9-ex2"/>
                                     <constraint firstItem="vfl-ZC-XFd" firstAttribute="leading" secondItem="J2k-UZ-XQQ" secondAttribute="leading" constant="35" id="F1b-zE-5hN"/>
                                     <constraint firstAttribute="trailing" secondItem="DAP-np-Q1J" secondAttribute="trailing" constant="35" id="KIR-Gg-7ty"/>
                                     <constraint firstItem="DAP-np-Q1J" firstAttribute="leading" secondItem="J2k-UZ-XQQ" secondAttribute="leading" constant="35" id="MWW-b2-p9J"/>
                                     <constraint firstItem="vfl-ZC-XFd" firstAttribute="top" secondItem="uGf-Fa-QQ3" secondAttribute="bottom" constant="2" id="Tbu-4L-brV"/>
-                                    <constraint firstItem="DAP-np-Q1J" firstAttribute="top" secondItem="J2k-UZ-XQQ" secondAttribute="top" constant="2" id="jKE-pS-hcH"/>
+                                    <constraint firstItem="DAP-np-Q1J" firstAttribute="top" secondItem="J2k-UZ-XQQ" secondAttribute="top" constant="8" id="jKE-pS-hcH"/>
                                     <constraint firstAttribute="trailing" secondItem="vfl-ZC-XFd" secondAttribute="trailing" constant="35" id="q1x-Mf-7lg"/>
                                     <constraint firstAttribute="trailing" secondItem="uGf-Fa-QQ3" secondAttribute="trailing" constant="35" id="toK-Xd-ifL"/>
                                     <constraint firstItem="uGf-Fa-QQ3" firstAttribute="leading" secondItem="J2k-UZ-XQQ" secondAttribute="leading" constant="35" id="w2K-Il-yFz"/>

+ 9 - 38
iOSClient/Main/NCMainCommon.swift

@@ -291,7 +291,7 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
                 
                 if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)) {
                     cell.imageItem.image =  UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView))
-                } else {
+                } else if(!metadata.hasPreview) {
                     if metadata.iconName.count > 0 {
                         cell.imageItem.image = UIImage.init(named: metadata.iconName)
                     } else {
@@ -416,7 +416,7 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
                 
                 if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)) {
                     cell.imageItem.image =  UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView))
-                } else {
+                } else if(!metadata.hasPreview) {
                     if metadata.iconName.count > 0 {
                         cell.imageItem.image = UIImage.init(named: metadata.iconName)
                     } else {
@@ -468,25 +468,9 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
             // NORMAL
             
             let cell = tableView.dequeueReusableCell(withIdentifier: "CellMain", for: indexPath) as! CCCellMain
-            cell.separatorInset = UIEdgeInsets.init(top: 0, left: 60, bottom: 0, right: 0)
-            cell.accessoryType = UITableViewCell.AccessoryType.none
-            cell.file.image = nil
-            cell.status.image = nil
-            cell.favorite.image = nil
-            cell.shared.image = nil
-            cell.local.image = nil
-            cell.comment.image = nil
-            cell.shared.isUserInteractionEnabled = false
-            cell.backgroundColor = NCBrandColor.sharedInstance.backgroundView
-            
-            // change color selection
-            let selectionColor = UIView()
-            selectionColor.backgroundColor = NCBrandColor.sharedInstance.select
-            cell.selectedBackgroundView = selectionColor
-            cell.tintColor = NCBrandColor.sharedInstance.brandElement
-            
-            cell.labelTitle.textColor = NCBrandColor.sharedInstance.textView
             cell.labelTitle.text = metadata.fileNameView
+            cell.filePreviewImageView.image = nil
+            cell.filePreviewImageView.backgroundColor = UIColor.lightGray
             
             // Download preview
             NCOperationQueue.shared.downloadThumbnail(metadata: metadata, activeUrl: appDelegate.activeUrl, view: tableView, indexPath: indexPath)
@@ -504,7 +488,7 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
                 
                 // lable Info
                 cell.labelInfoFile.text = CCUtility.dateDiff(metadata.date as Date)
-                
+                cell.file.backgroundColor = nil
                 // File Image & Image Title Segue
                 if metadata.e2eEncrypted {
                     cell.file.image = NCMainCommonImages.cellFolderEncryptedImage
@@ -540,8 +524,10 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
                 
                 // File Image
                 if iconFileExists {
+                    cell.file.backgroundColor = nil
                     cell.file.image =  UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView))
-                } else {
+                } else if(!metadata.hasPreview){
+                    cell.file.backgroundColor = nil
                     if metadata.iconName.count > 0 {
                         cell.file.image = UIImage.init(named: metadata.iconName)
                     } else {
@@ -639,22 +625,7 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
             // TRASNFER
             
             let cell = tableView.dequeueReusableCell(withIdentifier: "CellMainTransfer", for: indexPath) as! CCCellMainTransfer
-            cell.separatorInset = UIEdgeInsets.init(top: 0, left: 60, bottom: 0, right: 0)
-            cell.accessoryType = UITableViewCell.AccessoryType.none
-            cell.file.image = nil
-            cell.status.image = nil
-            cell.user.image = nil
-            
-            cell.backgroundColor = NCBrandColor.sharedInstance.backgroundView
-
             cell.labelTitle.text = metadata.fileNameView
-            cell.labelTitle.textColor = NCBrandColor.sharedInstance.textView
-            
-            cell.transferButton.tintColor = NCBrandColor.sharedInstance.optionItem
-            
-            cell.labelTitle.isEnabled = true
-            cell.labelInfoFile.isEnabled = true
-            
             var progress: CGFloat = 0.0
             var totalBytes: Double = 0.0
             //var totalBytesExpected : Double = 0
@@ -698,7 +669,7 @@ class NCMainCommon: NSObject, NCAudioRecorderViewControllerDelegate, UIDocumentI
 
             if iconFileExists {
                 cell.file.image =  UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView))
-            } else {
+            } else if(!metadata.hasPreview){
                 if metadata.iconName.count > 0 {
                     cell.file.image = UIImage.init(named: metadata.iconName)
                 } else {

+ 24 - 26
iOSClient/Media/NCMedia.swift

@@ -47,6 +47,7 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
     private let footerHeight: CGFloat = 50
     
     private var stepImageWidth: CGFloat = 10
+    private let kMaxImageGrid: CGFloat = 5
     
     private var isDistantPast = false
 
@@ -84,7 +85,7 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
         collectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 50, right: 0);
                 
         gridLayout = NCGridMediaLayout()
-        gridLayout.preferenceWidth = CGFloat(CCUtility.getMediaWidthImage())
+        gridLayout.itemPerLine = CGFloat(min(CCUtility.getMediaWidthImage(), 5))
         gridLayout.sectionHeadersPinToVisibleBounds = true
 
         collectionView.collectionViewLayout = gridLayout
@@ -143,7 +144,6 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
         
         coordinator.animate(alongsideTransition: nil) { _ in
             self.reloadDataThenPerform {
-                self.downloadThumbnail()
             }
         }
     }
@@ -237,29 +237,21 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
     // MARK: IBAction
     
     @objc func touchUpInsideMenuButtonSwitch(_ sender: Any) {
-        
-        let itemSizeStart = self.gridLayout.itemSize
-        
+                
         UIView.animate(withDuration: 0.0, animations: {
-            
-            if self.gridLayout.numItems == 1 && self.stepImageWidth > 0 {
-                self.stepImageWidth = -10
-            } else if itemSizeStart.width < 50 {
-                self.stepImageWidth = 10
+            if(self.gridLayout.itemPerLine + 1 < self.kMaxImageGrid && self.gridLayout.increasing) {
+                self.gridLayout.itemPerLine+=1
+            } else {
+                self.gridLayout.increasing = false
+                self.gridLayout.itemPerLine-=1
+            }
+            if(self.gridLayout.itemPerLine == 0) {
+                self.gridLayout.increasing = true
+                self.gridLayout.itemPerLine = 2
             }
             
-            repeat {
-                self.gridLayout.preferenceWidth = self.gridLayout.preferenceWidth + self.stepImageWidth
-            } while (self.gridLayout.itemSize == itemSizeStart)
-            
-            CCUtility.setMediaWidthImage(Int(self.gridLayout?.preferenceWidth ?? 80))
             self.collectionView.collectionViewLayout.invalidateLayout()
-            
-            if self.stepImageWidth < 0 {
-                DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
-                    self.selectSearchSections()
-                }
-            }
+            CCUtility.setMediaWidthImage(Int(self.gridLayout.itemPerLine))
         })
     }
     
@@ -310,7 +302,6 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
                         self.isEditMode = false
                         self.selectocId.removeAll()
                         self.reloadDataThenPerform {
-                            self.downloadThumbnail()
                         }
                     }
                 )
@@ -481,14 +472,22 @@ extension NCMedia: UICollectionViewDataSource {
         }
         
         let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridMediaCell
-                            
+        NCOperationQueue.shared.downloadThumbnail(metadata: metadata, activeUrl: self.appDelegate.activeUrl, view: self.collectionView as Any, indexPath: indexPath)
+        cell.imageItem.backgroundColor = UIColor.lightGray
         cell.imageStatus.image = nil
         cell.imageLocal.image = nil
         cell.imageFavorite.image = nil
+        cell.imageItem.image = nil
+        cell.imageItem.layer.masksToBounds = true
+        cell.imageItem.layer.cornerRadius = 6
+        cell.imageVisualEffect.layer.cornerRadius = 6
+        cell.imageVisualEffect.clipsToBounds = true
                     
         if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)) {
+            cell.imageItem.backgroundColor = nil
             cell.imageItem.image = UIImage.init(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView))
-        } else {
+        } else if(!metadata.hasPreview) {
+            cell.imageItem.backgroundColor = nil
             if metadata.iconName.count > 0 {
                 cell.imageItem.image = UIImage.init(named: metadata.iconName)
             } else {
@@ -676,7 +675,6 @@ extension NCMedia {
                     }
                     
                     self.reloadDataThenPerform {
-                        self.downloadThumbnail()
                     }
                 }
              
@@ -709,7 +707,6 @@ extension NCMedia {
         }
         
         reloadDataThenPerform {
-            self.downloadThumbnail()
         }
     }
     
@@ -756,6 +753,7 @@ extension NCMedia {
             }
         }
     }
+
 }
 
 // MARK: - ScrollView

+ 26 - 25
iOSClient/Networking/NCOperationQueue.swift

@@ -134,39 +134,40 @@ class NCOperationDownloadThumbnail: ConcurrentOperation {
     }
     
     override func start() {
-            
+
         let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, activeUrl: activeUrl)!
         let fileNameLocalPath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
-            
+
         NCCommunication.shared.downloadPreview(fileNamePathOrFileId: fileNamePath, fileNameLocalPath: fileNameLocalPath, width: Int(k_sizePreview), height: Int(k_sizePreview)) { (account, data, errorCode, errorMessage) in
-            
-            if errorCode == 0 && data != nil  {
-                if let image = UIImage.init(data: data!) {
-                    
-                    if self.view is UICollectionView && NCMainCommon.sharedInstance.isValidIndexPath(self.indexPath, view: self.view) {
-                        if let cell = (self.view as! UICollectionView).cellForItem(at: self.indexPath) {
-                            if cell is NCListCell {
-                                (cell as! NCListCell).imageItem.image = image
-                            } else if cell is NCGridCell {
-                                (cell as! NCGridCell).imageItem.image = image
-                            } else if cell is NCGridMediaCell {
-                                (cell as! NCGridMediaCell).imageItem.image = image
-                            }
-                        }
+            var cell: NCImageCellProtocol?
+            if self.view is UICollectionView && NCMainCommon.sharedInstance.isValidIndexPath(self.indexPath, view: self.view) {
+                cell = (self.view as! UICollectionView).cellForItem(at: self.indexPath) as? NCImageCellProtocol
+            } else if self.view is UITableView && NCMainCommon.sharedInstance.isValidIndexPath(self.indexPath, view: self.view) {
+                cell = (self.view as! UITableView).cellForRow(at: self.indexPath) as? NCImageCellProtocol
+            }
+
+            if (cell != nil) {
+                var previewImage: UIImage!
+                if errorCode == 0 && data != nil {
+                    if let image = UIImage(data: data!) {
+                        previewImage = image
                     }
-                    
-                    if self.view is UITableView && CCUtility.fileProviderStorageIconExists(self.metadata.ocId, fileNameView: self.metadata.fileName) && NCMainCommon.sharedInstance.isValidIndexPath(self.indexPath, view: self.view) {
-                        if let cell = (self.view as! UITableView).cellForRow(at: self.indexPath) {
-                            if cell is CCCellMainTransfer {
-                                (cell as! CCCellMainTransfer).file.image = image
-                            } else if cell is CCCellMain {
-                                (cell as! CCCellMain).file.image = image
-                            }
-                        }
+                } else {
+                    if self.metadata.iconName.count > 0 {
+                        previewImage = UIImage(named: self.metadata.iconName)
+                    } else {
+                        previewImage = UIImage(named: "file")
                     }
                 }
+                cell!.filePreviewImageView.backgroundColor = nil
+                UIView.transition(with: cell!.filePreviewImageView,
+                    duration: 0.75,
+                    options: .transitionCrossDissolve,
+                    animations: { cell!.filePreviewImageView.image = previewImage! },
+                    completion: nil)
             }
             self.finish()
+
         }
     }
 }

+ 1 - 1
iOSClient/Nextcloud-Bridging-Header.h

@@ -23,5 +23,5 @@
 #import "NCRichDocumentTemplate.h"
 #import "HCFeatures.h"
 #import "NCComments.h"
-
+#import "PKStopDownloadButton.h"
 #import "NCNetworkingEndToEnd.h"

+ 2 - 2
iOSClient/Notification/NCNotification.storyboard

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="c26-Us-IIn">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="c26-Us-IIn">
     <device id="retina4_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
@@ -10,7 +10,7 @@
         <!--Notification-->
         <scene sceneID="dZP-R1-zZF">
             <objects>
-                <tableViewController storyboardIdentifier="NCNotification.storyboard" id="c26-Us-IIn" customClass="NCNotification" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
+                <tableViewController storyboardIdentifier="NCNotification.storyboard" extendedLayoutIncludesOpaqueBars="YES" id="c26-Us-IIn" customClass="NCNotification" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
                     <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="187" sectionHeaderHeight="28" sectionFooterHeight="28" id="vzh-aE-2MF">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>

+ 4 - 6
iOSClient/Offline/NCOffline.storyboard

@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="EFX-fO-Oip">
-    <device id="retina5_9" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="EFX-fO-Oip">
+    <device id="retina5_9" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -13,7 +11,7 @@
         <!--Offline-->
         <scene sceneID="X4W-6b-l7s">
             <objects>
-                <viewController storyboardIdentifier="NCOffline.storyboard" id="EFX-fO-Oip" customClass="NCOffline" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="NCOffline.storyboard" extendedLayoutIncludesOpaqueBars="YES" id="EFX-fO-Oip" customClass="NCOffline" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="QEs-gO-Cmp">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>

+ 1 - 0
iOSClient/Settings/CCSettings.m

@@ -184,6 +184,7 @@
     [section addFormRow:row];
     
     self.tableView.showsVerticalScrollIndicator = NO;
+    self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 35, 0);
     self.form = form;
 }
 

+ 0 - 1
iOSClient/Synchronize/CCSynchronize.h

@@ -24,7 +24,6 @@
 #import <Foundation/Foundation.h>
 
 #import "CCHud.h"
-#import "CCCellMain.h"
 
 @class tableMetadata;
 

+ 0 - 1
iOSClient/Transfers/CCTransfers.m

@@ -25,7 +25,6 @@
 #import "AppDelegate.h"
 #import "CCMain.h"
 #import "CCSection.h"
-#import "CCCellMainTransfer.h"
 #import "NCBridgeSwift.h"
 
 #define download 1

+ 4 - 6
iOSClient/Trash/NCTrash.storyboard

@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="EFX-fO-Oip">
-    <device id="retina5_9" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="EFX-fO-Oip">
+    <device id="retina5_9" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -13,7 +11,7 @@
         <!--Trash-->
         <scene sceneID="X4W-6b-l7s">
             <objects>
-                <viewController storyboardIdentifier="NCTrash.storyboard" id="EFX-fO-Oip" customClass="NCTrash" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="NCTrash.storyboard" extendedLayoutIncludesOpaqueBars="YES" id="EFX-fO-Oip" customClass="NCTrash" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="QEs-gO-Cmp">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>

+ 15 - 1
iOSClient/Utility/CCUtility.m

@@ -640,7 +640,21 @@
 
 + (BOOL)getDarkMode
 {
-    return [[UICKeyChainStore stringForKey:@"darkMode" service:k_serviceShareKeyChain] boolValue];
+    NSString *sDisable = [UICKeyChainStore stringForKey:@"darkMode" service:k_serviceShareKeyChain];
+    if(!sDisable){
+        if (@available(iOS 13.0, *)) {
+            if ([CCUtility getDarkModeDetect]) {
+                if ([[UITraitCollection currentTraitCollection] userInterfaceStyle] == UIUserInterfaceStyleDark) {
+                    sDisable = @"YES";
+                    [CCUtility setDarkMode:YES];
+                } else {
+                    sDisable = @"NO";
+                    [CCUtility setDarkMode:NO];
+                }
+            }
+        }
+    }
+    return [sDisable boolValue];
 }
 
 + (void)setDarkMode:(BOOL)disable