Browse Source

Merge pull request #2090 from nextcloud/color

Color
Marino Faggiana 2 years ago
parent
commit
d4c83084e6
41 changed files with 672 additions and 1188 deletions
  1. 13 30
      Nextcloud.xcodeproj/project.pbxproj
  2. 3 18
      iOSClient/Account Request/NCAccountRequest.swift
  3. 0 8
      iOSClient/Activity/NCActivity.swift
  4. 0 257
      iOSClient/BackgroundImageColor/NCBackgroundImageColor.storyboard
  5. 0 298
      iOSClient/BackgroundImageColor/NCBackgroundImageColor.swift
  6. 46 19
      iOSClient/Brand/NCBrand.swift
  7. 283 0
      iOSClient/Color/NCColorPicker.storyboard
  8. 185 0
      iOSClient/Color/NCColorPicker.swift
  9. 6 0
      iOSClient/Data/NCDataSource.swift
  10. 1 4
      iOSClient/Data/NCDatabase.swift
  11. 0 72
      iOSClient/Data/NCManageDatabase+Account.swift
  12. 23 18
      iOSClient/Data/NCManageDatabase.swift
  13. 13 0
      iOSClient/Extensions/UIImage+Extensions.swift
  14. 12 0
      iOSClient/Images.xcassets/palette.imageset/Contents.json
  15. 0 0
      iOSClient/Images.xcassets/palette.imageset/palette.svg
  16. 3 12
      iOSClient/Main/AudioRecorder/NCAudioRecorderViewController.swift
  17. 17 108
      iOSClient/Main/Collection Common/NCCollectionViewCommon.swift
  18. 4 39
      iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift
  19. 5 18
      iOSClient/Main/Create cloud/NCCreateFormUploadConflict.swift
  20. 6 20
      iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift
  21. 4 19
      iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift
  22. 4 20
      iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift
  23. 1 39
      iOSClient/Main/NCFunctionCenter.swift
  24. 0 20
      iOSClient/Main/NCMainNavigationController.swift
  25. 20 23
      iOSClient/Menu/NCCollectionViewCommon+Menu.swift
  26. 1 4
      iOSClient/NCGlobal.swift
  27. 1 1
      iOSClient/Networking/NCNetworking.swift
  28. 0 8
      iOSClient/Notification/NCNotification.swift
  29. 1 1
      iOSClient/RichWorkspace/NCViewerRichWorkspace.swift
  30. 3 25
      iOSClient/Select/NCSelect.swift
  31. 0 9
      iOSClient/Share/NCShare.swift
  32. 5 8
      iOSClient/Share/NCSharePaging.swift
  33. 2 2
      iOSClient/Supporting Files/en.lproj/Localizable.strings
  34. 0 7
      iOSClient/Trash/NCTrash.swift
  35. 3 16
      iOSClient/UserStatus/NCUserStatus.swift
  36. 1 1
      iOSClient/Utility/CCUtility.m
  37. 2 19
      iOSClient/Utility/NCUtility.swift
  38. 3 4
      iOSClient/Utility/NCUtilityFileSystem.swift
  39. 0 16
      iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift
  40. 0 24
      iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift
  41. 1 1
      iOSClient/Viewer/NCViewerProviderContextMenu.swift

+ 13 - 30
Nextcloud.xcodeproj/project.pbxproj

@@ -107,8 +107,6 @@
 		F70968A424212C4E00ED60E5 /* NCLivePhoto.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70968A324212C4E00ED60E5 /* NCLivePhoto.swift */; };
 		F70A58BE24D0349500DED00D /* NCCapabilitiesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70A58BD24D0349500DED00D /* NCCapabilitiesViewController.swift */; };
 		F70A58C024D0545100DED00D /* NCCapabilitiesViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F70A58BF24D0545100DED00D /* NCCapabilitiesViewController.storyboard */; };
-		F70B866D2642A21300ED5349 /* NCBackgroundImageColor.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F70B866B2642A21300ED5349 /* NCBackgroundImageColor.storyboard */; };
-		F70B866E2642A21300ED5349 /* NCBackgroundImageColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70B866C2642A21300ED5349 /* NCBackgroundImageColor.swift */; };
 		F70B86752642CE3B00ED5349 /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = F70B86742642CE3B00ED5349 /* FirebaseCrashlytics */; };
 		F70BFC7420E0FA7D00C67599 /* NCUtility.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70BFC7320E0FA7C00C67599 /* NCUtility.swift */; };
 		F70BFC7520E0FA7D00C67599 /* NCUtility.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70BFC7320E0FA7C00C67599 /* NCUtility.swift */; };
@@ -144,8 +142,9 @@
 		F717402D24F699A5000C87D5 /* NCFavorite.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F717402B24F699A5000C87D5 /* NCFavorite.storyboard */; };
 		F717402E24F699A5000C87D5 /* NCFavorite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F717402C24F699A5000C87D5 /* NCFavorite.swift */; };
 		F718C24E254D507B00C5C256 /* NCViewerMediaDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F718C24D254D507B00C5C256 /* NCViewerMediaDetailView.swift */; };
+		F719D9E0288D37A300762E33 /* NCColorPicker.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F719D9DF288D37A300762E33 /* NCColorPicker.storyboard */; };
+		F719D9E2288D396100762E33 /* NCColorPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F719D9E1288D396100762E33 /* NCColorPicker.swift */; };
 		F7226EDC1EE4089300EBECB1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7226EDB1EE4089300EBECB1 /* Main.storyboard */; };
-		F7233B3A27835FA400F40A43 /* ChromaColorPicker in Frameworks */ = {isa = PBXBuildFile; productRef = F7233B3927835FA400F40A43 /* ChromaColorPicker */; };
 		F723985C253C95CE00257F49 /* NCViewerRichdocument.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F723985B253C95CE00257F49 /* NCViewerRichdocument.storyboard */; };
 		F7239871253D86B600257F49 /* NCEmptyDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7239870253D86B600257F49 /* NCEmptyDataSet.swift */; };
 		F7239877253D86D300257F49 /* NCEmptyView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7239876253D86D300257F49 /* NCEmptyView.xib */; };
@@ -580,8 +579,6 @@
 		F70A07C8205285FB00DC1231 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Localizable.strings"; sourceTree = "<group>"; };
 		F70A58BD24D0349500DED00D /* NCCapabilitiesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCapabilitiesViewController.swift; sourceTree = "<group>"; };
 		F70A58BF24D0545100DED00D /* NCCapabilitiesViewController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCCapabilitiesViewController.storyboard; sourceTree = "<group>"; };
-		F70B866B2642A21300ED5349 /* NCBackgroundImageColor.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCBackgroundImageColor.storyboard; sourceTree = "<group>"; };
-		F70B866C2642A21300ED5349 /* NCBackgroundImageColor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCBackgroundImageColor.swift; sourceTree = "<group>"; };
 		F70B866F2642CA9500ED5349 /* ChromaColorPicker.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = ChromaColorPicker.xcframework; path = Carthage/Build/ChromaColorPicker.xcframework; sourceTree = "<group>"; };
 		F70B86792642CF5300ED5349 /* KTVHTTPCache.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = KTVHTTPCache.xcframework; path = Carthage/Build/KTVHTTPCache.xcframework; sourceTree = "<group>"; };
 		F70B867A2642CF5300ED5349 /* TLPhotoPicker.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = TLPhotoPicker.xcframework; path = Carthage/Build/TLPhotoPicker.xcframework; sourceTree = "<group>"; };
@@ -637,6 +634,8 @@
 		F7176DB9256672640017E83C /* FIRAnalyticsConnector.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FIRAnalyticsConnector.framework; path = Carthage/Build/iOS/FIRAnalyticsConnector.framework; sourceTree = "<group>"; };
 		F7176DDA256672D90017E83C /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
 		F718C24D254D507B00C5C256 /* NCViewerMediaDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCViewerMediaDetailView.swift; sourceTree = "<group>"; };
+		F719D9DF288D37A300762E33 /* NCColorPicker.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCColorPicker.storyboard; sourceTree = "<group>"; };
+		F719D9E1288D396100762E33 /* NCColorPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCColorPicker.swift; sourceTree = "<group>"; };
 		F7226EDB1EE4089300EBECB1 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
 		F723985B253C95CE00257F49 /* NCViewerRichdocument.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCViewerRichdocument.storyboard; sourceTree = "<group>"; };
 		F7239870253D86B600257F49 /* NCEmptyDataSet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCEmptyDataSet.swift; sourceTree = "<group>"; };
@@ -1006,7 +1005,6 @@
 				F7ED547C25EEA65400956C55 /* QRCodeReader in Frameworks */,
 				F788ECC7263AAAFA00ADC67F /* MarkdownKit in Frameworks */,
 				F7BB7E4727A18C56009B9F29 /* Parchment in Frameworks */,
-				F7233B3A27835FA400F40A43 /* ChromaColorPicker in Frameworks */,
 				F770768E263A8C3400A1BA94 /* FloatingPanel in Frameworks */,
 				F710FC7C277B7D0000AA9FBF /* RealmSwift in Frameworks */,
 				F7E572FD278F146C00F8C99E /* OpenSSL.xcframework in Frameworks */,
@@ -1131,13 +1129,13 @@
 			path = languages;
 			sourceTree = "<group>";
 		};
-		F70B866A2642A21300ED5349 /* BackgroundImageColor */ = {
+		F70B866A2642A21300ED5349 /* Color */ = {
 			isa = PBXGroup;
 			children = (
-				F70B866B2642A21300ED5349 /* NCBackgroundImageColor.storyboard */,
-				F70B866C2642A21300ED5349 /* NCBackgroundImageColor.swift */,
+				F719D9DF288D37A300762E33 /* NCColorPicker.storyboard */,
+				F719D9E1288D396100762E33 /* NCColorPicker.swift */,
 			);
-			path = BackgroundImageColor;
+			path = Color;
 			sourceTree = "<group>";
 		};
 		F70D87CC25EE6E58008CBBBD /* Rename file */ = {
@@ -1765,8 +1763,8 @@
 				F70211F31BAC56E9003FC03E /* Main */,
 				F7CA213725F1372B00826ABB /* Account Request */,
 				F7A321621E9E37960069AD1B /* Activity */,
-				F70B866A2642A21300ED5349 /* BackgroundImageColor */,
 				F7AE00F6230E8191007ACF8A /* BrowserWeb */,
+				F70B866A2642A21300ED5349 /* Color */,
 				F7BAAD951ED5A63D00B7EAD4 /* Data */,
 				F73FAEE224D2CA830090692E /* Diagnostics */,
 				F723986F253D867900257F49 /* EmptyView */,
@@ -2070,7 +2068,6 @@
 				F76DA96E277B78AE0082465B /* TLPhotoPicker */,
 				F710FC79277B7D0000AA9FBF /* Realm */,
 				F710FC7B277B7D0000AA9FBF /* RealmSwift */,
-				F7233B3927835FA400F40A43 /* ChromaColorPicker */,
 				F7BB7E4627A18C56009B9F29 /* Parchment */,
 				F758A01127A7F03E0069468B /* JGProgressHUD */,
 				F753BA92281FD8020015BFB6 /* EasyTipView */,
@@ -2194,7 +2191,6 @@
 				F76DA967277B77E90082465B /* XCRemoteSwiftPackageReference "DropDown" */,
 				F76DA96D277B78AE0082465B /* XCRemoteSwiftPackageReference "TLPhotoPicker" */,
 				F710FC78277B7CFF00AA9FBF /* XCRemoteSwiftPackageReference "realm-swift" */,
-				F7233B3827835FA300F40A43 /* XCRemoteSwiftPackageReference "ChromaColorPicker" */,
 				F7BB7E4527A18C56009B9F29 /* XCRemoteSwiftPackageReference "Parchment" */,
 				F72CD01027A7E92400E59476 /* XCRemoteSwiftPackageReference "JGProgressHUD" */,
 				F753BA91281FD8010015BFB6 /* XCRemoteSwiftPackageReference "EasyTipView" */,
@@ -2314,6 +2310,7 @@
 				F749C10D23C4A5340027D966 /* NCIntro.storyboard in Resources */,
 				F7239877253D86D300257F49 /* NCEmptyView.xib in Resources */,
 				F747BA1F22354D2000971601 /* NCCreateFormUploadVoiceNote.storyboard in Resources */,
+				F719D9E0288D37A300762E33 /* NCColorPicker.storyboard in Resources */,
 				F7651A8A23A2A3F2001403D2 /* NCCreateFormUploadDocuments.storyboard in Resources */,
 				F7F4F10A27ECDBDB008676F9 /* Inconsolata-ExtraBold.ttf in Resources */,
 				F704B5E72430C06700632F5F /* NCCreateFormUploadConflictCell.xib in Resources */,
@@ -2332,7 +2329,6 @@
 				F77B0F631D118A16002130FE /* Localizable.strings in Resources */,
 				F774264A22EB4D0000B23912 /* NCSearchUserDropDownCell.xib in Resources */,
 				F7CB689A2541676B0050EC94 /* NCMore.storyboard in Resources */,
-				F70B866D2642A21300ED5349 /* NCBackgroundImageColor.storyboard in Resources */,
 				F77B0F7D1D118A16002130FE /* Images.xcassets in Resources */,
 				F73CB3B222E072A000AD728E /* NCShareHeaderView.xib in Resources */,
 				F7AE00FA230E81EB007ACF8A /* NCBrowserWeb.storyboard in Resources */,
@@ -2526,7 +2522,6 @@
 				F70D87D025EE6E58008CBBBD /* NCRenameFile.swift in Sources */,
 				F7F4F0F727ECDBA4008676F9 /* NCSubtitles.swift in Sources */,
 				F790110E21415BF600D7B136 /* NCViewerRichdocument.swift in Sources */,
-				F70B866E2642A21300ED5349 /* NCBackgroundImageColor.swift in Sources */,
 				F78ACD4021903CC20088454D /* NCGridCell.swift in Sources */,
 				F75B0ABD244C4DBB00E58DCA /* NCFunctionCenter.swift in Sources */,
 				AF935067276B84E700BD078F /* NCMenu+FloatingPanel.swift in Sources */,
@@ -2614,6 +2609,7 @@
 				AFCE353527E4ED5900FEA6C2 /* DateFormatter+Extension.swift in Sources */,
 				F718C24E254D507B00C5C256 /* NCViewerMediaDetailView.swift in Sources */,
 				F7381EE1218218C9000B1560 /* NCOffline.swift in Sources */,
+				F719D9E2288D396100762E33 /* NCColorPicker.swift in Sources */,
 				F78071091EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m in Sources */,
 				F79B646026CA661600838ACA /* UIControl+Extensions.swift in Sources */,
 				F7CA212D25F1333300826ABB /* NCAccountRequest.swift in Sources */,
@@ -2995,7 +2991,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 11;
+				CURRENT_PROJECT_VERSION = 12;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = YES;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -3058,7 +3054,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 11;
+				CURRENT_PROJECT_VERSION = 12;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = YES;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -3169,14 +3165,6 @@
 				minimumVersion = 10.0.0;
 			};
 		};
