Browse Source

clear

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 years ago
parent
commit
7b7fb89429

+ 2 - 0
iOSClient/Files/NCFiles.swift

@@ -46,6 +46,7 @@ class NCFiles: NCCollectionViewCommon {
     }
     }
 
 
     override func viewWillAppear(_ animated: Bool) {
     override func viewWillAppear(_ animated: Bool) {
+
         if isRoot {
         if isRoot {
             serverUrl = NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account)
             serverUrl = NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account)
             titleCurrentFolder = getNavigationTitle()
             titleCurrentFolder = getNavigationTitle()
@@ -56,6 +57,7 @@ class NCFiles: NCCollectionViewCommon {
     // MARK: - NotificationCenter
     // MARK: - NotificationCenter
 
 
     override func initialize(_ notification: NSNotification) {
     override func initialize(_ notification: NSNotification) {
+
         if isRoot {
         if isRoot {
             serverUrl = NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account)
             serverUrl = NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account)
             titleCurrentFolder = getNavigationTitle()
             titleCurrentFolder = getNavigationTitle()

+ 11 - 11
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -224,6 +224,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
     }
 
 
     func presentationControllerDidDismiss( _ presentationController: UIPresentationController) {
     func presentationControllerDidDismiss( _ presentationController: UIPresentationController) {
+
         let viewController = presentationController.presentedViewController
         let viewController = presentationController.presentedViewController
         if viewController is NCViewerRichWorkspaceWebView {
         if viewController is NCViewerRichWorkspaceWebView {
             closeRichWorkspaceWebView()
             closeRichWorkspaceWebView()
@@ -293,7 +294,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
     }
 
 
     @objc func changeThemingWithReloadData() {
     @objc func changeThemingWithReloadData() {
-        
+
         changeTheming()
         changeTheming()
         collectionView.reloadData()
         collectionView.reloadData()
     }
     }
@@ -630,6 +631,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
 
 
     @objc func setNavigationItem() {
     @objc func setNavigationItem() {
         self.setNavigationHeader()
         self.setNavigationHeader()
+
         guard !isEditMode, layoutKey == NCGlobal.shared.layoutViewFiles else { return }
         guard !isEditMode, layoutKey == NCGlobal.shared.layoutViewFiles else { return }
         
         
         // PROFILE BUTTON
         // PROFILE BUTTON
@@ -689,6 +691,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
     }
 
 
     func getNavigationTitle() -> String {
     func getNavigationTitle() -> String {
+
         let activeAccount = NCManageDatabase.shared.getActiveAccount()
         let activeAccount = NCManageDatabase.shared.getActiveAccount()
         guard let userAlias = activeAccount?.alias, !userAlias.isEmpty else {
         guard let userAlias = activeAccount?.alias, !userAlias.isEmpty else {
             return NCBrandOptions.shared.brand
             return NCBrandOptions.shared.brand
@@ -709,7 +712,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     func colorPickerDidChange(lightColor: String, darkColor: String) {
     func colorPickerDidChange(lightColor: String, darkColor: String) {
 
 
         NCManageDatabase.shared.setAccountColorFiles(lightColorBackground: lightColor, darkColorBackground: darkColor)
         NCManageDatabase.shared.setAccountColorFiles(lightColorBackground: lightColor, darkColorBackground: darkColor)
-
         changeTheming()
         changeTheming()
     }
     }
 
 
@@ -746,17 +748,14 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     // MARK: - SEARCH
     // MARK: - SEARCH
 
 
     func updateSearchResults(for searchController: UISearchController) {
     func updateSearchResults(for searchController: UISearchController) {
-
         self.literalSearch = searchController.searchBar.text
         self.literalSearch = searchController.searchBar.text
     }
     }
 
 
     func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
     func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
 
 
         self.isSearching = true
         self.isSearching = true
-
         self.providers?.removeAll()
         self.providers?.removeAll()
         self.dataSource.clearDataSource()
         self.dataSource.clearDataSource()
-
         self.collectionView.reloadData()
         self.collectionView.reloadData()
 
 
     }
     }
@@ -785,6 +784,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     // MARK: - TAP EVENT
     // MARK: - TAP EVENT
 
 
     func accountRequestChangeAccount(account: String) {
     func accountRequestChangeAccount(account: String) {
+
         NCManageDatabase.shared.setAccountActive(account)
         NCManageDatabase.shared.setAccountActive(account)
         if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
         if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
 
 
@@ -837,6 +837,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
     }
 
 
     func tapButton1(_ sender: Any) {
     func tapButton1(_ sender: Any) {
+
         NCAskAuthorization.shared.askAuthorizationPhotoLibrary(viewController: self) { hasPermission in
         NCAskAuthorization.shared.askAuthorizationPhotoLibrary(viewController: self) { hasPermission in
             if hasPermission {
             if hasPermission {
                 NCPhotosPickerViewController.init(viewController: self, maxSelectedAssets: 0, singleSelectedMode: false)
                 NCPhotosPickerViewController.init(viewController: self, maxSelectedAssets: 0, singleSelectedMode: false)
@@ -845,12 +846,14 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
     }
 
 
     func tapButton2(_ sender: Any) {
     func tapButton2(_ sender: Any) {
+
         guard !appDelegate.activeServerUrl.isEmpty else { return }
         guard !appDelegate.activeServerUrl.isEmpty else { return }
         let alertController = UIAlertController.createFolder(serverUrl: appDelegate.activeServerUrl, urlBase: appDelegate)
         let alertController = UIAlertController.createFolder(serverUrl: appDelegate.activeServerUrl, urlBase: appDelegate)
         appDelegate.window?.rootViewController?.present(alertController, animated: true, completion: nil)
         appDelegate.window?.rootViewController?.present(alertController, animated: true, completion: nil)
     }
     }
 
 
     func tapButton3(_ sender: Any) {
     func tapButton3(_ sender: Any) {
+
         if #available(iOS 13.0, *) {
         if #available(iOS 13.0, *) {
             if let viewController = appDelegate.window?.rootViewController {
             if let viewController = appDelegate.window?.rootViewController {
                 NCCreateScanDocument.shared.openScannerDocument(viewController: viewController)
                 NCCreateScanDocument.shared.openScannerDocument(viewController: viewController)
@@ -859,7 +862,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
     }
 
 
     func tapMoreListItem(with objectId: String, namedButtonMore: String, image: UIImage?, sender: Any) {
     func tapMoreListItem(with objectId: String, namedButtonMore: String, image: UIImage?, sender: Any) {
-
         tapMoreGridItem(with: objectId, namedButtonMore: namedButtonMore, image: image, sender: sender)
         tapMoreGridItem(with: objectId, namedButtonMore: namedButtonMore, image: image, sender: sender)
     }
     }
 
 
@@ -898,7 +900,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
     }
 
 
     func tapButtonSection(_ sender: Any, metadataForSection: NCMetadataForSection?) {
     func tapButtonSection(_ sender: Any, metadataForSection: NCMetadataForSection?) {
-
         unifiedSearchMore(metadataForSection: metadataForSection)
         unifiedSearchMore(metadataForSection: metadataForSection)
     }
     }
 
 
@@ -1389,8 +1390,8 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
 
 
     @available(iOS 13.0, *)
     @available(iOS 13.0, *)
     func collectionView(_ collectionView: UICollectionView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) {
     func collectionView(_ collectionView: UICollectionView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) {
-        animator.addCompletion {
 
 
+        animator.addCompletion {
             if let indexPath = configuration.identifier as? IndexPath {
             if let indexPath = configuration.identifier as? IndexPath {
                 self.collectionView(collectionView, didSelectItemAt: indexPath)
                 self.collectionView(collectionView, didSelectItemAt: indexPath)
             }
             }
@@ -1479,15 +1480,14 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
         }
         }
     }
     }
 
 
-    func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
-
-    }
+    func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { }
 
 
     func numberOfSections(in collectionView: UICollectionView) -> Int {
     func numberOfSections(in collectionView: UICollectionView) -> Int {
         return dataSource.numberOfSections()
         return dataSource.numberOfSections()
     }
     }
 
 
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        
         let numberItems = dataSource.numberOfItemsInSection(section)
         let numberItems = dataSource.numberOfItemsInSection(section)
         emptyDataSet?.numberOfItemsInSection(numberItems, section: section)
         emptyDataSet?.numberOfItemsInSection(numberItems, section: section)
         return numberItems
         return numberItems