Browse Source

Select media folder with new UI view

Marino Faggiana 6 years ago
parent
commit
1c7ffc9c2f
2 changed files with 13 additions and 20 deletions
  1. 1 2
      iOSClient/Media/CCMedia.h
  2. 12 18
      iOSClient/Media/CCMedia.m

+ 1 - 2
iOSClient/Media/CCMedia.h

@@ -34,11 +34,10 @@
 #import "CCSection.h"
 #import "CCHud.h"
 #import "OCNetworking.h"
-#import "CCMove.h"
 
 @class tableMetadata;
 
-@interface CCMedia: UICollectionViewController <UICollectionViewDataSource, UICollectionViewDelegate, UIActionSheetDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate, OCNetworkingDelegate, CCMoveDelegate>
+@interface CCMedia: UICollectionViewController <UICollectionViewDataSource, UICollectionViewDelegate, UIActionSheetDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate, OCNetworkingDelegate>
 
 @property (nonatomic, weak) CCDetail *detailViewController;
 @property (nonatomic, strong) tableMetadata *metadata;

+ 12 - 18
iOSClient/Media/CCMedia.m

@@ -27,7 +27,7 @@
 #import "TOScrollBar.h"
 #import "NCBridgeSwift.h"
 
-@interface CCMedia ()
+@interface CCMedia () <NCSelectDelegate>
 {
     AppDelegate *appDelegate;
 
@@ -623,16 +623,16 @@
 #pragma mark ==== Change Start directory ====
 #pragma --------------------------------------------------------------------------------------------
 
-- (void)moveServerUrlTo:(NSString *)serverUrlTo title:(NSString *)title type:(NSString *)type
+- (void)dismissSelectWithServerUrl:(NSString *)serverUrl metadata:(tableMetadata *)metadata type:(NSString *)type
 {
     if ([type isEqualToString:@"mediaFolder"]) {
         
         NSString *oldStartDirectoryMediaTabView = [[NCManageDatabase sharedInstance] getAccountStartDirectoryMediaTabView:[CCUtility getHomeServerUrlActiveUrl:appDelegate.activeUrl]];
         
-        if (![serverUrlTo isEqualToString:oldStartDirectoryMediaTabView]) {
+        if (![serverUrl isEqualToString:oldStartDirectoryMediaTabView]) {
             
             // Save Start Directory
-            [[NCManageDatabase sharedInstance] setAccountStartDirectoryMediaTabView:serverUrlTo];
+            [[NCManageDatabase sharedInstance] setAccountStartDirectoryMediaTabView:serverUrl];
             
             // search PhotoVideo with new start directory
             [self searchPhotoVideo];
@@ -666,23 +666,17 @@
 
 - (void)selectStartDirectoryPhotosTab
 {
-    UINavigationController* navigationController = [[UIStoryboard storyboardWithName:@"CCMove" bundle:nil] instantiateViewControllerWithIdentifier:@"CCMove"];
-    
-    CCMove *viewController = (CCMove *)navigationController.topViewController;
+    UINavigationController *navigationController = [[UIStoryboard storyboardWithName:@"NCSelect" bundle:nil] instantiateInitialViewController];
+    NCSelect *viewController = (NCSelect *)navigationController.topViewController;
     
     viewController.delegate = self;
-    viewController.move.title = NSLocalizedString(@"_select_", nil);
-    viewController.tintColor = [NCBrandColor sharedInstance].brandText;
-    viewController.barTintColor = [NCBrandColor sharedInstance].brand;
-    viewController.tintColorTitle = [NCBrandColor sharedInstance].brandText;
-    viewController.networkingOperationQueue = appDelegate.netQueue;
-    viewController.hideCreateFolder = YES;
-    
-    // TYPE
+    viewController.hideButtonCreateFolder = true;
+    viewController.selectFile = false;
+    viewController.includeDirectoryE2EEncryption = false;
+    viewController.includeImages = false;
     viewController.type = @"mediaFolder";
-    
-    // E2EE
-    viewController.includeDirectoryE2EEncryption = NO;
+    viewController.titleButtonDone = NSLocalizedString(@"_select_", nil);
+    viewController.layoutViewSelect = k_layout_view_move;
     
     [navigationController setModalPresentationStyle:UIModalPresentationFormSheet];
     [self presentViewController:navigationController animated:YES completion:nil];