-		F7233B3827835FA300F40A43 /* XCRemoteSwiftPackageReference "ChromaColorPicker" */ = {
-			isa = XCRemoteSwiftPackageReference;
-			repositoryURL = "https://github.com/marinofaggiana/ChromaColorPicker";
-			requirement = {
-				branch = master;
-				kind = branch;
-			};
-		};
 		F72CD01027A7E92400E59476 /* XCRemoteSwiftPackageReference "JGProgressHUD" */ = {
 			isa = XCRemoteSwiftPackageReference;
 			repositoryURL = "https://github.com/JonasGessner/JGProgressHUD.git";
@@ -3353,11 +3341,6 @@
 			package = F710FC78277B7CFF00AA9FBF /* XCRemoteSwiftPackageReference "realm-swift" */;
 			productName = RealmSwift;
 		};
-		F7233B3927835FA400F40A43 /* ChromaColorPicker */ = {
-			isa = XCSwiftPackageProductDependency;
-			package = F7233B3827835FA300F40A43 /* XCRemoteSwiftPackageReference "ChromaColorPicker" */;
-			productName = ChromaColorPicker;
-		};
 		F72CD01127A7E92400E59476 /* JGProgressHUD */ = {
 			isa = XCSwiftPackageProductDependency;
 			package = F72CD01027A7E92400E59476 /* XCRemoteSwiftPackageReference "JGProgressHUD" */;

+ 3 - 18
iOSClient/Account Request/NCAccountRequest.swift

@@ -66,6 +66,9 @@ class NCAccountRequest: UIViewController {
         tableView.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.size.width, height: 1))
         tableView.separatorStyle = UITableViewCell.SeparatorStyle.none
 
