Browse Source

new Favorite view

marinofaggiana 4 years ago
parent
commit
27bbd762da

+ 12 - 10
Nextcloud.xcodeproj/project.pbxproj

@@ -22,7 +22,7 @@
 		3757A35523D9D76300EC369E /* NCMenuPanelController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3757A35423D9D76300EC369E /* NCMenuPanelController.swift */; };
 		3781B9B023DB2B7E006B4B1D /* AppDelegate+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3781B9AF23DB2B7E006B4B1D /* AppDelegate+Menu.swift */; };
 		3781B9B223DB2B9F006B4B1D /* CCMain+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3781B9B123DB2B9F006B4B1D /* CCMain+Menu.swift */; };
-		3781B9B423DB2BC9006B4B1D /* CCFavorites+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3781B9B323DB2BC9006B4B1D /* CCFavorites+Menu.swift */; };
+		3781B9B423DB2BC9006B4B1D /* NCFavorite+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3781B9B323DB2BC9006B4B1D /* NCFavorite+Menu.swift */; };
 		37C83A0D24532B7200618A3B /* AppDelegate+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C83A0C24532B7200618A3B /* AppDelegate+Swift.swift */; };
 		37C83A0F24532BA600618A3B /* CCMain+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C83A0E24532BA600618A3B /* CCMain+Swift.swift */; };
 		37ECC83B23D0C7410082EFA2 /* NCMenuAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37ECC83A23D0C7400082EFA2 /* NCMenuAction.swift */; };
@@ -82,6 +82,8 @@
 		F7169A1E1EE590930086BD69 /* NCSharesCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7169A1B1EE590930086BD69 /* NCSharesCell.xib */; };
 		F716FE7823795E5000FABE50 /* NCCommunication.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F716FE7723795E5000FABE50 /* NCCommunication.framework */; settings = {ATTRIBUTES = (Required, ); }; };
 		F716FE7A23795EC500FABE50 /* FileProviderExtension+NetworkingDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F716FE7923795EC500FABE50 /* FileProviderExtension+NetworkingDelegate.swift */; };
+		F717402D24F699A5000C87D5 /* NCFavorite.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F717402B24F699A5000C87D5 /* NCFavorite.storyboard */; };
+		F717402E24F699A5000C87D5 /* NCFavorite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F717402C24F699A5000C87D5 /* NCFavorite.swift */; };
 		F7226EDC1EE4089300EBECB1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7226EDB1EE4089300EBECB1 /* Main.storyboard */; };
 		F722814323C8C34500C41898 /* NCRichWorkspace.xib in Resources */ = {isa = PBXBuildFile; fileRef = F722814223C8C34500C41898 /* NCRichWorkspace.xib */; };
 		F723B3DD22FC6D1D00301EFE /* NCShareCommentsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F723B3DC22FC6D1C00301EFE /* NCShareCommentsCell.xib */; };
@@ -241,7 +243,6 @@
 		F79918A221997FA300C2E308 /* UICKeyChainStore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F79918A021997F9000C2E308 /* UICKeyChainStore.framework */; };
 		F79A65C32191D90F00FF6DCC /* NCSelect.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F79A65C22191D90F00FF6DCC /* NCSelect.storyboard */; };
 		F79A65C62191D95E00FF6DCC /* NCSelect.swift in Sources */ = {isa = PBXBuildFile; fileRef = F79A65C52191D95E00FF6DCC /* NCSelect.swift */; };
-		F7A321551E9E2A070069AD1B /* CCFavorites.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A3214F1E9E2A070069AD1B /* CCFavorites.m */; };
 		F7A321AD1E9E6AD50069AD1B /* CCAdvanced.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A321AC1E9E6AD50069AD1B /* CCAdvanced.m */; };
 		F7AE00F5230D5F9E007ACF8A /* NCLoginWeb.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7AE00F4230D5F9E007ACF8A /* NCLoginWeb.swift */; };
 		F7AE00F8230E81CB007ACF8A /* NCBrowserWeb.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7AE00F7230E81CB007ACF8A /* NCBrowserWeb.swift */; };
@@ -361,7 +362,7 @@
 		3757A35423D9D76300EC369E /* NCMenuPanelController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMenuPanelController.swift; sourceTree = "<group>"; };
 		3781B9AF23DB2B7E006B4B1D /* AppDelegate+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppDelegate+Menu.swift"; sourceTree = "<group>"; };
 		3781B9B123DB2B9F006B4B1D /* CCMain+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CCMain+Menu.swift"; sourceTree = "<group>"; };
-		3781B9B323DB2BC9006B4B1D /* CCFavorites+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CCFavorites+Menu.swift"; sourceTree = "<group>"; };
+		3781B9B323DB2BC9006B4B1D /* NCFavorite+Menu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCFavorite+Menu.swift"; sourceTree = "<group>"; };
 		37C83A0C24532B7200618A3B /* AppDelegate+Swift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppDelegate+Swift.swift"; sourceTree = "<group>"; };
 		37C83A0E24532BA600618A3B /* CCMain+Swift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CCMain+Swift.swift"; sourceTree = "<group>"; };
 		37ECC83A23D0C7400082EFA2 /* NCMenuAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMenuAction.swift; sourceTree = "<group>"; };
@@ -424,6 +425,8 @@
 		F7169A4C1EE59C640086BD69 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Localizable.strings; sourceTree = "<group>"; };
 		F716FE7723795E5000FABE50 /* NCCommunication.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NCCommunication.framework; path = Carthage/Build/iOS/NCCommunication.framework; sourceTree = "<group>"; };
 		F716FE7923795EC500FABE50 /* FileProviderExtension+NetworkingDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FileProviderExtension+NetworkingDelegate.swift"; sourceTree = "<group>"; };
+		F717402B24F699A5000C87D5 /* NCFavorite.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCFavorite.storyboard; sourceTree = "<group>"; };
+		F717402C24F699A5000C87D5 /* NCFavorite.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCFavorite.swift; sourceTree = "<group>"; };
 		F7226EDB1EE4089300EBECB1 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
 		F722814223C8C34500C41898 /* NCRichWorkspace.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCRichWorkspace.xib; sourceTree = "<group>"; };
 		F7229B491DF71BB300E8C4E7 /* AUTHORS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AUTHORS; sourceTree = SOURCE_ROOT; };
@@ -604,8 +607,6 @@
 		F79918A72199840500C2E308 /* Sheeeeeeeeet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sheeeeeeeeet.framework; path = Carthage/Build/iOS/Sheeeeeeeeet.framework; sourceTree = "<group>"; };
 		F79A65C22191D90F00FF6DCC /* NCSelect.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCSelect.storyboard; sourceTree = "<group>"; };
 		F79A65C52191D95E00FF6DCC /* NCSelect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCSelect.swift; sourceTree = "<group>"; };
-		F7A3214E1E9E2A070069AD1B /* CCFavorites.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFavorites.h; sourceTree = "<group>"; };
-		F7A3214F1E9E2A070069AD1B /* CCFavorites.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CCFavorites.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
 		F7A321AB1E9E6AD50069AD1B /* CCAdvanced.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAdvanced.h; sourceTree = "<group>"; };
 		F7A321AC1E9E6AD50069AD1B /* CCAdvanced.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAdvanced.m; sourceTree = "<group>"; };
 		F7A54C341C6267B500E2C8BF /* CCExifGeo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCExifGeo.h; sourceTree = "<group>"; };
@@ -799,7 +800,7 @@
 			isa = PBXGroup;
 			children = (
 				3781B9AF23DB2B7E006B4B1D /* AppDelegate+Menu.swift */,