+        view.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+        tableView.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+
         progressView.trackTintColor = .clear
         progressView.progress = 1
         if enableTimerProgress {
@@ -76,8 +79,6 @@ class NCAccountRequest: UIViewController {
 
         NotificationCenter.default.addObserver(self, selector: #selector(startTimer), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterApplicationDidBecomeActive), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(applicationDidEnterBackground), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterApplicationDidEnterBackground), object: nil)
-
-        changeTheming()
     }
 
     override func viewWillAppear(_ animated: Bool) {
@@ -102,22 +103,6 @@ class NCAccountRequest: UIViewController {
         timer?.invalidate()
     }
 
-    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
-        super.traitCollectionDidChange(previousTraitCollection)
-
-        changeTheming()
-    }
-
-    // MARK: - Theming
-
-    @objc func changeTheming() {
-
-        view.backgroundColor = NCBrandColor.shared.secondarySystemBackground
-        tableView.backgroundColor = NCBrandColor.shared.secondarySystemBackground
-
-        tableView.reloadData()
-    }
-
     // MARK: - Action
 
     @IBAction func actionClose(_ sender: UIButton) {

+ 0 - 8
iOSClient/Activity/NCActivity.swift

@@ -68,10 +68,6 @@ class NCActivity: UIViewController, NCSharePagingContent {
         tableView.contentInset = insets
         tableView.backgroundColor = NCBrandColor.shared.systemBackground
 
-        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
-
-        changeTheming()
-
         if showComments {
             setupComments()
         }
@@ -126,10 +122,6 @@ class NCActivity: UIViewController, NCSharePagingContent {
         fetchAll(isInitial: true)
     }
 
-    @objc func changeTheming() {
-        tableView.reloadData()
-    }
-
     func makeTableFooterView() -> UIView {
         let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 100))
         view.backgroundColor = .clear

+ 0 - 257
iOSClient/BackgroundImageColor/NCBackgroundImageColor.storyboard

@@ -1,257 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="V0q-CP-xMJ">
-    <device id="retina3_5" orientation="portrait" appearance="light"/>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
-        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
-        <capability name="System colors in document resources" minToolsVersion="11.0"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <scenes>
-        <!--Background Image Color-->
-        <scene sceneID="L90-uG-f4z">
-            <objects>
-                <viewController id="V0q-CP-xMJ" customClass="NCBackgroundImageColor" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
-                    <view key="view" contentMode="scaleToFill" id="gzh-6E-hc4">
-                        <rect key="frame" x="0.0" y="0.0" width="300" height="450"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <subviews>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Background" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nZr-nE-ths">
-                                <rect key="frame" x="20" y="15" width="260" height="18"/>
-                                <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
-                                <nil key="textColor"/>
-                                <nil key="highlightedColor"/>
-                            </label>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iU2-DL-ICv">
-                                <rect key="frame" x="0.0" y="53" width="300" height="250"/>
-                                <subviews>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3E4-fA-LuC">
-                                        <rect key="frame" x="260" y="0.0" width="30" height="30"/>
-                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="30" id="7gh-HI-7F4"/>
-                                            <constraint firstAttribute="height" constant="30" id="tN7-80-0OA"/>
-                                        </constraints>
-                                        <connections>
-                                            <action selector="whiteButtonAction:" destination="V0q-CP-xMJ" eventType="touchUpInside" id="qan-1S-lXZ"/>
-                                        </connections>
-                                    </button>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wje-qo-0av">
-                                        <rect key="frame" x="260" y="50" width="30" height="30"/>
-                                        <color key="backgroundColor" systemColor="systemOrangeColor"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="30" id="eEj-s3-RlJ"/>
-                                            <constraint firstAttribute="width" constant="30" id="wll-2m-eab"/>
-                                        </constraints>
-                                        <connections>
-                                            <action selector="orangeButtonAction:" destination="V0q-CP-xMJ" eventType="touchUpInside" id="rze-5I-h4O"/>
-                                        </connections>
-                                    </button>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aan-mm-3h8">
-                                        <rect key="frame" x="260" y="100" width="30" height="30"/>
-                                        <color key="backgroundColor" systemColor="systemRedColor"/>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="30" id="KEh-Br-hec"/>
-                                            <constraint firstAttribute="height" constant="30" id="KF6-bC-uqI"/>
-                                        </constraints>
-                                        <connections>
-                                            <action selector="redButtonAction:" destination="V0q-CP-xMJ" eventType="touchUpInside" id="DQh-Gp-afZ"/>
-                                        </connections>
-                                    </button>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ele-7I-DxL">
-                                        <rect key="frame" x="260" y="150" width="30" height="30"/>
-                                        <color key="backgroundColor" systemColor="systemGreenColor"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="30" id="DgY-z7-3HB"/>
-                                            <constraint firstAttribute="width" constant="30" id="NZK-QF-30V"/>
-                                        </constraints>
-                                        <state key="normal">
-                                            <preferredSymbolConfiguration key="preferredSymbolConfiguration" scale="default"/>
-                                        </state>
-                                        <connections>
-                                            <action selector="greenButtonAction:" destination="V0q-CP-xMJ" eventType="touchUpInside" id="vz7-sI-OZN"/>
-                                        </connections>
-                                    </button>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="STo-4B-X2d">
-                                        <rect key="frame" x="260" y="200" width="30" height="30"/>
-                                        <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                        <constraints>
-                                            <constraint firstAttribute="width" constant="30" id="Qez-ew-4Ft"/>
-                                            <constraint firstAttribute="height" constant="30" id="bNc-qJ-yHL"/>
-                                        </constraints>
-                                        <state key="normal">
-                                            <preferredSymbolConfiguration key="preferredSymbolConfiguration" scale="default"/>
-                                        </state>
-                                        <connections>
-                                            <action selector="blackButtonAction:" destination="V0q-CP-xMJ" eventType="touchUpInside" id="FjW-KU-IXB"/>
-                                        </connections>
-                                    </button>
-                                </subviews>
-                                <constraints>
-                                    <constraint firstItem="STo-4B-X2d" firstAttribute="top" secondItem="ele-7I-DxL" secondAttribute="bottom" constant="20" id="BKq-hv-vnm"/>
-                                    <constraint firstAttribute="trailing" secondItem="ele-7I-DxL" secondAttribute="trailing" constant="10" id="FvE-ra-6MO"/>
-                                    <constraint firstAttribute="trailing" secondItem="STo-4B-X2d" secondAttribute="trailing" constant="10" id="H9y-WI-TXI"/>
-                                    <constraint firstAttribute="trailing" secondItem="3E4-fA-LuC" secondAttribute="trailing" constant="10" id="UoS-lh-xRi"/>
-                                    <constraint firstAttribute="trailing" secondItem="aan-mm-3h8" secondAttribute="trailing" constant="10" id="VKC-iZ-oKg"/>
-                                    <constraint firstItem="aan-mm-3h8" firstAttribute="top" secondItem="wje-qo-0av" secondAttribute="bottom" constant="20" id="Vtc-IV-iRF"/>
-                                    <constraint firstItem="3E4-fA-LuC" firstAttribute="top" secondItem="iU2-DL-ICv" secondAttribute="top" id="XPi-Om-9AW"/>
-                                    <constraint firstItem="ele-7I-DxL" firstAttribute="top" secondItem="aan-mm-3h8" secondAttribute="bottom" constant="20" id="ZFk-RV-bm7"/>
-                                    <constraint firstAttribute="trailing" secondItem="wje-qo-0av" secondAttribute="trailing" constant="10" id="au5-4T-kJG"/>
-                                    <constraint firstItem="wje-qo-0av" firstAttribute="top" secondItem="3E4-fA-LuC" secondAttribute="bottom" constant="20" id="p2S-Vf-mU1"/>
-                                    <constraint firstAttribute="height" constant="250" id="v0B-oB-eD3"/>
-                                </constraints>
-                            </view>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7CJ-Q0-ABH" userLabel="SeparatorV">
-                                <rect key="frame" x="150" y="400" width="0.5" height="50"/>
-                                <color key="backgroundColor" systemColor="systemGray4Color"/>
-                                <constraints>
-                                    <constraint firstAttribute="width" constant="0.5" id="wU1-tA-NZk"/>
-                                </constraints>
-                            </view>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ouH-gK-Guv" userLabel="SeparatorH">
-                                <rect key="frame" x="0.0" y="399.5" width="300" height="0.5"/>
-                                <color key="backgroundColor" systemColor="systemGray4Color"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="0.5" id="2OQ-Mt-Gnh"/>
-                                </constraints>
-                            </view>
-                            <button opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="249" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="W5y-aT-UlI">
-                                <rect key="frame" x="0.0" y="400" width="150" height="50"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="50" id="xnX-6W-gp9"/>
-                                </constraints>
-                                <fontDescription key="fontDescription" type="system" pointSize="16"/>
-                                <state key="normal" title="Cancel">
-                                    <color key="titleColor" systemColor="systemBlueColor"/>
-                                </state>
-                                <connections>
-                                    <action selector="cancelAction:" destination="V0q-CP-xMJ" eventType="touchUpInside" id="z5n-6l-qtR"/>
-                                </connections>
-                            </button>
-                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hcV-V0-eZB">
-                                <rect key="frame" x="150" y="400" width="150" height="50"/>
-                                <fontDescription key="fontDescription" type="system" pointSize="16"/>
-                                <state key="normal" title="Ok">
-                                    <color key="titleColor" systemColor="systemBlueColor"/>
-                                </state>
-                                <connections>
-                                    <action selector="okAction:" destination="V0q-CP-xMJ" eventType="touchUpInside" id="DO8-xB-WXf"/>
-                                </connections>
-                            </button>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Dsj-Of-TI5">
-                                <rect key="frame" x="0.0" y="308" width="300" height="80"/>
-                                <subviews>
-                                    <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qCH-0e-MgJ">
-                                        <rect key="frame" x="241" y="3.5" width="51" height="31"/>
-                                        <connections>
-                                            <action selector="darkmodeAction:" destination="V0q-CP-xMJ" eventType="valueChanged" id="jpD-6b-nRS"/>
-                                        </connections>
-                                    </switch>
-                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="dark mode" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AH4-ei-W3C">
-                                        <rect key="frame" x="10" y="10" width="221" height="18"/>
-                                        <fontDescription key="fontDescription" type="system" pointSize="15"/>
-                                        <nil key="textColor"/>
-                                        <nil key="highlightedColor"/>
-                                    </label>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6Dy-77-TIC">
-                                        <rect key="frame" x="10" y="48" width="280" height="30"/>
-                                        <color key="backgroundColor" systemColor="systemGray4Color"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="30" id="ZKT-Su-3nU"/>
-                                        </constraints>
-                                        <fontDescription key="fontDescription" type="system" pointSize="15"/>
-                                        <state key="normal" title="default color">
-                                            <color key="titleColor" systemColor="labelColor"/>
-                                        </state>
-                                        <connections>
-                                            <action selector="defaultAction:" destination="V0q-CP-xMJ" eventType="touchUpInside" id="iTy-8K-wVB"/>
-                                        </connections>
-                                    </button>
-                                </subviews>
-                                <constraints>
-                                    <constraint firstItem="6Dy-77-TIC" firstAttribute="top" secondItem="AH4-ei-W3C" secondAttribute="bottom" constant="20" id="0J5-Y3-Z2f"/>
-                                    <constraint firstItem="qCH-0e-MgJ" firstAttribute="centerY" secondItem="AH4-ei-W3C" secondAttribute="centerY" id="7pt-EI-Zgu"/>
-                                    <constraint firstItem="AH4-ei-W3C" firstAttribute="top" secondItem="Dsj-Of-TI5" secondAttribute="top" constant="10" id="9E5-Em-VG8"/>
-                                    <constraint firstItem="qCH-0e-MgJ" firstAttribute="leading" secondItem="AH4-ei-W3C" secondAttribute="trailing" constant="10" id="9qm-mi-Gwb"/>
-                                    <constraint firstItem="AH4-ei-W3C" firstAttribute="leading" secondItem="Dsj-Of-TI5" secondAttribute="leading" constant="10" id="Afp-ca-hx0"/>
-                                    <constraint firstItem="6Dy-77-TIC" firstAttribute="leading" secondItem="Dsj-Of-TI5" secondAttribute="leading" constant="10" id="Bn8-Bi-qOg"/>
-                                    <constraint firstAttribute="trailing" secondItem="qCH-0e-MgJ" secondAttribute="trailing" constant="10" id="QVc-0U-Mg8"/>
-                                    <constraint firstAttribute="trailing" secondItem="6Dy-77-TIC" secondAttribute="trailing" constant="10" id="jId-wH-r5I"/>
-                                    <constraint firstAttribute="height" constant="80" id="uSG-oG-ooi"/>
-                                </constraints>
-                            </view>
-                        </subviews>
-                        <viewLayoutGuide key="safeArea" id="1c1-7Q-WMG"/>
-                        <color key="backgroundColor" systemColor="systemGray6Color"/>
-                        <constraints>
-                            <constraint firstItem="hcV-V0-eZB" firstAttribute="top" secondItem="ouH-gK-Guv" secondAttribute="bottom" id="1MZ-1P-Ej1"/>
-                            <constraint firstItem="1c1-7Q-WMG" firstAttribute="bottom" secondItem="hcV-V0-eZB" secondAttribute="bottom" id="2Wh-Y6-n8F"/>
-                            <constraint firstItem="1c1-7Q-WMG" firstAttribute="trailing" secondItem="iU2-DL-ICv" secondAttribute="trailing" id="3Mn-1r-AGf"/>
-                            <constraint firstItem="Dsj-Of-TI5" firstAttribute="top" secondItem="iU2-DL-ICv" secondAttribute="bottom" constant="5" id="7kJ-dL-S5M"/>
-                            <constraint firstItem="1c1-7Q-WMG" firstAttribute="bottom" secondItem="7CJ-Q0-ABH" secondAttribute="bottom" id="8HO-F9-tfD"/>
-                            <constraint firstItem="ouH-gK-Guv" firstAttribute="leading" secondItem="1c1-7Q-WMG" secondAttribute="leading" id="A6T-ed-97T"/>
-                            <constraint firstItem="hcV-V0-eZB" firstAttribute="leading" secondItem="W5y-aT-UlI" secondAttribute="trailing" id="Aa4-Pg-Ioh"/>
-                            <constraint firstItem="1c1-7Q-WMG" firstAttribute="trailing" secondItem="nZr-nE-ths" secondAttribute="trailing" constant="20" id="DPW-MV-oKc"/>
-                            <constraint firstItem="7CJ-Q0-ABH" firstAttribute="centerX" secondItem="1c1-7Q-WMG" secondAttribute="centerX" id="EVx-ob-2bn"/>
-                            <constraint firstItem="nZr-nE-ths" firstAttribute="leading" secondItem="1c1-7Q-WMG" secondAttribute="leading" constant="20" id="SI9-xL-6s8"/>
-                            <constraint firstItem="iU2-DL-ICv" firstAttribute="top" secondItem="nZr-nE-ths" secondAttribute="bottom" constant="20" id="ZrF-wP-mwm"/>
-                            <constraint firstItem="iU2-DL-ICv" firstAttribute="leading" secondItem="1c1-7Q-WMG" secondAttribute="leading" id="aNT-a0-r8t"/>
-                            <constraint firstItem="1c1-7Q-WMG" firstAttribute="bottom" secondItem="W5y-aT-UlI" secondAttribute="bottom" id="ai8-AR-XYe"/>
-                            <constraint firstItem="7CJ-Q0-ABH" firstAttribute="top" secondItem="ouH-gK-Guv" secondAttribute="bottom" id="an1-EN-YiB"/>
-                            <constraint firstItem="1c1-7Q-WMG" firstAttribute="trailing" secondItem="W5y-aT-UlI" secondAttribute="trailing" multiplier="2" id="g0h-1g-A3R"/>
-                            <constraint firstItem="Dsj-Of-TI5" firstAttribute="leading" secondItem="1c1-7Q-WMG" secondAttribute="leading" id="gYm-lv-oVe"/>
-                            <constraint firstItem="1c1-7Q-WMG" firstAttribute="trailing" secondItem="hcV-V0-eZB" secondAttribute="trailing" id="heW-2p-hLJ"/>
-                            <constraint firstItem="W5y-aT-UlI" firstAttribute="leading" secondItem="1c1-7Q-WMG" secondAttribute="leading" id="kw6-l5-CAR"/>
-                            <constraint firstItem="nZr-nE-ths" firstAttribute="top" secondItem="1c1-7Q-WMG" secondAttribute="top" constant="15" id="oyJ-sj-j5N"/>
-                            <constraint firstItem="1c1-7Q-WMG" firstAttribute="trailing" secondItem="ouH-gK-Guv" secondAttribute="trailing" id="r1N-R6-iZg"/>
-                            <constraint firstItem="1c1-7Q-WMG" firstAttribute="trailing" secondItem="Dsj-Of-TI5" secondAttribute="trailing" id="tA5-3w-2U2"/>
-                            <constraint firstItem="W5y-aT-UlI" firstAttribute="top" secondItem="ouH-gK-Guv" secondAttribute="bottom" id="ywb-oW-pJe"/>
-                        </constraints>
-                    </view>
-                    <navigationItem key="navigationItem" id="Zon-2j-rsc"/>
-                    <size key="freeformSize" width="300" height="450"/>
-                    <connections>
-                        <outlet property="blackButton" destination="STo-4B-X2d" id="XwW-Q1-u9Y"/>
-                        <outlet property="cancelButton" destination="W5y-aT-UlI" id="P9l-o1-miU"/>
-                        <outlet property="chromaColorPickerView" destination="iU2-DL-ICv" id="iX8-Pq-EFB"/>
-                        <outlet property="darkmodeLabel" destination="AH4-ei-W3C" id="JvO-LN-BUu"/>
-                        <outlet property="darkmodeSwitch" destination="qCH-0e-MgJ" id="rjG-X5-eqA"/>
-                        <outlet property="defaultButton" destination="6Dy-77-TIC" id="PxM-tG-Ve7"/>
-                        <outlet property="greenButton" destination="ele-7I-DxL" id="vYB-cv-c6D"/>
-                        <outlet property="okButton" destination="hcV-V0-eZB" id="1VQ-qp-4Fs"/>
-                        <outlet property="orangeButton" destination="wje-qo-0av" id="LN8-3w-Wtx"/>
-                        <outlet property="redButton" destination="aan-mm-3h8" id="X89-dx-fGV"/>
-                        <outlet property="titleLabel" destination="nZr-nE-ths" id="UbA-Dl-0Ad"/>
-                        <outlet property="whiteButton" destination="3E4-fA-LuC" id="mNg-2f-rvs"/>
-                    </connections>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="qdm-Cl-C5l" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="1453.125" y="133.75"/>
-        </scene>
-    </scenes>
-    <resources>
-        <systemColor name="labelColor">
-            <color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-        </systemColor>
-        <systemColor name="systemBlueColor">
-            <color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-        </systemColor>
-        <systemColor name="systemGray4Color">
-            <color red="0.81960784313725488" green="0.81960784313725488" blue="0.83921568627450982" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-        </systemColor>
-        <systemColor name="systemGray6Color">
-            <color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-        </systemColor>
-        <systemColor name="systemGreenColor">
-            <color red="0.20392156862745098" green="0.7803921568627451" blue="0.34901960784313724" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-        </systemColor>
-        <systemColor name="systemOrangeColor">
-            <color red="1" green="0.58431372549019611" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-        </systemColor>
-        <systemColor name="systemRedColor">
-            <color red="1" green="0.23137254901960785" blue="0.18823529411764706" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-        </systemColor>
-    </resources>
-</document>

+ 0 - 298
iOSClient/BackgroundImageColor/NCBackgroundImageColor.swift

@@ -1,298 +0,0 @@
-//
-//  NCBackgroundImageColor.swift
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 05/05/21.
-//  Copyright © 2021 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
-import ChromaColorPicker
-
-public protocol NCBackgroundImageColorDelegate: AnyObject {
-    func colorPickerCancel()
-    func colorPickerWillChange(color: UIColor)
-    func colorPickerDidChange(lightColor: String, darkColor: String)
-}
-
-// optional func
-public extension NCBackgroundImageColorDelegate {
-    func colorPickerCancel() {}
-    func colorPickerWillChange(color: UIColor) { }
-    func colorPickerDidChange(lightColor: String, darkColor: String) { }
-}
-
-class NCBackgroundImageColor: UIViewController {
-
-    @IBOutlet weak var titleLabel: UILabel!
-    @IBOutlet weak var chromaColorPickerView: UIView!
-
-    @IBOutlet weak var whiteButton: UIButton!
-    @IBOutlet weak var orangeButton: UIButton!
-    @IBOutlet weak var redButton: UIButton!
-    @IBOutlet weak var greenButton: UIButton!
-    @IBOutlet weak var blackButton: UIButton!
-
-    @IBOutlet weak var darkmodeLabel: UILabel!
-    @IBOutlet weak var darkmodeSwitch: UISwitch!
-
-    @IBOutlet weak var defaultButton: UIButton!
-    @IBOutlet weak var cancelButton: UIButton!
-    @IBOutlet weak var okButton: UIButton!
-
-    private let colorPicker = ChromaColorPicker()
-    private let brightnessSlider = ChromaBrightnessSlider()
-    private var colorHandle: ChromaColorHandle?
-    private let defaultColorPickerSize = CGSize(width: 200, height: 200)
-    private let brightnessSliderWidthHeightRatio: CGFloat = 0.1
-
-    weak var delegate: NCBackgroundImageColorDelegate?
-    var setupColor: UIColor?
-    var darkColor = "#000000"
-    var lightColor = "#FFFFFF"
-
-    let width: CGFloat = 300
-    let height: CGFloat = 450
-
-    // MARK: - View Life Cycle
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-
-        setupColorPicker()
-        setupBrightnessSlider()
-        setupColorPickerHandles()
-
-        titleLabel.text = NSLocalizedString("_background_", comment: "")
-        darkmodeLabel.text = NSLocalizedString("_dark_mode_", comment: "")
-
-        defaultButton.setTitle(NSLocalizedString("_default_color_", comment: ""), for: .normal)
-
-        cancelButton.setTitle(NSLocalizedString("_cancel_", comment: ""), for: .normal)
-        okButton.setTitle(NSLocalizedString("_ok_", comment: ""), for: .normal)
-
-        whiteButton.backgroundColor = .white
-        whiteButton.layer.cornerRadius = 5
-        whiteButton.layer.borderWidth = 0.5
-        whiteButton.layer.borderColor = NCBrandColor.shared.label.cgColor
-        whiteButton.layer.masksToBounds = true
-
-        orangeButton.backgroundColor = .orange
-        orangeButton.layer.cornerRadius = 5
-        orangeButton.layer.borderWidth = 0.5
-        orangeButton.layer.borderColor = NCBrandColor.shared.label.cgColor
-        orangeButton.layer.masksToBounds = true
-
-        redButton.backgroundColor = .red
-        redButton.layer.cornerRadius = 5
-        redButton.layer.borderWidth = 0.5
-        redButton.layer.borderColor = NCBrandColor.shared.label.cgColor
-        redButton.layer.masksToBounds = true
-
-        greenButton.backgroundColor = .green
-        greenButton.layer.cornerRadius = 5
-        greenButton.layer.borderWidth = 0.5
-        greenButton.layer.borderColor = NCBrandColor.shared.label.cgColor
-        greenButton.layer.masksToBounds = true
-
-        blackButton.backgroundColor = .black
-        blackButton.layer.cornerRadius = 5
-        blackButton.layer.borderWidth = 0.5
-        blackButton.layer.borderColor = NCBrandColor.shared.label.cgColor
-        blackButton.layer.masksToBounds = true
-
-        defaultButton.layer.cornerRadius = 15
-        defaultButton.layer.borderWidth = 0.5
-        defaultButton.layer.borderColor = UIColor.gray.cgColor
-        defaultButton.layer.masksToBounds = true
-    }
-
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-
-        if traitCollection.userInterfaceStyle == .dark {
-            darkmodeSwitch.isOn = true
-        } else {
-            darkmodeSwitch.isOn = false
-        }
-
-        // Color for all folders
-        if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
-            if darkColor == "" {
-                darkColor = activeAccount.darkColorBackground
-            }
-            if lightColor == "" {
-                lightColor = activeAccount.lightColorBackground
-            }
-        }
-
-        // set color
-        if darkmodeSwitch.isOn {
-            if let color = UIColor(hex: darkColor) {
-                changeColor(color)
-            } else {
-                changeColor(.black)
-            }
-        } else {
-            if let color = UIColor(hex: lightColor) {
-                changeColor(color)
-            } else {
-                changeColor(.white)
-            }
-        }
-    }
-
-    // MARK: - Action
-
-    @IBAction func whiteButtonAction(_ sender: UIButton) {
-        changeColor(.white)
-    }
-
-    @IBAction func orangeButtonAction(_ sender: UIButton) {
-        changeColor(.orange)
-    }
-
-    @IBAction func redButtonAction(_ sender: UIButton) {
-        changeColor(.red)
-    }
-
-    @IBAction func greenButtonAction(_ sender: UIButton) {
-        changeColor(.green)
-    }
-
-    @IBAction func blackButtonAction(_ sender: UIButton) {
-        changeColor(.black)
-    }
-
-    @IBAction func darkmodeAction(_ sender: UISwitch) {
-
-        if sender.isOn {
-            if darkColor == "" {
-                changeColor(.black)
-            } else {
-                if let color = UIColor(hex: darkColor) {
-                    changeColor(color)
-                }
-            }
-        } else {
-            if lightColor == "" {
-                changeColor(.white)
-            } else {
-                if let color = UIColor(hex: lightColor) {
-                    changeColor(color)
-                }
-            }
-        }
-    }
-
-    @IBAction func defaultAction(_ sender: Any) {
-
-        if darkmodeSwitch.isOn {
-            darkColor = "#000000"
-            changeColor(.black)
-        } else {
-            lightColor = "#FFFFFF"
-            changeColor(.white)
-        }
-    }
-
-    @IBAction func cancelAction(_ sender: Any) {
-
-        self.delegate?.colorPickerCancel()
-        dismiss(animated: true)
-    }
-
-    @IBAction func okAction(_ sender: Any) {
-
-        var lightColor = self.lightColor
-        var darkColor = self.darkColor
-
-        if lightColor == "#FFFFFF" { lightColor = "" }
-        if darkColor == "#000000" { darkColor = "" }
-
-        self.delegate?.colorPickerDidChange(lightColor: lightColor, darkColor: darkColor)
-
-        dismiss(animated: true)
-    }
-
-    // MARK: - ChromaColorPicker
-
-    private func setupColorPicker() {
-        colorPicker.delegate = self
-        colorPicker.translatesAutoresizingMaskIntoConstraints = false
-        view.addSubview(colorPicker)
-
-        NSLayoutConstraint.activate([
-            colorPicker.leadingAnchor.constraint(equalTo: chromaColorPickerView.leadingAnchor, constant: 20),
-            colorPicker.topAnchor.constraint(equalTo: chromaColorPickerView.topAnchor),
-            colorPicker.widthAnchor.constraint(equalToConstant: defaultColorPickerSize.width),
-            colorPicker.heightAnchor.constraint(equalToConstant: defaultColorPickerSize.height)
-        ])
-    }
-
-    private func setupBrightnessSlider() {
-        brightnessSlider.connect(to: colorPicker)
-
-        // Style
-        brightnessSlider.trackColor = UIColor.blue
-        brightnessSlider.handle.borderWidth = 3.0 // Example of customizing the handle's properties.
-
-        // Layout
-        brightnessSlider.translatesAutoresizingMaskIntoConstraints = false
-        view.addSubview(brightnessSlider)
-
-        NSLayoutConstraint.activate([
-            brightnessSlider.centerXAnchor.constraint(equalTo: colorPicker.centerXAnchor),
-            brightnessSlider.topAnchor.constraint(equalTo: colorPicker.bottomAnchor, constant: 20),
-            brightnessSlider.widthAnchor.constraint(equalTo: colorPicker.widthAnchor, multiplier: 1),
-            brightnessSlider.heightAnchor.constraint(equalTo: brightnessSlider.widthAnchor, multiplier: brightnessSliderWidthHeightRatio)
-        ])
-    }
-
-    private func setupColorPickerHandles() {
-        colorHandle = colorPicker.addHandle(at: setupColor)
-    }
-
-    private func changeColor(_ color: UIColor) {
-
-        colorHandle?.color = color
-        colorPicker.setNeedsLayout()
-        brightnessSlider.trackColor = color
-
-        if darkmodeSwitch.isOn {
-            darkColor = color.hexString
-        } else {
-            lightColor = color.hexString
-        }
-
-        self.delegate?.colorPickerWillChange(color: color)
-    }
-}
-
-extension NCBackgroundImageColor: ChromaColorPickerDelegate {
-    func colorPickerHandleDidChange(_ colorPicker: ChromaColorPicker, handle: ChromaColorHandle, to color: UIColor) {
-
-        if darkmodeSwitch.isOn {
-            darkColor = color.hexString
-        } else {
-            lightColor = color.hexString
-        }
-
-        self.delegate?.colorPickerWillChange(color: color)
-    }
-}

+ 46 - 19
iOSClient/Brand/NCBrand.swift

@@ -90,9 +90,6 @@ import UIKit
     @objc public var disable_request_account:           Bool = false
     @objc public var disable_log:                       Bool = false
 
-    @objc public var disable_background_color:          Bool = true
-    @objc public var disable_background_image:          Bool = true
-
     override init() {
 
         if folderBrandAutoUpload != "" {
@@ -172,6 +169,52 @@ class NCBrandColor: NSObject {
         }
     }
 
+    @objc public var systemBlue: UIColor {
+        get {
+            if #available(iOS 13, *) {
+                return .systemBlue
+            } else {
+                return UIColor(red: 0.0, green: 122.0 / 255.0, blue: 1.0, alpha: 1.0)
+            }
+        }
+    }
+
+    @objc public var systemIndigo: UIColor {
+        get {
+            if #available(iOS 13, *) {
+                return .systemIndigo
+            } else {
+                return UIColor(red: 88.0 / 255.0, green: 86.0 / 255.0, blue: 214.0 / 255.0, alpha: 1.0)
+            }
+        }
+    }
+
+    @objc public var systemPink: UIColor {
+        get {
+            if #available(iOS 13, *) {
+                return .systemPink
+            } else {
+                return UIColor(red: 1.0, green: 45.0 / 255.0, blue: 85.0 / 255.0, alpha: 1.0)
+            }
+        }
+    }
+
+    @objc public var systemTeal: UIColor {
+        get {
+            if #available(iOS 13, *) {
+                return .systemTeal
+            } else {
+                return UIColor(red: 90.0 / 255.0, green: 200.0 / 255.0, blue: 250.0 / 255.0, alpha: 1.0)
+            }
+        }
+    }
+
+    @objc public var systemMint: UIColor {
+        get {
+            return UIColor(red: 0.0 / 255.0, green: 199.0 / 255.0, blue: 190.0 / 255.0, alpha: 1.0)
+        }
+    }
+
     @objc public var systemBackground: UIColor {
         get {
             if #available(iOS 13, *) {
@@ -348,22 +391,6 @@ class NCBrandColor: NSObject {
         brandText = customerText
     }
 
-    /*
-    func createColors() {
-        #if !EXTENSION
-        if let tableAccount = NCManageDatabase.shared.getActiveAccount() {
-            settingThemingColor(account: tableAccount.account)
-        } else {
-            createImagesThemingColor()
-        }
-        createUserColors()
-        #else
-        createImagesThemingColor()
-        createUserColors()
-        #endif
-    }
-    */
-    
     func createUserColors() {
         userColors = generateColors()
     }

+ 283 - 0
iOSClient/Color/NCColorPicker.storyboard

@@ -0,0 +1,283 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
+    <device id="retina4_0" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--Color Picker-->
+        <scene sceneID="s0d-6b-0kx">
+            <objects>
+                <viewController id="Y6W-OH-hqX" customClass="NCColorPicker" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
+                        <rect key="frame" x="0.0" y="0.0" width="200" height="320"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kwJ-4R-6nM">
+                                <rect key="frame" x="10" y="10" width="15" height="15"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="15" id="AE2-yu-3y4"/>
+                                    <constraint firstAttribute="width" constant="15" id="Foq-O9-Wep"/>
+                                </constraints>
+                                <state key="normal" image="xmark"/>
+                                <connections>
+                                    <action selector="closeAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="nq5-sT-FEb"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JUR-Vj-yBU">
+                                <rect key="frame" x="15" y="40" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="40" id="LDf-aO-ruY"/>
+                                    <constraint firstAttribute="height" constant="40" id="U5p-9E-WGx"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="orangeButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="qjx-Me-0xU"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Zr2-rF-YUt">
+                                <rect key="frame" x="15" y="95" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="krX-Ql-hLX"/>
+                                    <constraint firstAttribute="width" constant="40" id="pBq-i1-K9T"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="redButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="b2r-oG-GvU"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dOn-SY-wnl">
+                                <rect key="frame" x="15" y="150" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="BI1-aU-56D"/>
+                                    <constraint firstAttribute="width" constant="40" id="v3I-Na-zQ5"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="purpleButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="Ep7-vV-zH8"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="C2a-jB-FVB">
+                                <rect key="frame" x="15" y="205" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="Sfk-IP-7JV"/>
+                                    <constraint firstAttribute="width" constant="40" id="n8f-nK-weh"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="blueButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="M04-54-NPB"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8xv-8Y-A50">
+                                <rect key="frame" x="15" y="260" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="Jgq-IJ-7jj"/>
+                                    <constraint firstAttribute="width" constant="40" id="h5m-EQ-2Go"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="greenButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="VVw-Ra-U8N"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="OlH-Ak-sRA">
+                                <rect key="frame" x="80" y="40" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="3kj-5z-0de"/>
+                                    <constraint firstAttribute="width" constant="40" id="vjr-4J-pHk"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="cyanButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="Qxa-md-cPa"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FU6-q8-9Iw">
+                                <rect key="frame" x="80" y="95" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="40" id="NGk-p2-vQ4"/>
+                                    <constraint firstAttribute="height" constant="40" id="Rni-gX-9zj"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="yellowButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="DuE-By-m9k"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LwF-26-oss">
+                                <rect key="frame" x="80" y="150" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="Pqo-uv-KrN"/>
+                                    <constraint firstAttribute="width" constant="40" id="y5l-31-c4D"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="grayButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="wP2-wX-3Hl"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="I9w-cx-QlY">
+                                <rect key="frame" x="80" y="205" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="Vgv-il-6Vw"/>
+                                    <constraint firstAttribute="width" constant="40" id="dHD-fs-7m0"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="brownButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="AH7-Kr-g9S"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Uaq-hC-U4a">
+                                <rect key="frame" x="145" y="260" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="DqE-d1-FMQ"/>
+                                    <constraint firstAttribute="width" constant="40" id="L0n-3P-wA1"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="defaultButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="VhY-1n-fwQ"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tt7-sI-TfL">
+                                <rect key="frame" x="145" y="40" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="40" id="b6h-GE-ftL"/>
+                                    <constraint firstAttribute="height" constant="40" id="mfL-IL-0ZL"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="systemIndigoButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="rNl-zX-67r"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="12u-cu-XGu">
+                                <rect key="frame" x="80" y="260" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="40" id="8vW-vR-kNP"/>
+                                    <constraint firstAttribute="height" constant="40" id="F3v-dP-jmB"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="systemBlueButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="V6v-x6-0xf"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Arw-up-GyD">
+                                <rect key="frame" x="145" y="95" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="40" id="A9m-mr-Ec3"/>
+                                    <constraint firstAttribute="height" constant="40" id="s6X-2m-m44"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="systemMintButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="aDb-dN-ifP"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="I7I-Ed-32n">
+                                <rect key="frame" x="145" y="150" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="Gd6-bt-nR7"/>
+                                    <constraint firstAttribute="width" constant="40" id="eRN-Vo-lal"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="systemPinkButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="emC-0N-gqJ"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="iB2-gu-3IO">
+                                <rect key="frame" x="145" y="205" width="40" height="40"/>
+                                <color key="backgroundColor" systemColor="labelColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="40" id="62A-PY-UZr"/>
+                                    <constraint firstAttribute="height" constant="40" id="P8F-Uh-nef"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                <connections>
+                                    <action selector="systemTealButtonAction:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="2ye-Wz-wur"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                        <constraints>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="I7I-Ed-32n" secondAttribute="trailing" constant="15" id="3ke-4j-aut"/>
+                            <constraint firstItem="12u-cu-XGu" firstAttribute="centerY" secondItem="8xv-8Y-A50" secondAttribute="centerY" id="3ns-C4-1Xk"/>
+                            <constraint firstItem="FU6-q8-9Iw" firstAttribute="centerY" secondItem="Zr2-rF-YUt" secondAttribute="centerY" id="4Ul-fS-EGZ"/>
+                            <constraint firstItem="iB2-gu-3IO" firstAttribute="centerY" secondItem="I9w-cx-QlY" secondAttribute="centerY" id="9Pw-x0-2Oc"/>
+                            <constraint firstItem="I9w-cx-QlY" firstAttribute="centerY" secondItem="C2a-jB-FVB" secondAttribute="centerY" id="Adb-Hg-6jK"/>
+                            <constraint firstItem="I7I-Ed-32n" firstAttribute="centerY" secondItem="LwF-26-oss" secondAttribute="centerY" id="HyJ-T6-sBi"/>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="iB2-gu-3IO" secondAttribute="trailing" constant="15" id="Ig3-DV-ieD"/>
+                            <constraint firstItem="Arw-up-GyD" firstAttribute="centerY" secondItem="FU6-q8-9Iw" secondAttribute="centerY" id="K5S-f9-g07"/>
+                            <constraint firstItem="C2a-jB-FVB" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="15" id="Lpi-y7-FCx"/>
+                            <constraint firstItem="OlH-Ak-sRA" firstAttribute="centerX" secondItem="vDu-zF-Fre" secondAttribute="centerX" id="T5p-2s-e2t"/>
+                            <constraint firstItem="I9w-cx-QlY" firstAttribute="centerX" secondItem="vDu-zF-Fre" secondAttribute="centerX" id="Vzf-ZI-4Y7"/>
+                            <constraint firstItem="Uaq-hC-U4a" firstAttribute="centerY" secondItem="8xv-8Y-A50" secondAttribute="centerY" id="WX1-7F-LZs"/>
+                            <constraint firstItem="JUR-Vj-yBU" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="15" id="ZH3-0g-M1x"/>
+                            <constraint firstItem="C2a-jB-FVB" firstAttribute="top" secondItem="dOn-SY-wnl" secondAttribute="bottom" constant="15" id="byc-af-adU"/>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="Arw-up-GyD" secondAttribute="trailing" constant="15" id="cyP-IZ-1wa"/>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="tt7-sI-TfL" secondAttribute="trailing" constant="15" id="dOh-Zh-y8X"/>
+                            <constraint firstItem="LwF-26-oss" firstAttribute="centerX" secondItem="vDu-zF-Fre" secondAttribute="centerX" id="eli-R1-TLW"/>
+                            <constraint firstItem="dOn-SY-wnl" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="15" id="gfe-aq-7nk"/>
+                            <constraint firstItem="kwJ-4R-6nM" firstAttribute="top" secondItem="vDu-zF-Fre" secondAttribute="top" constant="10" id="hAt-TC-6LC"/>
+                            <constraint firstItem="Zr2-rF-YUt" firstAttribute="top" secondItem="JUR-Vj-yBU" secondAttribute="bottom" constant="15" id="kLH-Zl-k0m"/>
+                            <constraint firstItem="tt7-sI-TfL" firstAttribute="centerY" secondItem="OlH-Ak-sRA" secondAttribute="centerY" id="ksI-o1-K8w"/>
+                            <constraint firstItem="LwF-26-oss" firstAttribute="centerY" secondItem="dOn-SY-wnl" secondAttribute="centerY" id="l31-GR-n7H"/>
+                            <constraint firstItem="12u-cu-XGu" firstAttribute="centerX" secondItem="vDu-zF-Fre" secondAttribute="centerX" id="qE7-PC-xCD"/>
+                            <constraint firstItem="kwJ-4R-6nM" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="10" id="rHM-tU-erV"/>
+                            <constraint firstItem="OlH-Ak-sRA" firstAttribute="centerY" secondItem="JUR-Vj-yBU" secondAttribute="centerY" id="rwN-7j-Caf"/>
+                            <constraint firstItem="8xv-8Y-A50" firstAttribute="top" secondItem="I9w-cx-QlY" secondAttribute="bottom" constant="15" id="tNf-9p-HHV"/>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="Uaq-hC-U4a" secondAttribute="trailing" constant="15" id="tzG-Kx-can"/>
+                            <constraint firstItem="dOn-SY-wnl" firstAttribute="top" secondItem="Zr2-rF-YUt" secondAttribute="bottom" constant="15" id="uIJ-Xj-Oe3"/>
+                            <constraint firstItem="FU6-q8-9Iw" firstAttribute="centerX" secondItem="vDu-zF-Fre" secondAttribute="centerX" id="vzc-ef-AhZ"/>
+                            <constraint firstItem="Zr2-rF-YUt" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="15" id="zBA-2T-5J8"/>
+                            <constraint firstItem="8xv-8Y-A50" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="15" id="zJA-Gg-OZr"/>
+                            <constraint firstItem="JUR-Vj-yBU" firstAttribute="top" secondItem="vDu-zF-Fre" secondAttribute="top" constant="40" id="zbI-KC-mx0"/>
+                        </constraints>
+                    </view>
+                    <size key="freeformSize" width="200" height="320"/>
+                    <connections>
+                        <outlet property="blueButton" destination="C2a-jB-FVB" id="lIY-Ag-Nkv"/>
+                        <outlet property="brownButton" destination="I9w-cx-QlY" id="b8T-np-0mw"/>
+                        <outlet property="closeButton" destination="kwJ-4R-6nM" id="woU-Kz-IXU"/>
+                        <outlet property="cyanButton" destination="OlH-Ak-sRA" id="26d-bc-OiU"/>
+                        <outlet property="defaultButton" destination="Uaq-hC-U4a" id="t6X-aV-hPF"/>
+                        <outlet property="grayButton" destination="LwF-26-oss" id="lzV-jY-LNd"/>
+                        <outlet property="greenButton" destination="8xv-8Y-A50" id="teG-ST-UCN"/>
+                        <outlet property="orangeButton" destination="JUR-Vj-yBU" id="aGO-8f-0Em"/>
+                        <outlet property="purpleButton" destination="dOn-SY-wnl" id="hes-XJ-gMJ"/>
+                        <outlet property="redButton" destination="Zr2-rF-YUt" id="jib-wX-2Of"/>
+                        <outlet property="systemBlueButton" destination="12u-cu-XGu" id="aOV-BK-urz"/>
+                        <outlet property="systemIndigoButton" destination="tt7-sI-TfL" id="tUi-Th-IDf"/>
+                        <outlet property="systemMintButton" destination="Arw-up-GyD" id="gqG-tN-WiJ"/>
+                        <outlet property="systemPinkButton" destination="I7I-Ed-32n" id="YzP-1f-nkJ"/>
+                        <outlet property="systemTealButton" destination="iB2-gu-3IO" id="S2F-rL-O44"/>
+                        <outlet property="yellowButton" destination="FU6-q8-9Iw" id="oAa-NT-Qhd"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-233.4375" y="50.70422535211268"/>
+        </scene>
+    </scenes>
+    <resources>
+        <image name="xmark" width="24" height="24"/>
+        <systemColor name="labelColor">
+            <color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 185 - 0
iOSClient/Color/NCColorPicker.swift

@@ -0,0 +1,185 @@
+//
+//  NCColorPicker.swift
+//  Nextcloud
+//
+//  Created by Marino Faggiana on 24/07/22.
+//  Copyright © 2022 Marino Faggiana. All rights reserved.
+//
+
+import Foundation
+import UIKit
+
+class NCColorPicker: UIViewController {
+
+    @IBOutlet weak var closeButton: UIButton!
+
+    @IBOutlet weak var orangeButton: UIButton!
+    @IBOutlet weak var redButton: UIButton!
+    @IBOutlet weak var purpleButton: UIButton!
+    @IBOutlet weak var blueButton: UIButton!
+    @IBOutlet weak var brownButton: UIButton!
+    @IBOutlet weak var greenButton: UIButton!
+    @IBOutlet weak var grayButton: UIButton!
+    @IBOutlet weak var cyanButton: UIButton!
+    @IBOutlet weak var yellowButton: UIButton!
+
+    @IBOutlet weak var systemIndigoButton: UIButton!
+    @IBOutlet weak var systemMintButton: UIButton!
+    @IBOutlet weak var systemPinkButton: UIButton!
+    @IBOutlet weak var systemTealButton: UIButton!
+    @IBOutlet weak var systemBlueButton: UIButton!
+
+    @IBOutlet weak var defaultButton: UIButton!
+
+    var metadata: tableMetadata?
+    var tapAction: UITapGestureRecognizer?
+
+    // MARK: - View Life Cycle
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+
+        view.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+
+        closeButton.setImage(NCUtility.shared.loadImage(named: "xmark", color: NCBrandColor.shared.label), for: .normal)
+
+        orangeButton.backgroundColor = .orange
+        orangeButton.layer.cornerRadius = 5
+        orangeButton.layer.masksToBounds = true
+
+        redButton.backgroundColor = .red
+        redButton.layer.cornerRadius = 5
+        redButton.layer.masksToBounds = true
+
+        purpleButton.backgroundColor = .purple
+        purpleButton.layer.cornerRadius = 5
+        purpleButton.layer.masksToBounds = true
+
+        blueButton.backgroundColor = .blue
+        blueButton.layer.cornerRadius = 5
+        blueButton.layer.masksToBounds = true
+
+        brownButton.backgroundColor = .brown
+        brownButton.layer.cornerRadius = 5
+        brownButton.layer.masksToBounds = true
+
+        greenButton.backgroundColor = .green
+        greenButton.layer.cornerRadius = 5
+        greenButton.layer.masksToBounds = true
+
+        grayButton.backgroundColor = .gray
+        grayButton.layer.cornerRadius = 5
+        grayButton.layer.masksToBounds = true
+
+        cyanButton.backgroundColor = .cyan
+        cyanButton.layer.cornerRadius = 5
+        cyanButton.layer.masksToBounds = true
+
+        yellowButton.backgroundColor = .yellow
+        yellowButton.layer.cornerRadius = 5
+        yellowButton.layer.masksToBounds = true
+
+        systemBlueButton.backgroundColor = NCBrandColor.shared.systemBlue
+        systemBlueButton.layer.cornerRadius = 5
+        systemBlueButton.layer.masksToBounds = true
+
+        systemMintButton.backgroundColor = NCBrandColor.shared.systemMint
+        systemMintButton.layer.cornerRadius = 5
+        systemMintButton.layer.masksToBounds = true
+
+        systemPinkButton.backgroundColor = NCBrandColor.shared.systemPink
+        systemPinkButton.layer.cornerRadius = 5
+        systemPinkButton.layer.masksToBounds = true
+
+        systemTealButton.backgroundColor = NCBrandColor.shared.systemTeal
+        systemTealButton.layer.cornerRadius = 5
+        systemTealButton.layer.masksToBounds = true
+
+        systemIndigoButton.backgroundColor = NCBrandColor.shared.systemIndigo
+        systemIndigoButton.layer.cornerRadius = 5
+        systemIndigoButton.layer.masksToBounds = true
+
+        defaultButton.backgroundColor = NCBrandColor.shared.brandElement
+        defaultButton.layer.cornerRadius = 5
+        defaultButton.layer.masksToBounds = true
+        defaultButton.layer.borderColor = NCBrandColor.shared.label.cgColor
+        defaultButton.layer.borderWidth = 2
+    }
+
+    // MARK: - Action
+
+    @IBAction func closeAction(_ sender: UIButton) {
+        dismiss(animated: true)
+    }
+
+    @IBAction func orangeButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: UIColor.orange.hexString)
+    }
+
+    @IBAction func redButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: UIColor.red.hexString)
+    }
+
+    @IBAction func purpleButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: UIColor.purple.hexString)
+    }
+
+    @IBAction func blueButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: UIColor.blue.hexString)
+    }
+
+    @IBAction func brownButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: UIColor.brown.hexString)
+    }
+
+    @IBAction func greenButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: UIColor.green.hexString)
+    }
+
+    @IBAction func grayButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: UIColor.gray.hexString)
+    }
+
+    @IBAction func cyanButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: UIColor.cyan.hexString)
+    }
+
+    @IBAction func yellowButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: UIColor.yellow.hexString)
+    }
+
+    @IBAction func systemIndigoButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: NCBrandColor.shared.systemIndigo.hexString)
+    }
+
+    @IBAction func systemMintButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: NCBrandColor.shared.systemMint.hexString)
+    }
+
+    @IBAction func systemPinkButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: NCBrandColor.shared.systemPink.hexString)
+    }
+
+    @IBAction func systemTealButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: NCBrandColor.shared.systemTeal.hexString)
+    }
+
+    @IBAction func systemBlueButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: NCBrandColor.shared.systemBlue.hexString)
+    }
+
+    @IBAction func defaultButtonAction(_ sender: AnyObject) {
+        updateColor(hexColor: nil)
+    }
+
+    func updateColor(hexColor: String?) {
+        if let metadata = metadata {
+            let serverUrl = metadata.serverUrl + "/" + metadata.fileName
+            if NCManageDatabase.shared.setDirectory(serverUrl: serverUrl, colorFolder: hexColor, account: metadata.account) != nil {
+                self.dismiss(animated: true)
+                NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource, userInfo: ["serverUrl": metadata.serverUrl])
+            }
+        }
+        self.dismiss(animated: true)
+    }
+}