-				3781B9B323DB2BC9006B4B1D /* CCFavorites+Menu.swift */,
+				3781B9B323DB2BC9006B4B1D /* NCFavorite+Menu.swift */,
 				3781B9B123DB2B9F006B4B1D /* CCMain+Menu.swift */,
 				F710D2012405826100A6033D /* NCDetailNavigationController+Menu.swift */,
 				371B5A2D23D0B04500FAFAE9 /* NCMainMenuTableViewController.swift */,
@@ -1122,8 +1123,8 @@
 		F7A3214D1E9E2A070069AD1B /* Favorites */ = {
 			isa = PBXGroup;
 			children = (
-				F7A3214E1E9E2A070069AD1B /* CCFavorites.h */,
-				F7A3214F1E9E2A070069AD1B /* CCFavorites.m */,
+				F717402B24F699A5000C87D5 /* NCFavorite.storyboard */,
+				F717402C24F699A5000C87D5 /* NCFavorite.swift */,
 			);
 			path = Favorites;
 			sourceTree = "<group>";
@@ -1805,6 +1806,7 @@
 				F76D3CF32428B94E005DFA87 /* NCViewerPDFSearchCell.xib in Resources */,
 				F769453E22E9E97E000A798A /* NCShareUserMenuView.xib in Resources */,
 				F749C10E23C4A5340027D966 /* NCIntroCollectionViewCell.xib in Resources */,
+				F717402D24F699A5000C87D5 /* NCFavorite.storyboard in Resources */,
 				F723B3DD22FC6D1D00301EFE /* NCShareCommentsCell.xib in Resources */,
 				F78ACD4B21903F850088454D /* NCTrashListCell.xib in Resources */,
 				F700510122DF63AC003A3356 /* NCShare.storyboard in Resources */,
@@ -2088,7 +2090,7 @@
 				F79A65C62191D95E00FF6DCC /* NCSelect.swift in Sources */,
 				F7E0E1DC22327885006B0911 /* NCAudioRecorderViewController.swift in Sources */,
 				F70CAE3A1F8CF31A008125FD /* NCEndToEndEncryption.m in Sources */,
-				3781B9B423DB2BC9006B4B1D /* CCFavorites+Menu.swift in Sources */,
+				3781B9B423DB2BC9006B4B1D /* NCFavorite+Menu.swift in Sources */,
 				F710D1F924057C9D00A6033D /* NCDetailViewController.swift in Sources */,
 				F7AE00F5230D5F9E007ACF8A /* NCLoginWeb.swift in Sources */,
 				F7B2DEF01F976854007CF4D2 /* NYMnemonic.m in Sources */,
@@ -2096,7 +2098,6 @@
 				F7BAADCB1ED5A87C00B7EAD4 /* NCManageDatabase.swift in Sources */,
 				F79018B9240962C7007C9B6D /* NCViewerImageContentTransformers.swift in Sources */,
 				F70968A424212C4E00ED60E5 /* NCLivePhoto.swift in Sources */,
-				F7A321551E9E2A070069AD1B /* CCFavorites.m in Sources */,
 				F704FA5C232A343F00BBA952 /* IMImagemeterViewer.swift in Sources */,
 				370D26B1248A3E1A00121797 /* CCCellMain.swift in Sources */,
 				F7CA1ED220E7E3FE002CC65E /* PKCircleView.m in Sources */,
@@ -2119,6 +2120,7 @@
 				F70D8D8124A4A9BF000A5756 /* NCNetworkingAutoUpload.swift in Sources */,
 				F7D96FCC246ED7E200536D73 /* NCNetworkingCheckRemoteUser.swift in Sources */,
 				F7E4D9C422ED929B003675FD /* NCShareComments.swift in Sources */,
+				F717402E24F699A5000C87D5 /* NCFavorite.swift in Sources */,
 				37C83A0D24532B7200618A3B /* AppDelegate+Swift.swift in Sources */,
 				F77B0ED51D118A16002130FE /* PHAsset+Utility.m in Sources */,
 				F77B0ED91D118A16002130FE /* main.m in Sources */,

+ 2 - 2
iOSClient/AppDelegate.h

@@ -31,12 +31,12 @@
 #import "CCUtility.h"
 #import "CCMain.h"
 #import "CCSettings.h"
-#import "CCFavorites.h"
 #import "CCTransfers.h"
 
 @class CCMore;
 @class NCMedia;
 @class NCOffline;
+@class NCFavorite;
 @class NCAppConfigView;
 @class IMImagemeterViewer;
 @class NCDetailViewController;
@@ -86,7 +86,7 @@
 
 @property (nonatomic, strong) CCMain *activeMain;
 @property (nonatomic, strong) CCMain *homeMain;
-@property (nonatomic, strong) CCFavorites *activeFavorites;
+@property (nonatomic, strong) NCFavorite *activeFavorite;
 @property (nonatomic, strong) NCMedia *activeMedia;
 @property (nonatomic, retain) NCDetailViewController *activeDetail;
 @property (nonatomic, retain) CCTransfers *activeTransfers;

+ 2 - 2
iOSClient/AppDelegate.m

@@ -884,8 +884,8 @@
                 if (index == k_tabBarApplicationIndexFile) {
                     serverUrl = self.activeMain.serverUrl;
                 } else if (index == k_tabBarApplicationIndexFavorite) {
-                    if (self.activeFavorites.serverUrl)
-                        serverUrl = self.activeFavorites.serverUrl;
+                    if (self.activeFavorite.serverUrl)
+                        serverUrl = self.activeFavorite.serverUrl;
                 } else if (index == k_tabBarApplicationIndexMedia) {
                     serverUrl = [[NCManageDatabase sharedInstance] getAccountAutoUploadPathWithUrlBase:self.urlBase account:self.account];
                 }

+ 1 - 0
iOSClient/CCGlobal.h

@@ -270,6 +270,7 @@
 #define k_layout_view_richdocument                      @"LayoutRichdocument"
 #define k_layout_view_trash                             @"LayoutTrash"
 #define k_layout_view_offline                           @"LayoutOffline"
+#define k_layout_view_favorite                          @"LayoutFavorite"
 
 // Rich Workspace
 #define k_fileNameRichWorkspace                         @"Readme.md"

+ 0 - 46
iOSClient/Favorites/CCFavorites.h

@@ -1,46 +0,0 @@
-//
-//  CCFavorites.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 16/01/17.
-//  Copyright (c) 2017 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <UIKit/UIKit.h>
-#import <DZNEmptyDataSet/UIScrollView+EmptyDataSet.h>
-
-#import "CCUtility.h"
-#import "CCMain.h"
-#import "CCGraphics.h"
-
-@class tableMetadata;
-
-@interface CCFavorites : UIViewController <UITableViewDataSource, UITableViewDelegate, UIActionSheetDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate, MGSwipeTableCellDelegate, UIViewControllerPreviewingDelegate>
-
-@property (nonatomic, weak) IBOutlet UITableView *tableView;
-
-@property (nonatomic, strong) tableMetadata *metadata;
-@property (nonatomic, strong) tableMetadata *metadataForPushDetail;
-@property (nonatomic, strong) NSString *selectorForPushDetail;
-@property (nonatomic, strong) NSString *serverUrl;
-@property (nonatomic, strong) NSString *titleViewControl;
-
-- (void)shouldPerformSegue:(tableMetadata *)metadata selector:(NSString *)selector;
-- (void)actionDelete:(NSIndexPath *)indexPath;
-
-@end

+ 0 - 650
iOSClient/Favorites/CCFavorites.m

@@ -1,650 +0,0 @@
-//
-//  CCFavorites.m
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 16/01/17.
-//  Copyright (c) 2017 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 "CCFavorites.h"
-#import "AppDelegate.h"
-
-#import "NCBridgeSwift.h"
-
-@interface CCFavorites ()
-{
-    AppDelegate *appDelegate;
-    
-    // Automatic Upload Folder
-    NSString *autoUploadFileName;
-    NSString *autoUploadDirectory;
-    
-    UIDocumentInteractionController *docController;
-    
-    // Datasource
-    CCSectionDataSourceMetadata *sectionDataSource;
-    
-    BOOL livePhoto;
-}
-@end
-
-@implementation CCFavorites
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Init =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (id)initWithCoder:(NSCoder *)aDecoder
-{
-    if (self = [super initWithCoder:aDecoder])  {
-        appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-        appDelegate.activeFavorites = self;
-    }
-    return self;
-}
-
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
-    
-    [self.tableView registerNib:[UINib nibWithNibName:@"CCCellMain" bundle:nil] forCellReuseIdentifier:@"CellMain"];
-    [self.tableView registerNib:[UINib nibWithNibName:@"CCCellMainTransfer" bundle:nil] forCellReuseIdentifier:@"CellMainTransfer"];
-    
-    // Notification
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(triggerProgressTask:) name:k_notificationCenter_progressTask object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:k_notificationCenter_changeTheming object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDatasource) name:k_notificationCenter_reloadDataSource object:nil];
-
-    // Metadata
-    self.metadata = [tableMetadata new];
-    
-    self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 1)];
-    self.tableView.emptyDataSetDelegate = self;
-    self.tableView.emptyDataSetSource = self;
-    self.tableView.delegate = self;
-    self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 35, 0);
-
-    // Register for 3D Touch Previewing if available
-    if ([self.traitCollection respondsToSelector:@selector(forceTouchCapability)] && (self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable))
-    {
-        [self registerForPreviewingWithDelegate:self sourceView:self.view];
-    }
-    
-    // calculate _serverUrl
-    if (!_serverUrl) {
-        _serverUrl = nil;
-    }
-    
-    // Title
-    if (_titleViewControl)
-        self.title = _titleViewControl;
-    else
-        self.title = NSLocalizedString(@"_favorites_", nil);
-    
-    [self changeTheming];
-}
-
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-    [self reloadDatasource];
-}
-
-- (void)viewDidAppear:(BOOL)animated
-{
-    [super viewDidAppear:animated];
-    
-    // Active Main
-    appDelegate.activeFavorites = self;
-
-    // test
-    if (appDelegate.account.length == 0) {
-        return;
-    }
-    
-    if (self.serverUrl == nil) {
-        [[NCNetworking shared] listingFavoritescompletionWithSelector:(selectorListingFavorite) completion:^(NSString *account, NSArray *metadatas, NSInteger errorCode, NSString *errorDescription) {
-            for (tableMetadata *metadata in metadatas) {
-                if (!metadata.directory && CCUtility.getFavoriteOffline) {
-                    tableLocalFile *localFile = [[NCManageDatabase sharedInstance] getTableLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", metadata.ocId]];
-                    if (localFile == nil || ![localFile.etag isEqualToString:metadata.etag]) {
-                        [[NCOperationQueue shared] downloadWithMetadata:metadata selector:selectorDownloadFile setFavorite:false];
-                    }
-                }
-            }
-            [self reloadDatasource];
-        }];
-    } else {
-        [[NCNetworking shared] readFolderWithServerUrl:self.serverUrl account:appDelegate.account completion:^(NSString *account, tableMetadata *metadataFolder, NSArray *metadatas, NSArray *metadatasUpdate, NSArray *metadatasLocalUpdate, NSInteger errorCode, NSString *errorDescription) {
-            if (errorCode == 0) {
-                for (tableMetadata *metadata in metadatas) {
-                    if (!metadata.directory && CCUtility.getFavoriteOffline) {
-                        tableLocalFile *localFile = [[NCManageDatabase sharedInstance] getTableLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", metadata.ocId]];
-                        if (localFile == nil || ![localFile.etag isEqualToString:metadata.etag]) {
-                            [[NCOperationQueue shared] downloadWithMetadata:metadata selector:selectorDownloadFile setFavorite:false];
-                        }
-                    }
-                }
-                [self reloadDatasource];
-            }
-        }];
-    }
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== NotificationCenter ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)triggerProgressTask:(NSNotification *)notification
-{
-    if (sectionDataSource.ocIdIndexPath != nil) {
-        [[NCMainCommon sharedInstance] triggerProgressTask:notification sectionDataSourceocIdIndexPath:sectionDataSource.ocIdIndexPath tableView:self.tableView viewController:self serverUrlViewController:self.serverUrl];
-    }
-}
-
-- (void)changeTheming
-{
-    [appDelegate changeTheming:self tableView:self.tableView collectionView:nil form:false];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== DZNEmptyDataSetSource ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView
-{
-    //CGFloat height = self.tabBarController.tabBar.frame.size.height;
-    return 0;
-}
-
-- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView
-{
-    return NCBrandColor.sharedInstance.backgroundView;
-}
-
-- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
-{
-    return [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"favorite"] width:300 height:300 color:NCBrandColor.sharedInstance.yellowFavorite];
-}
-
-- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
-{
-    NSString *text = [NSString stringWithFormat:@"%@", NSLocalizedString(@"_favorite_no_files_", nil)];
-    
-    NSDictionary *attributes = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:20.0f], NSForegroundColorAttributeName:[UIColor lightGrayColor]};
-    
-    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
-}
-
-- (NSAttributedString *)descriptionForEmptyDataSet:(UIScrollView *)scrollView
-{
-    NSString *text = [NSString stringWithFormat:@"\n%@", NSLocalizedString(@"_tutorial_favorite_view_", nil)];
-    
-    NSMutableParagraphStyle *paragraph = [NSMutableParagraphStyle new];
-    paragraph.lineBreakMode = NSLineBreakByWordWrapping;
-    paragraph.alignment = NSTextAlignmentCenter;
-    
-    NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:14.0], NSForegroundColorAttributeName: [UIColor lightGrayColor], NSParagraphStyleAttributeName: paragraph};
-    
-    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
-}
-
-- (void)tapActionComment:(UITapGestureRecognizer *)tapGesture
-{
-    CGPoint location = [tapGesture locationInView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location];
-    
-    tableMetadata *metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    if (metadata) {
-        [[NCMainCommon sharedInstance] openShareWithViewController:self metadata:metadata indexPage:1];
-    }
-}
-
-- (void)tapActionShared:(UITapGestureRecognizer *)tapGesture
-{
-    CGPoint location = [tapGesture locationInView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location];
-    
-    tableMetadata *metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    if (metadata) {
-        [[NCMainCommon sharedInstance] openShareWithViewController:self metadata:metadata indexPage:2];
-    }
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Progress & Task Button =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)cancelTaskButton:(id)sender withEvent:(UIEvent *)event
-{
-    UITouch *touch = [[event allTouches] anyObject];
-    CGPoint location = [touch locationInView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location];
-    
-    if ([[NCMainCommon sharedInstance] isValidIndexPath:indexPath view:self.tableView]) {
-        
-        tableMetadata *metadataSection = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-        
-        if (metadataSection) {
-            
-            tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", metadataSection.ocId]];
-            if (metadata)
-                [[NCMainCommon sharedInstance] cancelTransferMetadata:metadata reloadDatasource:true uploadStatusForcedStart:false];
-        }
-    }
-}
-
-- (void)cancelAllTask:(id)sender
-{
-    CGPoint location = [sender locationInView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:location];
-    
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
-    
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_all_task_", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
-        [NCUtility.shared startActivityIndicatorWithView:self.view bottom:0];
-        [[NCMainCommon sharedInstance] cancelAllTransfer];
-        [NCUtility.shared stopActivityIndicator];
-    }]];
-    
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { }]];
-    
-    alertController.popoverPresentationController.sourceView = self.tableView;
-    alertController.popoverPresentationController.sourceRect = [self.tableView rectForRowAtIndexPath:indexPath];
-    
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
-        [alertController.view layoutIfNeeded];
-    
-    [self presentViewController:alertController animated:YES completion:nil];
-}
-
-#pragma mark -
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Peek & Pop  =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext viewControllerForLocation:(CGPoint)location
-{
-    CGPoint convertedLocation = [self.view convertPoint:location toView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:convertedLocation];
-    tableMetadata *metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    CCCellMain *cell = [self.tableView cellForRowAtIndexPath:indexPath];
-    
-    if (cell) {
-        previewingContext.sourceRect = cell.frame;
-        CCPeekPop *viewController = [[UIStoryboard storyboardWithName:@"CCPeekPop" bundle:nil] instantiateViewControllerWithIdentifier:@"PeekPopImagePreview"];
-        
-        viewController.metadata = metadata;
-        viewController.imageFile = cell.file.image;
-        viewController.showOpenIn = true;
-        viewController.showShare = false;
-        viewController.showOpenQuickLook = [[NCUtility shared] isQuickLookDisplayableWithMetadata:metadata];
-       
-        return viewController;
-    }
-    
-    return nil;
-}
-
-- (void)previewingContext:(id<UIViewControllerPreviewing>)previewingContext commitViewController:(UIViewController *)viewControllerToCommit
-{
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:previewingContext.sourceRect.origin];
-    
-    [self tableView:self.tableView didSelectRowAtIndexPath:indexPath];
-}
-
-#pragma mark -
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== menu action : Favorite, More, Delete [swipe] =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (BOOL)canOpenMenuAction:(tableMetadata *)metadata
-{
-    return YES;
-}
-
-- (BOOL)swipeTableCell:(MGSwipeTableCell *)cell canSwipe:(MGSwipeDirection)direction
-{
-    NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
-    tableMetadata *metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    return [self canOpenMenuAction:metadata];
-}
-
-- (BOOL)swipeTableCell:(MGSwipeTableCell *)cell tappedButtonAtIndex:(NSInteger)index direction:(MGSwipeDirection)direction fromExpansion:(BOOL)fromExpansion
-{
-    NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
-    
-    if (direction == MGSwipeDirectionRightToLeft) {
-        
-        [self actionDelete:indexPath];
-    }
-    
-    if (direction == MGSwipeDirectionLeftToRight) {
-        
-        tableMetadata *metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-        [[NCNetworking shared] favoriteMetadata:metadata urlBase:appDelegate.urlBase completion:^(NSInteger errorCode, NSString *errorDescription) { }];
-    }
-    
-    return YES;
-}
-
-- (void)actionDelete:(NSIndexPath *)indexPath
-{
-    tableMetadata *metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
-    
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_delete_", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
-        [[NCNetworking shared] deleteMetadata:metadata account:appDelegate.account urlBase:appDelegate.urlBase completion:^(NSInteger errorCode, NSString *errorDescription) { }];
-    }]];
-    
-   
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
-    }]];
-    
-    alertController.popoverPresentationController.sourceView = self.tableView;
-    alertController.popoverPresentationController.sourceRect = [self.tableView rectForRowAtIndexPath:indexPath];
-    
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
-        [alertController.view layoutIfNeeded];
-    
-    [self presentViewController:alertController animated:YES completion:nil];
-}
-
-- (void)actionMore:(UITapGestureRecognizer *)gestureRecognizer
-{
-    CGPoint touch = [gestureRecognizer locationInView:self.tableView];
-    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:touch];    
-    tableMetadata *metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    [self toggleMoreMenuWithViewController:self.tabBarController indexPath:indexPath metadata:metadata];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== Table ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (tableMetadata *)setSelfMetadataFromIndexPath:(NSIndexPath *)indexPath
-{
-    tableMetadata *metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    
-    return metadata;
-}
-
-- (void)reloadDatasource
-{
-    // test
-    if (appDelegate.account.length == 0) { // || self.view.window == nil) {
-        return;
-    }
-    
-    NSArray *recordsTableMetadata;
-    NSString *sorted = [CCUtility getOrderSettings];
-    if ([sorted isEqualToString:@"fileName"]) sorted = @"fileName";
-    
-    // live photo
-    livePhoto =  [CCUtility getLivePhoto];
-    
-    // get auto upload folder
-    autoUploadFileName = [[NCManageDatabase sharedInstance] getAccountAutoUploadFileName];
-    autoUploadDirectory = [[NCManageDatabase sharedInstance] getAccountAutoUploadDirectoryWithUrlBase:appDelegate.urlBase account:appDelegate.account];
-    
-    if (!_serverUrl) {
-        
-        recordsTableMetadata = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND favorite == true", appDelegate.account] page:0 limit:0 sorted:@"fileName" ascending:NO];
-        
-    } else {
-        
-        recordsTableMetadata = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", appDelegate.account, self.serverUrl] page:0 limit:0 sorted:@"fileName" ascending:NO];
-    }
-    
-    sectionDataSource = [CCSectionMetadata creataDataSourseSectionMetadata:recordsTableMetadata listProgressMetadata:nil groupByField:nil filterTypeFileImage:NO filterTypeFileVideo:NO filterLivePhoto:YES sorted:sorted ascending:[CCUtility getAscendingSettings] account:appDelegate.account];
-    
-    [self.tableView reloadData];
-}
-
-
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    return 60;
-}
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
-    return [[sectionDataSource.sectionArrayRow allKeys] count];
-}
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
-    return [[sectionDataSource.sectionArrayRow objectForKey:[sectionDataSource.sections objectAtIndex:section]] count];
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    tableShare *shareCell;
-    tableMetadata *metadataFolder;
-   
-    tableMetadata *metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
-    if (metadata == nil || [[NCManageDatabase sharedInstance] isTableInvalidated:metadata]) {
-        return [CCCellMain new];
-    }
-    
-    tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", appDelegate.account, metadata.serverUrl]];
-    if (directory != nil) {
-        metadataFolder = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", directory.ocId]];
-    }
-    
-    for (tableShare *share in appDelegate.shares) {
-        if ([share.serverUrl isEqualToString:metadata.serverUrl] && [share.fileName isEqualToString:metadata.fileName]) {
-            shareCell = share;
-            break;
-        }
-    }
-    
-    UITableViewCell *cell = [[NCMainCommon sharedInstance] cellForRowAtIndexPath:indexPath tableView:tableView metadata:metadata metadataFolder:metadataFolder serverUrl:self.serverUrl autoUploadFileName:autoUploadFileName autoUploadDirectory:autoUploadDirectory tableShare:shareCell livePhoto:livePhoto];
-    
-    // NORMAL - > MAIN
-
-    if ([cell isKindOfClass:[CCCellMain class]]) {
-        
-        // Comment tap
-        if (metadata.commentsUnread) {
-            UITapGestureRecognizer *tapComment = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapActionComment:)];
-            [tapComment setNumberOfTapsRequired:1];
-            ((CCCellMain *)cell).comment.userInteractionEnabled = YES;
-            [((CCCellMain *)cell).comment addGestureRecognizer:tapComment];
-        }
-        
-        // Share add Tap
-        UITapGestureRecognizer *tapShare = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapActionShared:)];
-        [tapShare setNumberOfTapsRequired:1];
-        ((CCCellMain *)cell).viewShared.userInteractionEnabled = YES;
-        [((CCCellMain *)cell).viewShared addGestureRecognizer:tapShare];
-        
-        // More
-        if ([self canOpenMenuAction:metadata]) {
-            
-            UITapGestureRecognizer *tapMore = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(actionMore:)];
-            [tapMore setNumberOfTapsRequired:1];
-            ((CCCellMain *)cell).more.userInteractionEnabled = YES;
-            [((CCCellMain *)cell).more addGestureRecognizer:tapMore];
-        }
-        
-        // MGSwipeButton
-        ((CCCellMain *)cell).delegate = self;
-        
-        // LEFT : configure ONLY Root Favorites : Remove file/folder Favorites
-        if (_serverUrl == nil) {
-            
-            ((CCCellMain *)cell).leftButtons = @[[MGSwipeButton buttonWithTitle:@"" icon:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"favorite"] width:50 height:50 color:[UIColor whiteColor]] backgroundColor:NCBrandColor.sharedInstance.yellowFavorite padding:25]];
-            ((CCCellMain *)cell).leftExpansion.buttonIndex = 0;
-            ((CCCellMain *)cell).leftExpansion.fillOnTrigger = NO;
-            
-            //centerIconOverText
-            MGSwipeButton *favoriteButton = (MGSwipeButton *)[((CCCellMain *)cell).leftButtons objectAtIndex:0];
-            [favoriteButton centerIconOverText];
-        }
-        
-        // RIGHT
-        ((CCCellMain *)cell).rightButtons = @[[MGSwipeButton buttonWithTitle:@"" icon:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"trash"] width:50 height:50 color:[UIColor whiteColor]] backgroundColor:[UIColor redColor] padding:25]];
-        
-        ((CCCellMain *)cell).rightExpansion.buttonIndex = 0;
-        ((CCCellMain *)cell).rightExpansion.fillOnTrigger = NO;
-        
-        //centerIconOverText
-        MGSwipeButton *deleteButton = (MGSwipeButton *)[((CCCellMain *)cell).rightButtons objectAtIndex:0];
-        [deleteButton centerIconOverText];
-        
-    }
-    
-    // TRANSFER
-    
-    if ([cell isKindOfClass:[CCCellMainTransfer class]]) {
-        
-        // gesture Transfer
-        [((CCCellMainTransfer *)cell).transferButton.stopButton addTarget:self action:@selector(cancelTaskButton:withEvent:) forControlEvents:UIControlEventTouchUpInside];
-        
-        UILongPressGestureRecognizer *stopLongGesture = [UILongPressGestureRecognizer new];
-        [stopLongGesture addTarget:self action:@selector(cancelAllTask:)];
-        [((CCCellMainTransfer *)cell).transferButton.stopButton addGestureRecognizer:stopLongGesture];
-    }
-   
-    return cell;
-}
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    // deselect row
-    [tableView deselectRowAtIndexPath:indexPath animated:YES];
-    
-    self.metadata = [self setSelfMetadataFromIndexPath:indexPath];
-    
-    if (self.metadata.status != k_metadataStatusNormal && self.metadata.status != k_metadataStatusDownloadError) {
-        return;
-    }
-    
-    // File
-    if (self.metadata.directory == NO) {
-        
-        // File do not exists
-        if ([CCUtility fileProviderStorageExists:self.metadata.ocId fileNameView:self.metadata.fileNameView]) {
-            
-            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_downloadedFile object:nil userInfo:@{@"metadata": self.metadata, @"selector": selectorLoadFileView, @"errorCode": @(0), @"errorDescription": @""}];
-                                        
-        } else {
-            
-            tableDirectory *tableDirectory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", appDelegate.account, self.metadata.serverUrl]];
-                
-            if (tableDirectory.e2eEncrypted && ![CCUtility isEndToEndEnabled:appDelegate.account]) {
-                    
-                [[NCContentPresenter shared] messageNotification:@"_info_" description:@"_e2e_goto_settings_for_enable_" delay:k_dismissAfterSecond type:messageTypeInfo errorCode:k_CCErrorInternalError forced:false];
-                    
-            } else {
-                    
-                if (([self.metadata.typeFile isEqualToString: k_metadataTypeFile_video] || [self.metadata.typeFile isEqualToString: k_metadataTypeFile_audio]) && self.metadata.e2eEncrypted == NO) {
-                        
-                    [self shouldPerformSegue:self.metadata selector:@""];
-                
-                } else if ([self.metadata.typeFile isEqualToString: k_metadataTypeFile_document] && [[NCUtility shared] isDirectEditingWithAccount:self.metadata.account contentType:self.metadata.contentType] != nil) {
-                        
-                        if (NCCommunication.shared.isNetworkReachable) {
-                            [self shouldPerformSegue:self.metadata selector:@""];
-                        } else {
-                            [[NCContentPresenter shared] messageNotification:@"_info_" description:@"_go_online_" delay:k_dismissAfterSecond type:messageTypeInfo errorCode:k_CCErrorInternalError forced:false];
-                        }
-                        
-                    } else if ([self.metadata.typeFile isEqualToString: k_metadataTypeFile_document] && [[NCUtility shared] isRichDocument:self.metadata]) {
-                        
-                        if (NCCommunication.shared.isNetworkReachable) {
-                            [self shouldPerformSegue:self.metadata selector:@""];
-                        } else {
-                            [[NCContentPresenter shared] messageNotification:@"_info_" description:@"_go_online_" delay:k_dismissAfterSecond type:messageTypeInfo errorCode:k_CCErrorInternalError forced:false];
-                        }
-                        
-                } else {
-                        
-                    if ([self.metadata.typeFile isEqualToString: k_metadataTypeFile_image]) {
-                        [self shouldPerformSegue:self.metadata selector:selectorLoadFileView];
-                    }
-                    
-                    [[NCNetworking shared] downloadWithMetadata:self.metadata selector:selectorLoadFileViewFavorite setFavorite:false completion:^(NSInteger errorCode) { }];
-                }
-            }
-        }
-    }
-    
-    // Directory
-    if (self.metadata.directory) {
-        
-        CCFavorites *vc = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"CCFavorites"];
-        
-        vc.serverUrl = [CCUtility stringAppendServerUrl:self.metadata.serverUrl addFileName:self.metadata.fileName];
-        vc.titleViewControl = self.metadata.fileNameView;
-        
-        [self.navigationController pushViewController:vc animated:YES];
-    }
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Navigation ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)shouldPerformSegue:(tableMetadata *)metadata selector:(NSString *)selector
-{
-    // if i am in background -> exit
-    if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground) return;
-    
-    // if i am not window -> exit
-    if (self.view.window == NO)
-        return;
-    
-    // Collapsed but i am in detail -> exit
-    if (self.splitViewController.isCollapsed) {
-        if (appDelegate.activeDetail.isViewLoaded && appDelegate.activeDetail.view.window) return;
-    }
-    
-    // Metadata for push detail
-    self.metadataForPushDetail = metadata;
-    self.selectorForPushDetail = selector;
-    
-    [self performSegueWithIdentifier:@"segueDetail" sender:self];
-}
-
--(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
-{
-    UINavigationController *navigationController = segue.destinationViewController;
-    NCDetailViewController *detailViewController = (NCDetailViewController *)navigationController.topViewController;
-    
-    NSMutableArray *photoDataSource = [NSMutableArray new];
-    
-    for (NSString *ocId in sectionDataSource.allOcId) {
-        tableMetadata *metadata = [sectionDataSource.allRecordsDataSource objectForKey:ocId];
-        if ([metadata.typeFile isEqualToString: k_metadataTypeFile_image])
-            [photoDataSource addObject:metadata];
-    }
-    
-    detailViewController.metadata = self.metadataForPushDetail;
-    detailViewController.selector = self.selectorForPushDetail;
-    
-    [detailViewController setTitle:self.metadata.fileNameView];
-}
-
-@end

+ 12 - 38
iOSClient/Main/Main.storyboard

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="4IE-mo-rkp">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="4IE-mo-rkp">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
@@ -232,49 +232,13 @@
                     </navigationBar>
                     <nil name="viewControllers"/>
                     <connections>
-                        <segue destination="6uw-SF-2Qu" kind="relationship" relationship="rootViewController" id="CFg-zI-VEB"/>
+                        <segue destination="NEf-S4-8q5" kind="relationship" relationship="rootViewController" id="TP4-dw-ZwP"/>
                     </connections>
                 </navigationController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="NME-vT-pfd" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
             <point key="canvasLocation" x="5857" y="327"/>
         </scene>
-        <!--Favorites-->
-        <scene sceneID="33n-4d-goO">
-            <objects>
-                <viewController storyboardIdentifier="CCFavorites" id="6uw-SF-2Qu" customClass="CCFavorites" sceneMemberID="viewController">
-                    <view key="view" contentMode="scaleToFill" id="o6l-1S-6dH">
-                        <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <subviews>
-                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Pes-cJ-S4N">
-                                <rect key="frame" x="0.0" y="88" width="414" height="760"/>
-                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                                <connections>
-                                    <outlet property="dataSource" destination="6uw-SF-2Qu" id="65P-9j-K6G"/>
-                                    <outlet property="delegate" destination="6uw-SF-2Qu" id="jGP-Hq-vWN"/>
-                                </connections>
-                            </tableView>
-                        </subviews>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                        <constraints>
-                            <constraint firstItem="Zpq-f2-Hyz" firstAttribute="trailing" secondItem="Pes-cJ-S4N" secondAttribute="trailing" id="2Ub-e5-Zy5"/>
-                            <constraint firstItem="Zpq-f2-Hyz" firstAttribute="bottom" secondItem="Pes-cJ-S4N" secondAttribute="bottom" constant="-35" id="7Ae-ij-d61"/>
-                            <constraint firstItem="Pes-cJ-S4N" firstAttribute="top" secondItem="Zpq-f2-Hyz" secondAttribute="top" id="fiN-Qd-fKD"/>
-                            <constraint firstItem="Pes-cJ-S4N" firstAttribute="leading" secondItem="Zpq-f2-Hyz" secondAttribute="leading" id="xJk-eT-GLY"/>
-                        </constraints>
-                        <viewLayoutGuide key="safeArea" id="Zpq-f2-Hyz"/>
-                    </view>
-                    <navigationItem key="navigationItem" id="udr-5M-kHz"/>
-                    <connections>
-                        <outlet property="tableView" destination="Pes-cJ-S4N" id="Fxj-3r-MCL"/>
-                        <segue destination="mtc-lf-PRo" kind="showDetail" identifier="segueDetail" id="45n-bF-9RO"/>
-                    </connections>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="d5y-uw-vht" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="5856.521739130435" y="1217.4107142857142"/>
-        </scene>
         <!--Media-->
         <scene sceneID="IuY-Iu-oAm">
             <objects>
@@ -468,6 +432,16 @@
             </objects>
             <point key="canvasLocation" x="5214" y="1217"/>
         </scene>
+        <!--NCFavorite.storyboard-->
+        <scene sceneID="zqD-Jj-h2w">
+            <objects>
+                <viewControllerPlaceholder storyboardName="NCFavorite" referencedIdentifier="NCFavorite.storyboard" id="NEf-S4-8q5" sceneMemberID="viewController">
+                    <navigationItem key="navigationItem" id="dts-Zz-Gfr"/>
+                </viewControllerPlaceholder>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="gnf-oc-B60" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="5857" y="899"/>
+        </scene>
         <!--More-->
         <scene sceneID="50a-pn-1yx">
             <objects>

+ 14 - 10
iOSClient/Main/Menu/CCFavorites+Menu.swift → iOSClient/Main/Menu/NCFavorite+Menu.swift

@@ -1,5 +1,5 @@
 //
-//  CCFavorites+Menu.swift
+//  NCFavorite+Menu.swift
 //  Nextcloud
 //
 //  Created by Philippe Weidmann on 24.01.20.
@@ -25,14 +25,14 @@
 
 import FloatingPanel
 
-extension CCFavorites {
+extension NCFavorite {
 
-    @objc func toggleMoreMenu(viewController: UIViewController, indexPath: IndexPath, metadata: tableMetadata) {
+    func toggleMoreMenu(viewController: UIViewController, metadata: tableMetadata) {
         
         if let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId)) {
             
             let mainMenuViewController = UIStoryboard.init(name: "NCMenu", bundle: nil).instantiateViewController(withIdentifier: "NCMainMenuTableViewController") as! NCMainMenuTableViewController
-            mainMenuViewController.actions = self.initMoreMenu(indexPath: indexPath, metadata: metadata)
+            mainMenuViewController.actions = self.initMoreMenu(metadata: metadata)
 
             let menuPanelController = NCMenuPanelController()
             menuPanelController.parentPresenter = viewController
@@ -44,7 +44,7 @@ extension CCFavorites {
         }
     }
     
-    private func initMoreMenu(indexPath: IndexPath, metadata: tableMetadata) -> [NCMenuAction] {
+    private func initMoreMenu(metadata: tableMetadata) -> [NCMenuAction] {
         var actions = [NCMenuAction]()
         let appDelegate = UIApplication.shared.delegate as! AppDelegate
 
@@ -52,7 +52,7 @@ extension CCFavorites {
         if let icon = UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag)) {
             iconHeader = icon
         } else {
-            if(metadata.directory) {
+            if metadata.directory {
                 iconHeader = CCGraphics.changeThemingColorImage(UIImage(named: "folder"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon)
             } else {
                 iconHeader = UIImage(named: metadata.iconName)
@@ -67,7 +67,7 @@ extension CCFavorites {
             )
         )
 
-        if(self.serverUrl == nil) {
+        if self.serverUrl == "" {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_remove_favorites_", comment: ""),
@@ -89,13 +89,12 @@ extension CCFavorites {
             )
         )
 
-        if(!metadata.directory && !NCBrandOptions.sharedInstance.disable_openin_file) {
+        if !metadata.directory && !NCBrandOptions.sharedInstance.disable_openin_file {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_open_in_", comment: ""),
                     icon: CCGraphics.changeThemingColorImage(UIImage(named: "openFile"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
                     action: { menuAction in
-                        self.tableView.setEditing(false, animated: true)
                         NCMainCommon.sharedInstance.downloadOpen(metadata: metadata, selector: selectorOpenIn)
                     }
                 )
@@ -107,7 +106,12 @@ extension CCFavorites {
                 title: NSLocalizedString("_delete_", comment: ""),
                 icon: CCGraphics.changeThemingColorImage(UIImage(named: "trash"), width: 50, height: 50, color: .red),
                 action: { menuAction in
-                    self.actionDelete(indexPath)
+                    let alertController = UIAlertController(title: "", message: NSLocalizedString("_want_delete_", comment: ""), preferredStyle: .alert)
+                    alertController.addAction(UIAlertAction(title: NSLocalizedString("_yes_delete_", comment: ""), style: .default) { (action:UIAlertAction) in
+                        NCNetworking.shared.deleteMetadata(metadata, account: metadata.account, urlBase: metadata.urlBase) { (errorCode, errorDescription) in }
+                    })
+                    alertController.addAction(UIAlertAction(title: NSLocalizedString("_no_delete_", comment: ""), style: .default) { (action:UIAlertAction) in })
+                    self.present(alertController, animated: true, completion:nil)
                 }
             )
         )

+ 2 - 2
iOSClient/Networking/NCNetworkingNotificationCenter.swift

@@ -88,8 +88,8 @@ import Foundation
                                 
                                 if appDelegate.activeMain.view.window != nil {
                                     appDelegate.activeMain.shouldPerformSegue(metadata, selector: selector)
-                                } else if appDelegate.activeFavorites.view.window != nil {
-                                    appDelegate.activeFavorites.shouldPerformSegue(metadata, selector: selector)
+                                } else if appDelegate.activeFavorite.view.window != nil {
+                                    //appDelegate.activeFavorite.shouldPerformSegue(metadata, selector: selector)
                                 }
                             }
                         }