+ 6 - 0
iOSClient/Data/NCDataSource.swift

@@ -436,6 +436,7 @@ class NCMetadataForSection: NSObject {
     public var totalSize: Int64 = 0
     public var metadataShare: [String: tableShare] = [:]
     public var metadataOffLine: [String] = []
+    public var directories: [tableDirectory]?
 
     init(sectionValue: String, metadatas: [tableMetadata], shares: [tableShare], localFiles: [tableLocalFile], lastSearchResult: NCCSearchResult?, sort: String, ascending: Bool, directoryOnTop: Bool, favoriteOnTop: Bool, filterLivePhoto: Bool) {
 
@@ -471,6 +472,8 @@ class NCMetadataForSection: NSObject {
         numFile = 0
         totalSize = 0
 
+        var ocIds: [String] = []
+
         // Metadata order
         //
         if sort != "none" && sort != "" {
@@ -548,6 +551,7 @@ class NCMetadataForSection: NSObject {
 
             //Info
             if metadata.directory {
+                ocIds.append(metadata.ocId)
                 numDirectory += 1
             } else {
                 numFile += 1
@@ -555,6 +559,8 @@ class NCMetadataForSection: NSObject {
             }
         }
 
+        directories = NCManageDatabase.shared.getTablesDirectory(predicate: NSPredicate(format: "ocId IN %@", ocIds), sorted: "serverUrl", ascending: true)
+
         metadatas.removeAll()
 
         // Struct view : favorite dir -> favorite file -> directory -> files

+ 1 - 4
iOSClient/Data/NCDatabase.swift

@@ -85,10 +85,6 @@ class tableAccount: Object, NCUserBaseUrl {
     @objc dynamic var website = ""
     @objc dynamic var zip = ""
 
-    // COLOR Files
-    @objc dynamic var darkColorBackground = ""
-    @objc dynamic var lightColorBackground = ""
-
     // HC
     @objc dynamic var hcIsTrial: Bool = false
     @objc dynamic var hcTrialExpired: Bool = false
@@ -260,6 +256,7 @@ class tableDirectEditingEditors: Object {
 class tableDirectory: Object {
 
     @objc dynamic var account = ""
+    @objc dynamic var colorFolder: String?
     @objc dynamic var e2eEncrypted: Bool = false
     @objc dynamic var etag = ""
     @objc dynamic var favorite: Bool = false

+ 0 - 72
iOSClient/Data/NCManageDatabase+Account.swift

@@ -373,62 +373,6 @@ extension NCManageDatabase {
         return tableAccount.init(value: returnAccount)
     }
 
-    /*
-    #if !EXTENSION
-    @objc func setAccountHCFeatures(_ features: HCFeatures) -> tableAccount? {
-        
-        let realm = try! Realm()
-        
-        var returnAccount = tableAccount()
-
-        do {
-            guard let account = self.getAccountActive() else {
-                return nil
-            }
-            
-            try realm.write {
-                
-                guard let result = realm.objects(tableAccount.self).filter("account == %@", account.account).first else {
-                    return
-                }
-                
-                result.hcIsTrial = features.isTrial
-                result.hcTrialExpired = features.trialExpired
-                result.hcTrialRemainingSec = features.trialRemainingSec
-                if features.trialEndTime > 0 {
-                    result.hcTrialEndTime = Date(timeIntervalSince1970: features.trialEndTime) as NSDate
-                } else {
-                    result.hcTrialEndTime = nil
-                }
-                
-                result.hcAccountRemoveExpired = features.accountRemoveExpired
-                result.hcAccountRemoveRemainingSec = features.accountRemoveRemainingSec
-                if features.accountRemoveTime > 0 {
-                    result.hcAccountRemoveTime = Date(timeIntervalSince1970: features.accountRemoveTime) as NSDate
-                } else {
-                    result.hcAccountRemoveTime = nil
-                }
-                
-                result.hcNextGroupExpirationGroup = features.nextGroupExpirationGroup
-                result.hcNextGroupExpirationGroupExpired = features.nextGroupExpirationGroupExpired
-                if features.nextGroupExpirationExpiresTime > 0 {
-                    result.hcNextGroupExpirationExpiresTime = Date(timeIntervalSince1970: features.nextGroupExpirationExpiresTime) as NSDate
-                } else {
-                    result.hcNextGroupExpirationExpiresTime = nil
-                }
-                result.hcNextGroupExpirationExpires = features.nextGroupExpirationExpires
-                
-                returnAccount = result
-            }
-        } catch let error {
-            print("[LOG] Could not write to database: ", error)
-        }
-        
-        return tableAccount.init(value: returnAccount)
-    }
-    #endif
-    */
-
     @objc func setAccountMediaPath(_ path: String, account: String) {
 
         let realm = try! Realm()
@@ -482,20 +426,4 @@ extension NCManageDatabase {
             NCCommunicationCommon.shared.writeLog("Could not write to database: \(error)")
         }
     }
-
-    @objc func setAccountColorFiles(lightColorBackground: String, darkColorBackground: String) {
-
-        let realm = try! Realm()
-
-        do {
-            try realm.safeWrite {
-                if let result = realm.objects(tableAccount.self).filter("active == true").first {
-                    result.lightColorBackground = lightColorBackground
-                    result.darkColorBackground = darkColorBackground
-                }
-            }
-        } catch let error {
-            NCCommunicationCommon.shared.writeLog("Could not write to database: \(error)")
-        }
-    }
 }

+ 23 - 18
iOSClient/Data/NCManageDatabase.swift

@@ -700,23 +700,6 @@ class NCManageDatabase: NSObject {
         return tableDirectory.init(value: directory)
     }
 
-    /*
-    @objc func addDirectoryRichWorkspace(ocId: String, richWorkspace: String?) {
-        
-        let realm = try! Realm()
-
-        do {
-            try realm.safeWrite {
-                if let result = realm.objects(tableDirectory.self).filter("ocId == %@", ocId).first {
-                    result.richWorkspace = richWorkspace
-                }
-            }
-        } catch let error {
-            NCCommunicationCommon.shared.writeLog("Could not write to database: \(error)")
-        }
-    }
-    */
-
     @objc func addDirectory(encrypted: Bool, favorite: Bool, ocId: String, fileId: String, etag: String? = nil, permissions: String? = nil, serverUrl: String, account: String) {
 
         let realm = try! Realm()
@@ -866,7 +849,7 @@ class NCManageDatabase: NSObject {
     }
 
     @discardableResult
-    @objc func setDirectory(richWorkspace: String?, serverUrl: String, account: String) -> tableDirectory? {
+    @objc func setDirectory(serverUrl: String, richWorkspace: String?, account: String) -> tableDirectory? {
 
         let realm = try! Realm()
         var result: tableDirectory?
@@ -887,6 +870,28 @@ class NCManageDatabase: NSObject {
         }
     }
 
+    @discardableResult
+    @objc func setDirectory(serverUrl: String, colorFolder: String?, account: String) -> tableDirectory? {
+
+        let realm = try! Realm()
+        var result: tableDirectory?
+
+        do {
+            try realm.safeWrite {
+                result = realm.objects(tableDirectory.self).filter("account == %@ AND serverUrl == %@", account, serverUrl).first
+                result?.colorFolder = colorFolder
+            }
+        } catch let error {
+            NCCommunicationCommon.shared.writeLog("Could not write to database: \(error)")
+        }
+
+        if let result = result {
+            return tableDirectory.init(value: result)
+        } else {
+            return nil
+        }
+    }
+
     // MARK: -
     // MARK: Table e2e Encryption
 

+ 13 - 0
iOSClient/Extensions/UIImage+Extensions.swift

@@ -227,4 +227,17 @@ extension UIImage {
 
         return newImage
     }
+
+    func colorizeFolder(metadata: tableMetadata, tableDirectory: tableDirectory? = nil) -> UIImage {
+        let serverUrl = metadata.serverUrl + "/" + metadata.fileName
+        var image = self
+        if let tableDirectory = tableDirectory {
+            if let hex = tableDirectory.colorFolder, let color = UIColor(hex: hex) {
+                image = self.imageColor(color)
+            }
+        } else if let tableDirectory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, serverUrl)), let hex = tableDirectory.colorFolder, let color = UIColor(hex: hex) {
+            image = self.imageColor(color)
+        }
+        return image
+    }
 }

+ 12 - 0
iOSClient/Images.xcassets/palette.imageset/Contents.json

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

File diff suppressed because it is too large
+ 0 - 0
iOSClient/Images.xcassets/palette.imageset/palette.svg


+ 3 - 12
iOSClient/Main/AudioRecorder/NCAudioRecorderViewController.swift

@@ -54,7 +54,9 @@ class NCAudioRecorderViewController: UIViewController, NCAudioRecorderDelegate {
         durationLabel.text = ""
         startStopLabel.text = NSLocalizedString("_voice_memo_start_", comment: "")
 
-        changeTheming()
+        view.backgroundColor = .clear
+        contentContainerView.backgroundColor = UIColor.lightGray
+        voiceRecordHUD.fillColor = UIColor.green
     }
 
     override func viewWillAppear(_ animated: Bool) {
@@ -63,17 +65,6 @@ class NCAudioRecorderViewController: UIViewController, NCAudioRecorderDelegate {
 
     override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
         super.traitCollectionDidChange(previousTraitCollection)
-
-        changeTheming()
-    }
-
-    // MARK: - Colors
-
-    func changeTheming() {
-
-        view.backgroundColor = .clear
-        contentContainerView.backgroundColor = UIColor.lightGray
-        voiceRecordHUD.fillColor = UIColor.green
     }
 
     // MARK: - Action

+ 17 - 108
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -26,7 +26,7 @@ import Realm
 import NCCommunication
 import EasyTipView
 
-class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UISearchResultsUpdating, UISearchControllerDelegate, UISearchBarDelegate, NCListCellDelegate, NCGridCellDelegate, NCSectionHeaderMenuDelegate, NCSectionFooterDelegate, UIAdaptivePresentationControllerDelegate, NCEmptyDataSetDelegate, UIContextMenuInteractionDelegate, NCAccountRequestDelegate, NCBackgroundImageColorDelegate, NCSelectableNavigationView {
+class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UISearchResultsUpdating, UISearchControllerDelegate, UISearchBarDelegate, NCListCellDelegate, NCGridCellDelegate, NCSectionHeaderMenuDelegate, NCSectionFooterDelegate, UIAdaptivePresentationControllerDelegate, NCEmptyDataSetDelegate, UIContextMenuInteractionDelegate, NCAccountRequestDelegate, NCSelectableNavigationView {
 
     @IBOutlet weak var collectionView: UICollectionView!
 
@@ -91,6 +91,11 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
 
         collectionView.alwaysBounceVertical = true
 
+        // Color
+        view.backgroundColor = NCBrandColor.shared.systemBackground
+        collectionView.backgroundColor = NCBrandColor.shared.systemBackground
+        refreshControl.tintColor = .gray
+
         if enableSearchBar {
             searchController = UISearchController(searchResultsController: nil)
             searchController?.searchResultsUpdater = self
@@ -152,7 +157,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
 
         // Notification
         NotificationCenter.default.addObserver(self, selector: #selector(initialize(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterInitialize), object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(changeThemingWithReloadData), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
+        NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
     }
 
     override func viewWillAppear(_ animated: Bool) {
@@ -258,21 +263,16 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
         super.viewWillTransition(to: size, with: coordinator)
 
-        coordinator.animate(alongsideTransition: nil) { _ in
+        //coordinator.animate(alongsideTransition: nil) { _ in
             self.collectionView?.collectionViewLayout.invalidateLayout()
-        }
+            self.collectionView?.reloadData()
+        //}
     }
 
     override var canBecomeFirstResponder: Bool {
         return true
     }
 
-    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
-        super.traitCollectionDidChange(previousTraitCollection)
-        // Toggle Appearance
-        changeTheming()
-    }
-
     // MARK: - NotificationCenter
 
     @objc func initialize(_ notification: NSNotification) {
@@ -317,49 +317,8 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         setNavigationItem()
     }
 
-    @objc func changeThemingWithReloadData() {
-
-        changeTheming()
-        collectionView.reloadData()
-    }
-    
     @objc func changeTheming() {
-
-        view.backgroundColor = NCBrandColor.shared.systemBackground
-        collectionView.backgroundColor = NCBrandColor.shared.systemBackground
-        refreshControl.tintColor = .gray
-
-        // IMAGE BACKGROUND
-        if let layoutForView = layoutForView, layoutForView.imageBackgroud != "" {
-            let imagePath = CCUtility.getDirectoryGroup().appendingPathComponent(NCGlobal.shared.appBackground).path + "/" + layoutForView.imageBackgroud
-            do {
-                let data = try Data(contentsOf: URL(fileURLWithPath: imagePath))
-                if let image = UIImage(data: data) {
-                    backgroundImageView.image = image
-                    backgroundImageView.contentMode = .scaleToFill
-                    collectionView.backgroundView = backgroundImageView
-                }
-            } catch { }
-        } else {
-            backgroundImageView.image = nil
-            collectionView.backgroundView = nil
-        }
-
-        // COLOR BACKGROUND
-        let activeAccount = NCManageDatabase.shared.getActiveAccount()
-        if traitCollection.userInterfaceStyle == .dark {
-            if activeAccount?.darkColorBackground != "" {
-                collectionView.backgroundColor = UIColor(hex: activeAccount?.darkColorBackground ?? "")
-            } else {
-                collectionView.backgroundColor = NCBrandColor.shared.systemBackground
-            }
-        } else {
-           if activeAccount?.lightColorBackground != "" {
-                collectionView.backgroundColor = UIColor(hex: activeAccount?.lightColorBackground ?? "")
-            } else {
-                collectionView.backgroundColor = NCBrandColor.shared.systemBackground
-            }
-        }
+        collectionView.reloadData()
     }
 
     @objc func reloadDataSource(_ notification: NSNotification) {
@@ -735,22 +694,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         return userAlias
     }
 
-    // MARK: - BackgroundImageColor Delegate
-
-    func colorPickerCancel() {
-        changeTheming()
-    }
-
-    func colorPickerWillChange(color: UIColor) {
-        collectionView.backgroundColor = color
-    }
-
-    func colorPickerDidChange(lightColor: String, darkColor: String) {
-
-        NCManageDatabase.shared.setAccountColorFiles(lightColorBackground: lightColor, darkColorBackground: darkColor)
-        changeTheming()
-    }
-
     // MARK: - Empty
 
     func emptyDataSetView(_ view: NCEmptyView) {
@@ -965,13 +908,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     @objc func longPressCollecationView(_ gestureRecognizer: UILongPressGestureRecognizer) {
 
         openMenuItems(with: nil, gestureRecognizer: gestureRecognizer)
-        /*
-        if #available(iOS 13.0, *) {
-            
-            let interaction = UIContextMenuInteraction(delegate: self)
-            self.view.addInteraction(interaction)
-        }
-        */
     }
 
     @available(iOS 13.0, *)
@@ -1002,11 +938,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         if serverUrl != "" {
             listMenuItems.append(UIMenuItem(title: NSLocalizedString("_paste_file_", comment: ""), action: #selector(pasteFilesMenu)))
         }
-        if #available(iOS 13.0, *) {
-            if !NCBrandOptions.shared.disable_background_color {
-                listMenuItems.append(UIMenuItem(title: NSLocalizedString("_background_", comment: ""), action: #selector(backgroundFilesMenu)))
-            }
-        }
 
         if listMenuItems.count > 0 {
             UIMenuController.shared.menuItems = listMenuItems
@@ -1024,11 +955,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                 return true
             }
         }
-
-        if #selector(backgroundFilesMenu) == action {
-            return true
-        }
-
         return false
     }
 
@@ -1036,24 +962,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         NCFunctionCenter.shared.pastePasteboard(serverUrl: serverUrl)
     }
 
-    @objc func backgroundFilesMenu() {
-
-        if let vcBackgroundImageColor = UIStoryboard(name: "NCBackgroundImageColor", bundle: nil).instantiateInitialViewController() as? NCBackgroundImageColor {
-
-            vcBackgroundImageColor.delegate = self
-            vcBackgroundImageColor.setupColor = collectionView.backgroundColor
-            if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
-                vcBackgroundImageColor.lightColor = activeAccount.lightColorBackground
-                vcBackgroundImageColor.darkColor = activeAccount.darkColorBackground
-            }
-
-            let popup = NCPopupViewController(contentController: vcBackgroundImageColor, popupWidth: vcBackgroundImageColor.width, popupHeight: vcBackgroundImageColor.height)
-            popup.backgroundAlpha = 0
-
-            self.present(popup, animated: true)
-        }
-    }
-
     // MARK: - DataSource + NC Endpoint
 
     @objc func reloadDataSource(forced: Bool = true) {
@@ -1171,7 +1079,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
             }
 
             if let metadataFolder = metadataFolder {
-                tableDirectory = NCManageDatabase.shared.setDirectory(richWorkspace: metadataFolder.richWorkspace, serverUrl: self.serverUrl, account: account)
+                tableDirectory = NCManageDatabase.shared.setDirectory(serverUrl: self.serverUrl, richWorkspace: metadataFolder.richWorkspace, account: account)
             }
             if forced || tableDirectory?.etag != metadataFolder?.etag || metadataFolder?.e2eEncrypted ?? false {
                 NCNetworking.shared.readFolder(serverUrl: self.serverUrl, account: self.appDelegate.account) { account, metadataFolder, metadatas, metadatasUpdate, _, metadatasDelete, errorCode, errorDescription in
@@ -1554,6 +1462,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
         guard let metadata = dataSource.cellForItemAt(indexPath: indexPath) else { return cell }
 
         let tableShare = dataSource.metadatasForSection[indexPath.section].metadataShare[metadata.ocId]
+        let tableDirectory = dataSource.metadatasForSection[indexPath.section].directories?.filter({ $0.ocId == metadata.ocId }).first
         var isShare = false
         var isMounted = false
         var a11yValues: [String] = []
@@ -1626,14 +1535,14 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
                 cell.filePreviewImageView?.image = NCBrandColor.cacheImages.folder
             }
 
-            let lockServerUrl = CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName)!
-            let tableDirectory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, lockServerUrl))
-
             // Local image: offline
-            if tableDirectory != nil && tableDirectory!.offline {
+            if let tableDirectory = tableDirectory, tableDirectory.offline {
                 cell.fileLocalImage?.image = NCBrandColor.cacheImages.offlineFlag
             }
 
+            // color folder
+            cell.filePreviewImageView?.image = cell.filePreviewImageView?.image?.colorizeFolder(metadata: metadata, tableDirectory: tableDirectory)
+
         } else {
 
             // image local

+ 4 - 39
iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift

@@ -79,6 +79,10 @@ class NCCreateFormUploadAssets: XLFormViewController, NCSelectDelegate {
 
         self.title = NSLocalizedString("_upload_photos_videos_", comment: "")
 
+        view.backgroundColor = NCBrandColor.shared.systemGroupedBackground
+        tableView.backgroundColor = NCBrandColor.shared.systemGroupedBackground
+        cellBackgoundColor = NCBrandColor.shared.secondarySystemGroupedBackground
+
         self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_cancel_", comment: ""), style: UIBarButtonItem.Style.plain, target: self, action: #selector(cancel))
         self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItem.Style.plain, target: self, action: #selector(save))
 
@@ -90,8 +94,6 @@ class NCCreateFormUploadAssets: XLFormViewController, NCSelectDelegate {
             })
         }
 
-        changeTheming()
-
         initializeForm()
         reloadForm()
     }
@@ -102,23 +104,6 @@ class NCCreateFormUploadAssets: XLFormViewController, NCSelectDelegate {
         self.delegate?.dismissFormUploadAssets()
     }
 
-    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
-        super.traitCollectionDidChange(previousTraitCollection)
-
-        changeTheming()
-    }
-
-    // MARK: - Theming
-
-    func changeTheming() {
-
-        view.backgroundColor = NCBrandColor.shared.systemGroupedBackground
-        tableView.backgroundColor = NCBrandColor.shared.systemGroupedBackground
-        cellBackgoundColor = NCBrandColor.shared.secondarySystemGroupedBackground
-
-        tableView.reloadData()
-    }
-
     // MARK: XLForm
 
     func initializeForm() {
@@ -335,26 +320,6 @@ class NCCreateFormUploadAssets: XLFormViewController, NCSelectDelegate {
         }
     }
 
-    /*
-    func save() {
-        
-        self.dismiss(animated: true, completion: {
-            
-            let useFolderPhotoRow : XLFormRowDescriptor  = self.form.formRow(withTag: "useFolderAutoUpload")!
-            let useSubFolderRow : XLFormRowDescriptor  = self.form.formRow(withTag: "useSubFolder")!
-            var useSubFolder : Bool = false
-            
-            if (useFolderPhotoRow.value! as AnyObject).boolValue == true {
-                
-                self.serverUrl = NCManageDatabase.shared.getAccountAutoUploadPath(urlBase: self.appDelegate.urlBase, account: self.appDelegate.account)
-                useSubFolder = (useSubFolderRow.value! as AnyObject).boolValue
-            }
-            
-            self.appDelegate.activeMain.uploadFileAsset(self.assets, serverUrl: self.serverUrl, useSubFolder: useSubFolder, session: self.session)
-        })
-    }
-    */
-
     @objc func save() {
 
         DispatchQueue.global().async {

+ 5 - 18
iOSClient/Main/Create cloud/NCCreateFormUploadConflict.swift

@@ -79,6 +79,11 @@ extension NCCreateFormUploadConflictDelegate {
         tableView.allowsSelection = false
         tableView.tableFooterView = UIView()
 
+        view.backgroundColor = NCBrandColor.shared.systemGroupedBackground
+        tableView.backgroundColor = NCBrandColor.shared.systemGroupedBackground
+        viewSwitch.backgroundColor = NCBrandColor.shared.systemGroupedBackground
+        viewButton.backgroundColor = NCBrandColor.shared.systemGroupedBackground
+
         tableView.register(UINib(nibName: "NCCreateFormUploadConflictCell", bundle: nil), forCellReuseIdentifier: "Cell")
 
         if metadatasUploadInConflict.count == 1 {
@@ -117,29 +122,11 @@ extension NCCreateFormUploadConflictDelegate {
         blurView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
         view.addSubview(blurView)
 
-        changeTheming()
-
         DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
             self.conflictDialog(fileCount: self.metadatasUploadInConflict.count)
         }
     }
 
-    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
-        super.traitCollectionDidChange(previousTraitCollection)
-
-        changeTheming()
-    }
-
-    // MARK: - Theming
-
-    func changeTheming() {
-
-        view.backgroundColor = NCBrandColor.shared.systemGroupedBackground
-        tableView.backgroundColor = NCBrandColor.shared.systemGroupedBackground
-        viewSwitch.backgroundColor = NCBrandColor.shared.systemGroupedBackground
-        viewButton.backgroundColor = NCBrandColor.shared.systemGroupedBackground
-    }
-
     // MARK: - ConflictDialog
 
     func conflictDialog(fileCount: Int) {

+ 6 - 20
iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift

@@ -65,6 +65,10 @@ import XLForm
 
         self.tableView.separatorStyle = UITableViewCell.SeparatorStyle.none
 
+        view.backgroundColor = NCBrandColor.shared.systemGroupedBackground
+        collectionView.backgroundColor = NCBrandColor.shared.systemGroupedBackground
+        tableView.backgroundColor = NCBrandColor.shared.secondarySystemGroupedBackground
+
         let cancelButton: UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_cancel_", comment: ""), style: UIBarButtonItem.Style.plain, target: self, action: #selector(cancel))
         let saveButton: UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItem.Style.plain, target: self, action: #selector(save))
 
@@ -75,31 +79,11 @@ import XLForm
         // title 
         self.title = titleForm
 
-        changeTheming()
-
         initializeForm()
-
-        // load the templates available
         getTemplate()
     }
 
-    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
-        super.traitCollectionDidChange(previousTraitCollection)
-
-        changeTheming()
-    }
-
-    // MARK: - Theming
-
-    func changeTheming() {
-
-        view.backgroundColor = NCBrandColor.shared.systemGroupedBackground
-        collectionView.backgroundColor = NCBrandColor.shared.systemGroupedBackground
-        tableView.backgroundColor = NCBrandColor.shared.secondarySystemGroupedBackground
 
-        tableView.reloadData()
-        collectionView.reloadData()
-    }
 
     // MARK: - Tableview (XLForm)
 
@@ -149,6 +133,8 @@ import XLForm
         section.addFormRow(row)
 
         self.form = form
+        //tableView.reloadData()
+        //collectionView.reloadData()
     }
 
     override func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {

+ 4 - 19
iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift

@@ -71,6 +71,10 @@ class NCCreateFormUploadScanDocument: XLFormViewController, NCSelectDelegate, NC
 
         self.title = NSLocalizedString("_save_settings_", comment: "")
 
+        view.backgroundColor = NCBrandColor.shared.systemGroupedBackground
+        tableView.backgroundColor = NCBrandColor.shared.systemGroupedBackground
+        cellBackgoundColor = NCBrandColor.shared.secondarySystemGroupedBackground
+
         let saveButton: UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItem.Style.plain, target: self, action: #selector(save))
         self.navigationItem.rightBarButtonItem = saveButton
 
@@ -85,31 +89,12 @@ class NCCreateFormUploadScanDocument: XLFormViewController, NCSelectDelegate, NC
         //        let rowCell = row.cell(forForm: self)
         //        rowCell.becomeFirstResponder()
 
-        changeTheming()
-
         initializeForm()
 
         let value = CCUtility.getTextRecognitionStatus()
         setTextRecognition(newValue: value)
     }
 
-    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
-        super.traitCollectionDidChange(previousTraitCollection)
-
-        changeTheming()
-    }
-
-    // MARK: - Theming
-
-    @objc func changeTheming() {
-
-        view.backgroundColor = NCBrandColor.shared.systemGroupedBackground
-        tableView.backgroundColor = NCBrandColor.shared.systemGroupedBackground
-        cellBackgoundColor = NCBrandColor.shared.secondarySystemGroupedBackground
-
-        tableView.reloadData()
-    }
-
     // MARK: XLForm
 
     func initializeForm() {

+ 4 - 20
iOSClient/Main/Create cloud/NCCreateFormUploadVoiceNote.swift

@@ -55,7 +55,10 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
 
         self.tableView.separatorStyle = UITableViewCell.SeparatorStyle.none
 
-        // title
+        view.backgroundColor = NCBrandColor.shared.systemGroupedBackground
+        tableView.backgroundColor = NCBrandColor.shared.systemGroupedBackground
+        cellBackgoundColor = NCBrandColor.shared.secondarySystemGroupedBackground
+
         self.title = NSLocalizedString("_voice_memo_title_", comment: "")
 
         // Button Play Stop
@@ -69,8 +72,6 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
         labelTimer.textColor = NCBrandColor.shared.label
         labelDuration.textColor = NCBrandColor.shared.label
 
-        changeTheming()
-
         initializeForm()
     }
 
@@ -88,23 +89,6 @@ class NCCreateFormUploadVoiceNote: XLFormViewController, NCSelectDelegate, AVAud
         }
     }
 
-    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
-        super.traitCollectionDidChange(previousTraitCollection)
-
-        changeTheming()
-    }
-
-    // MARK: - Theming
-
-    @objc func changeTheming() {
-
-        view.backgroundColor = NCBrandColor.shared.systemGroupedBackground
-        tableView.backgroundColor = NCBrandColor.shared.systemGroupedBackground
-        cellBackgoundColor = NCBrandColor.shared.secondarySystemGroupedBackground
-
-        tableView.reloadData()
-    }
-
     public func setup(serverUrl: String, fileNamePath: String, fileName: String) {
 
         if serverUrl == NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account) {

+ 1 - 39
iOSClient/Main/NCFunctionCenter.swift

@@ -109,10 +109,7 @@ import Photos
             
         case NCGlobal.shared.selectorSaveAlbum:
             saveAlbum(metadata: metadata)
-            
-        case NCGlobal.shared.selectorSaveBackground:
-            saveBackground(metadata: metadata)
-            
+
         case NCGlobal.shared.selectorSaveAlbumLivePhotoIMG, NCGlobal.shared.selectorSaveAlbumLivePhotoMOV:
 
             var metadata = metadata
@@ -383,25 +380,6 @@ import Photos
         })
     }
 
-    func saveBackground(metadata: tableMetadata) {
-
-        let fileNamePath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
-        let destination = CCUtility.getDirectoryGroup().appendingPathComponent(NCGlobal.shared.appBackground).path + "/" + metadata.fileNameView
-
-        if NCUtilityFileSystem.shared.copyFile(atPath: fileNamePath, toPath: destination) {
-
-            if appDelegate.activeViewController is NCCollectionViewCommon {
-                let viewController: NCCollectionViewCommon = appDelegate.activeViewController as! NCCollectionViewCommon
-                let layoutKey = viewController.layoutKey
-                let serverUrl = viewController.serverUrl
-                if serverUrl == metadata.serverUrl {
-                    NCUtility.shared.setBackgroundImageForView(key: layoutKey, serverUrl: serverUrl, imageBackgroud: metadata.fileNameView, imageBackgroudContentMode: "")
-                    viewController.changeTheming()
-                }
-            }
-        }
-    }
-
     // MARK: - Copy & Paste
 
     func copyPasteboard(pasteboardOcIds: [String], hudView: UIView) {
@@ -654,14 +632,6 @@ import Photos
             }
         }
 
-        let saveBackground = UIAction(title: NSLocalizedString("_use_as_background_", comment: ""), image: UIImage(systemName: "text.below.photo")) { _ in
-            if CCUtility.fileProviderStorageExists(metadata) {
-                self.saveBackground(metadata: metadata)
-            } else {
-                NCOperationQueue.shared.download(metadata: metadata, selector: NCGlobal.shared.selectorSaveBackground)
-            }
-        }
-
         let viewInFolder = UIAction(title: NSLocalizedString("_view_in_folder_", comment: ""), image: UIImage(systemName: "arrow.forward.square")) { _ in
             self.openFileViewInFolder(serverUrl: metadata.serverUrl, fileName: metadata.fileName)
         }
@@ -781,14 +751,6 @@ import Photos
             children.insert(modify, at: children.count - 1)
         }
 
-        if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue && viewController is NCCollectionViewCommon && !NCBrandOptions.shared.disable_background_image {
-            let viewController: NCCollectionViewCommon = viewController as! NCCollectionViewCommon
-            let layoutKey = viewController.layoutKey
-            if layoutKey == NCGlobal.shared.layoutViewFiles {
-                children.insert(saveBackground, at: children.count - 1)
-            }
-        }
-
         let submenu = UIMenu(title: "", options: .displayInline, children: children)
         guard appDelegate.disableSharesView == false else { return submenu }
         return UIMenu(title: "", children: [detail, submenu])

+ 0 - 20
iOSClient/Main/NCMainNavigationController.swift

@@ -30,25 +30,6 @@ class NCMainNavigationController: UINavigationController {
     required init?(coder: NSCoder) {
         super.init(coder: coder)
 
-        NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
-
-        changeTheming()
-    }
-
-    override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-    }
-
-    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
-        super.traitCollectionDidChange(previousTraitCollection)
-
-        changeTheming()
-    }
-
-    // MARK: - Theming
-
-    @objc func changeTheming() {
-
         if #available(iOS 13.0, *) {
 
             let appearance = UINavigationBarAppearance()
@@ -72,6 +53,5 @@ class NCMainNavigationController: UINavigationController {
         }
 
         navigationBar.tintColor = .systemBlue
-        navigationBar.setNeedsLayout()
     }
 }

+ 20 - 23
iOSClient/Menu/NCCollectionViewCommon+Menu.swift

@@ -271,29 +271,6 @@ extension NCCollectionViewCommon {
             actions.append(.copyAction(selectOcId: [metadata.ocId], hudView: self.view))
         }
         
-        /*
-        //
-        // USE AS BACKGROUND
-        //
-        if #available(iOS 13.0, *) {
-            if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue && self.layoutKey == NCGlobal.shared.layoutViewFiles && !NCBrandOptions.shared.disable_background_image {
-                actions.append(
-                    NCMenuAction(
-                        title: NSLocalizedString("_use_as_background_", comment: ""),
-                        icon: NCUtility.shared.loadImage(named: "text.below.photo"),
-                        action: { menuAction in
-                            if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
-                                NCFunctionCenter.shared.saveBackground(metadata: metadata)
-                            } else {
-                                NCOperationQueue.shared.download(metadata: metadata, selector: NCGlobal.shared.selectorSaveBackground)
-                            }
-                        }
-                    )
-                )
-            }
-        }
-        */
-
         //
         // MODIFY
         //
@@ -317,6 +294,26 @@ extension NCCollectionViewCommon {
             }
         }
 
+        //
+        // COLOR FOLDER
+        //
+        if metadata.directory {
+            actions.append(
+                NCMenuAction(
+                    title: NSLocalizedString("_change_color_", comment: ""),
+                    icon: NCUtility.shared.loadImage(named: "palette"),
+                    action: { _ in
+                        if let picker = UIStoryboard(name: "NCColorPicker", bundle: nil).instantiateInitialViewController() as? NCColorPicker {
+                            picker.metadata = metadata
+                            let popup = NCPopupViewController(contentController: picker, popupWidth: 200, popupHeight: 320)
+                            popup.backgroundAlpha = 0
+                            self.present(popup, animated: true)
+                        }
+                    }
+                )
+            )
+        }
+        
         //
         // DELETE
         //

+ 1 - 4
iOSClient/NCGlobal.swift

@@ -79,8 +79,6 @@ class NCGlobal: NSObject {
         var directoryOnTop: Bool
         var titleButtonHeader: String
         var itemForLine: Int
-        var imageBackgroud: String
-        var imageBackgroudContentMode: String
     }
 
     // Directory on Group
@@ -115,7 +113,7 @@ class NCGlobal: NSObject {
     // Database Realm
     //
     let databaseDefault                             = "nextcloud.realm"
-    let databaseSchemaVersion: UInt64               = 230
+    let databaseSchemaVersion: UInt64               = 235
 
     // Intro selector
     //
@@ -292,7 +290,6 @@ class NCGlobal: NSObject {
     let selectorUploadFile                          = "uploadFile"
     let selectorUploadFileShareExtension            = "uploadFileShareExtension"
     let selectorSaveAlbum                           = "saveAlbum"
-    let selectorSaveBackground                      = "saveBackground"
     let selectorSaveAlbumLivePhotoIMG               = "saveAlbumLivePhotoIMG"
     let selectorSaveAlbumLivePhotoMOV               = "saveAlbumLivePhotoMOV"
     let selectorSaveAsScan                          = "saveAsScan"

+ 1 - 1
iOSClient/Networking/NCNetworking.swift

@@ -736,7 +736,7 @@ import Photos
 
                 // Update directory
                 NCManageDatabase.shared.addDirectory(encrypted: metadataFolder.e2eEncrypted, favorite: metadataFolder.favorite, ocId: metadataFolder.ocId, fileId: metadataFolder.fileId, etag: metadataFolder.etag, permissions: metadataFolder.permissions, serverUrl: serverUrl, account: metadataFolder.account)
-                NCManageDatabase.shared.setDirectory(richWorkspace: metadataFolder.richWorkspace, serverUrl: serverUrl, account: metadataFolder.account)
+                NCManageDatabase.shared.setDirectory(serverUrl: serverUrl, richWorkspace: metadataFolder.richWorkspace, account: metadataFolder.account)
 
                 // Update sub directories NO Update richWorkspace
                 for metadata in metadatasFolder {

+ 0 - 8
iOSClient/Notification/NCNotification.swift

@@ -49,10 +49,6 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate, NCEmpty
         // Empty
         let offset = (self.navigationController?.navigationBar.bounds.height ?? 0) - 20
         emptyDataSet = NCEmptyDataSet(view: tableView, offset: -offset, delegate: self)
-
-        NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
-
-        changeTheming()
     }
 
     override func viewWillAppear(_ animated: Bool) {
@@ -86,10 +82,6 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate, NCEmpty
         getNetwokingNotification()
     }
 
-    @objc func changeTheming() {
-        tableView.reloadData()
-    }
-
     // MARK: - Empty
 
     func emptyDataSetView(_ view: NCEmptyView) {

+ 1 - 1
iOSClient/RichWorkspace/NCViewerRichWorkspace.swift

@@ -64,7 +64,7 @@ import MarkdownKit
 
             if errorCode == 0 && account == self.appDelegate.account {
                 guard let metadata = metadata else { return }
-                NCManageDatabase.shared.setDirectory(richWorkspace: metadata.richWorkspace, serverUrl: self.serverUrl, account: account)
+                NCManageDatabase.shared.setDirectory(serverUrl: self.serverUrl, richWorkspace: metadata.richWorkspace, account: account)
                 if self.richWorkspaceText != metadata.richWorkspace && metadata.richWorkspace != nil {
                     self.appDelegate.activeFiles?.richWorkspaceText = self.richWorkspaceText
                     self.richWorkspaceText = metadata.richWorkspace!

+ 3 - 25
iOSClient/Select/NCSelect.swift

@@ -95,6 +95,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
         self.navigationController?.presentationController?.delegate = self
 
         view.backgroundColor = NCBrandColor.shared.systemBackground
+        selectCommandViewSelect?.separatorView.backgroundColor = NCBrandColor.shared.separator
 
         activeAccount = NCManageDatabase.shared.getActiveAccount()
 
@@ -156,11 +157,8 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
             bottomContraint?.constant = 150
         }
 
-        NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(reloadDataSource), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterReloadDataSource), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(createFolder(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterCreateFolder), object: nil)
-
-        changeTheming()
     }
 
     override func viewWillAppear(_ animated: Bool) {
@@ -205,12 +203,6 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
 
     // MARK: - NotificationCenter
 
-    @objc func changeTheming() {
-
-        collectionView.reloadData()
-        selectCommandViewSelect?.separatorView.backgroundColor = NCBrandColor.shared.separator
-    }
-
     @objc func createFolder(_ notification: NSNotification) {
 
         guard let userInfo = notification.userInfo as NSDictionary?,
@@ -460,17 +452,10 @@ extension NCSelect: UICollectionViewDataSource {
                 } else {
                     cell.imageItem.image = NCBrandColor.cacheImages.folder
                 }
+                cell.imageItem.image = cell.imageItem.image?.colorizeFolder(metadata: metadata)
 
                 cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date)
 
-                let lockServerUrl = CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName)!
-                let tableDirectory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", activeAccount.account, lockServerUrl))
-
-                // Local image: offline
-                if tableDirectory != nil && tableDirectory!.offline {
-                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
-                }
-
             } else {
 
                 cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date) + " · " + CCUtility.transformedSize(metadata.size)
@@ -561,14 +546,7 @@ extension NCSelect: UICollectionViewDataSource {
                 } else {
                     cell.imageItem.image = NCBrandColor.cacheImages.folder
                 }
-
-                let lockServerUrl = CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName)!
-                let tableDirectory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", activeAccount.account, lockServerUrl))
-
-                // Local image: offline
-                if tableDirectory != nil && tableDirectory!.offline {
-                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
-                }
+                cell.imageItem.image = cell.imageItem.image?.colorizeFolder(metadata: metadata)
 
             } else {
 

+ 0 - 9
iOSClient/Share/NCShare.swift

@@ -92,11 +92,6 @@ class NCShare: UIViewController, NCShareNetworkingDelegate, NCSharePagingContent
             let isVisible = (self.navigationController?.topViewController as? NCSharePaging)?.indexPage == .sharing
             networking?.readShare(showLoadingIndicator: isVisible)
         }
-
-        // changeTheming
-        NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
-
-        changeTheming()
     }
 
     func makeNewLinkShare() {
@@ -177,10 +172,6 @@ class NCShare: UIViewController, NCShareNetworkingDelegate, NCSharePagingContent
         self.showProfileMenu(userId: metadata.ownerId)
     }
 
-    @objc func changeTheming() {
-        tableView.reloadData()
-    }
-
     // MARK: -
 
     @objc func reloadData() {

+ 5 - 8
iOSClient/Share/NCSharePaging.swift

@@ -95,9 +95,11 @@ class NCSharePaging: UIViewController {
         let pagingIndexItem = self.pagingViewController(pagingViewController, pagingItemAt: indexPage.rawValue) as? PagingIndexItem
         self.title = pagingIndexItem?.title
 
-        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(self.orientationDidChange), name: UIDevice.orientationDidChangeNotification, object: nil)
-        changeTheming()
+
+        pagingViewController.indicatorColor = NCBrandColor.shared.brandElement
+        (pagingViewController.view as? NCSharePagingView)?.setupConstraints()
+        pagingViewController.reloadMenu()
     }
 
     func setupCapabilities() {
@@ -158,12 +160,6 @@ class NCSharePaging: UIViewController {
         currentVC?.textField?.resignFirstResponder()
     }
 
-    @objc func changeTheming() {
-        pagingViewController.indicatorColor = NCBrandColor.shared.brandElement
-        (pagingViewController.view as? NCSharePagingView)?.setupConstraints()
-        pagingViewController.reloadMenu()
-    }
-
     // MARK: - Keyboard & TextField
     @objc func keyboardWillShow(notification: Notification) {
          let frameEndUserInfoKey = UIResponder.keyboardFrameEndUserInfoKey
@@ -319,6 +315,7 @@ class NCSharePagingView: PagingView {
             if metadata.directory {
                 let image = UIImage(named: "folder")
                 headerView.imageView.image = image?.image(color: NCBrandColor.shared.brandElement, size: image?.size.width ?? 0)
+                headerView.imageView.image = headerView.imageView.image?.colorizeFolder(metadata: metadata)
             } else if !metadata.iconName.isEmpty {
                 headerView.imageView.image = UIImage(named: metadata.iconName)
             } else {

+ 2 - 2
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -875,8 +875,8 @@
 "_waiting_for_"             = "Waiting for:";
 "_reachable_wifi_"          = "network reachable via Wi-Fi or cable";
 "_ITMS-90076_"              = "Due to a change in the Nextcloud application identifier, the settings and password for accessing your cloud are reset, so please re-enter your account data and check your Settings. We are sorry about that.";
-"_copy_passphrase_"        = "Copy passphrase";
-
+"_copy_passphrase_"         = "Copy passphrase";
+"_change_color_"            = "Change color";
 
 // Video
 "_select_trace_"            = "Select the trace";

+ 0 - 7
iOSClient/Trash/NCTrash.swift

@@ -78,10 +78,7 @@ class NCTrash: UIViewController, NCSelectableNavigationView, NCTrashListCellDele
         // Empty
         emptyDataSet = NCEmptyDataSet(view: collectionView, offset: NCGlobal.shared.heightButtonsView + NCGlobal.shared.heightButtonsCommand, delegate: self)
 
-        NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(reloadDataSource), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterReloadDataSource), object: nil)
-
-        changeTheming()
     }
 
     override func viewWillAppear(_ animated: Bool) {
@@ -116,10 +113,6 @@ class NCTrash: UIViewController, NCSelectableNavigationView, NCTrashListCellDele
         }
     }
 
-    @objc func changeTheming() {
-        collectionView.reloadData()
-    }
-
     // MARK: - Empty
 
     func emptyDataSetView(_ view: NCEmptyView) {

+ 3 - 16
iOSClient/UserStatus/NCUserStatus.swift

@@ -77,6 +77,9 @@ class NCUserStatus: UIViewController {
 
         self.navigationItem.title = NSLocalizedString("_online_status_", comment: "")
 
+        view.backgroundColor = NCBrandColor.shared.systemBackground
+        tableView.backgroundColor = NCBrandColor.shared.systemBackground
+
         buttonCancel.title = NSLocalizedString("_close_", comment: "")
 
         onlineButton.layer.cornerRadius = 10
@@ -165,12 +168,6 @@ class NCUserStatus: UIViewController {
         getStatus()
     }
 
-    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
-        super.traitCollectionDidChange(previousTraitCollection)
-
-        changeTheming()
-    }
-
     override func viewWillDisappear(_ animated: Bool) {
         super.viewWillDisappear(animated)
 
@@ -193,16 +190,6 @@ class NCUserStatus: UIViewController {
         }
     }
 
-    // MARK: - Theming
-
-    @objc func changeTheming() {
-
-        view.backgroundColor = NCBrandColor.shared.systemBackground
-        tableView.backgroundColor = NCBrandColor.shared.systemBackground
-
-        tableView.reloadData()
-    }
-
     // MARK: ACTION
 
     @IBAction func actionCancel(_ sender: UIBarButtonItem) {

+ 1 - 1
iOSClient/Utility/CCUtility.m

@@ -1383,7 +1383,7 @@
             if (directory.e2eEncrypted == true) {
                 return true;
             }
-            serverUrl = [[NCUtilityFileSystem shared]  deletingLastPathComponentWithAccount:account serverUrl:serverUrl];
+            serverUrl = [[NCUtilityFileSystem shared] deletingLastPathComponentWithAccount:account serverUrl:serverUrl];
             directory = [[NCManageDatabase shared] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", account, serverUrl]];
         }
         

+ 2 - 19
iOSClient/Utility/NCUtility.swift

@@ -43,7 +43,7 @@ class NCUtility: NSObject {
 
     func setLayoutForView(key: String, serverUrl: String, layoutForView: NCGlobal.layoutForViewType) {
 
-        let string =  layoutForView.layout + "|" + layoutForView.sort + "|" + "\(layoutForView.ascending)" + "|" + layoutForView.groupBy + "|" + "\(layoutForView.directoryOnTop)" + "|" + layoutForView.titleButtonHeader + "|" + "\(layoutForView.itemForLine)" + "|" + layoutForView.imageBackgroud + "|" + layoutForView.imageBackgroudContentMode
+        let string =  layoutForView.layout + "|" + layoutForView.sort + "|" + "\(layoutForView.ascending)" + "|" + layoutForView.groupBy + "|" + "\(layoutForView.directoryOnTop)" + "|" + layoutForView.titleButtonHeader + "|" + "\(layoutForView.itemForLine)"
         var keyStore = key
 
         if serverUrl != "" {
@@ -63,20 +63,10 @@ class NCUtility: NSObject {
         }
     }
 
-    func setBackgroundImageForView(key: String, serverUrl: String, imageBackgroud: String, imageBackgroudContentMode: String) {
-
-        var layoutForView: NCGlobal.layoutForViewType = NCUtility.shared.getLayoutForView(key: key, serverUrl: serverUrl)
-
-        layoutForView.imageBackgroud = imageBackgroud
-        layoutForView.imageBackgroudContentMode = imageBackgroudContentMode
-
-        setLayoutForView(key: key, serverUrl: serverUrl, layoutForView: layoutForView)
-    }
-
     func getLayoutForView(key: String, serverUrl: String, sort: String = "fileName", ascending: Bool = true, titleButtonHeader: String = "_sorted_by_name_a_z_") -> (NCGlobal.layoutForViewType) {
 
         var keyStore = key
-        var layoutForView: NCGlobal.layoutForViewType = NCGlobal.layoutForViewType(layout: NCGlobal.shared.layoutList, sort: sort, ascending: ascending, groupBy: "none", directoryOnTop: true, titleButtonHeader: titleButtonHeader, itemForLine: 3, imageBackgroud: "", imageBackgroudContentMode: "")
+        var layoutForView: NCGlobal.layoutForViewType = NCGlobal.layoutForViewType(layout: NCGlobal.shared.layoutList, sort: sort, ascending: ascending, groupBy: "none", directoryOnTop: true, titleButtonHeader: titleButtonHeader, itemForLine: 3)
 
         if serverUrl != "" {
             keyStore = serverUrl
@@ -97,13 +87,6 @@ class NCUtility: NSObject {
             layoutForView.directoryOnTop = NSString(string: array[4]).boolValue
             layoutForView.titleButtonHeader = array[5]
             layoutForView.itemForLine = Int(NSString(string: array[6]).intValue)
-            // version 2
-            if array.count > 8 {
-                layoutForView.imageBackgroud = array[7]
-                layoutForView.imageBackgroudContentMode = array[8]
-                // layoutForView.lightColorBackground = array[9] WAS STRING
-                // layoutForView.darkColorBackground = array[10] WAS STRING
-            }
         }
 
         return layoutForView

+ 3 - 4
iOSClient/Utility/NCUtilityFileSystem.swift

@@ -173,10 +173,9 @@ class NCUtilityFileSystem: NSObject {
     }
 
     @objc func deletingLastPathComponent(account: String, serverUrl: String) -> String {
-        if getHomeServer(account: account) == serverUrl { return serverUrl }
-        let fileName = (serverUrl as NSString).lastPathComponent
-        let serverUrl = serverUrl.replacingOccurrences(of: "/"+fileName, with: "", options: String.CompareOptions.backwards, range: nil)
-        return serverUrl
+
+        guard getHomeServer(account: account) != serverUrl, let url = URL(string: serverUrl) else { return serverUrl }
+        return String(url.deletingLastPathComponent().absoluteString.dropLast())
     }
 
     @objc func createFileName(_ fileName: String, serverUrl: String, account: String) -> String {

+ 0 - 16
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift

@@ -487,27 +487,11 @@ class NCPlayerToolBar: UIView {
     @IBAction func tapForward(_ sender: Any) {
 
         skip(seconds: 10)
-
-        /*
-         if metadata?.classFile == NCCommunicationCommon.typeClassFile.video.rawValue {
-         skip(seconds: 10)
-         } else if metadata?.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
-         forward()
-         }
-         */
     }
 
     @IBAction func tapBack(_ sender: Any) {
 
         skip(seconds: -10)
-
-        /*
-         if metadata?.classFile == NCCommunicationCommon.typeClassFile.video.rawValue {
-         skip(seconds: -10)
-         } else if metadata?.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
-         backward()
-         }
-         */
     }
 
     @IBAction func tapSubtitle(_ sender: Any) {

+ 0 - 24
iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift

@@ -83,7 +83,6 @@ class NCViewerMediaPage: UIViewController {
         let viewerMedia = getViewerMedia(index: currentIndex, metadata: metadatas[currentIndex])
         pageViewController.setViewControllers([viewerMedia], direction: .forward, animated: true, completion: nil)
 
-        NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(viewUnload), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterMenuDetailClose), object: nil)
 
         progressView.tintColor = NCBrandColor.shared.brandElement
@@ -295,9 +294,6 @@ class NCViewerMediaPage: UIViewController {
         }
     }
 
-    @objc func changeTheming() {
-    }
-
     @objc func hidePlayerToolBar(_ notification: NSNotification) {
 
         if let userInfo = notification.userInfo as NSDictionary?, let ocId = userInfo["ocId"] as? String {
@@ -378,26 +374,6 @@ class NCViewerMediaPage: UIViewController {
             }
         }
 
-        // AUDIO < >
-        /*
-        if metadata?.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
-                        
-            MPRemoteCommandCenter.shared().nextTrackCommand.isEnabled = true
-            appDelegate.nextTrackCommand = MPRemoteCommandCenter.shared().nextTrackCommand.addTarget { event in
-                
-                self.forward()
-                return .success
-            }
-            
-            MPRemoteCommandCenter.shared().previousTrackCommand.isEnabled = true
-            appDelegate.previousTrackCommand = MPRemoteCommandCenter.shared().previousTrackCommand.addTarget { event in
-             
-                self.backward()
-                return .success
-            }
-        }
-        */
-
         nowPlayingInfo[MPMediaItemPropertyTitle] = metadata.fileNameView
         nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = ncplayer.durationTime.seconds
         if let image = currentViewController.image {

+ 1 - 1
iOSClient/Viewer/NCViewerProviderContextMenu.swift

@@ -58,7 +58,7 @@ class NCViewerProviderContextMenu: UIViewController {
                 imageFolder =  image.image(color: NCBrandColor.shared.brandElement, size: sizeIcon*2)
             }
 
-            imageView.image = imageFolder
+            imageView.image = imageFolder.colorizeFolder(metadata: metadata)
             imageView.frame = resize(CGSize(width: sizeIcon, height: sizeIcon))
 
         } else {

Some files were not shown because too many files changed in this diff