瀏覽代碼

control center - page

Marino Faggiana 8 年之前
父節點
當前提交
5b48b35f7c

+ 8 - 8
Nextcloud.xcodeproj/project.pbxproj

@@ -654,6 +654,8 @@
 		F708CF9C1E56E8CC00271D8B /* TableAccount+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF6C1E56E8CC00271D8B /* TableAccount+CoreDataProperties.m */; };
 		F70A630B1D5B3467004E2AA5 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63061D5B3467004E2AA5 /* libcrypto.a */; };
 		F70A630F1D5B3467004E2AA5 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63071D5B3467004E2AA5 /* libssl.a */; };
+		F70FD1C71E67552700C0FDA6 /* CCControlCenterTransfer.m in Sources */ = {isa = PBXBuildFile; fileRef = F70FD1C61E67552700C0FDA6 /* CCControlCenterTransfer.m */; };
+		F70FD1C81E67552700C0FDA6 /* CCControlCenterTransfer.m in Sources */ = {isa = PBXBuildFile; fileRef = F70FD1C61E67552700C0FDA6 /* CCControlCenterTransfer.m */; };
 		F714526D1DC1523B0006A5D4 /* libMagicalRecord.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F7B61E9B1DC13C20009E938F /* libMagicalRecord.a */; };
 		F71459B81D12E3B700CAFEEC /* CCError.m in Sources */ = {isa = PBXBuildFile; fileRef = F76C3B881C638A4C00DC4301 /* CCError.m */; };
 		F71459BA1D12E3B700CAFEEC /* NSString+TruncateToWidth.m in Sources */ = {isa = PBXBuildFile; fileRef = F73049B91CB567F000C7C320 /* NSString+TruncateToWidth.m */; };
@@ -820,8 +822,6 @@
 		F750374D1DBFA91A008FB480 /* ALView+PureLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F75037441DBFA91A008FB480 /* ALView+PureLayout.m */; };
 		F750374F1DBFA91A008FB480 /* NSArray+PureLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F75037461DBFA91A008FB480 /* NSArray+PureLayout.m */; };
 		F75037511DBFA91A008FB480 /* NSLayoutConstraint+PureLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F75037481DBFA91A008FB480 /* NSLayoutConstraint+PureLayout.m */; };
-		F75284931E671DE6003ACF39 /* CCControlCenterPageContent.m in Sources */ = {isa = PBXBuildFile; fileRef = F75284921E671DE6003ACF39 /* CCControlCenterPageContent.m */; };
-		F75284941E671DE6003ACF39 /* CCControlCenterPageContent.m in Sources */ = {isa = PBXBuildFile; fileRef = F75284921E671DE6003ACF39 /* CCControlCenterPageContent.m */; };
 		F7596C781D128FC80092A6B8 /* Nextcloud.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F7596C771D128FC80092A6B8 /* Nextcloud.xcassets */; };
 		F75ADF451DC75FFE008A7347 /* CCLogin.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F75ADF441DC75FFE008A7347 /* CCLogin.storyboard */; };
 		F7659A271DC0B726004860C4 /* EAIntroPage.m in Sources */ = {isa = PBXBuildFile; fileRef = F7659A231DC0B726004860C4 /* EAIntroPage.m */; };
@@ -1688,6 +1688,8 @@
 		F70F0F9C1C889487008DAB36 /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zip.h; sourceTree = "<group>"; };
 		F70F0F9D1C889487008DAB36 /* SSZipArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSZipArchive.h; sourceTree = "<group>"; };
 		F70F0F9E1C889487008DAB36 /* SSZipArchive.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSZipArchive.m; sourceTree = "<group>"; };
+		F70FD1C51E67552700C0FDA6 /* CCControlCenterTransfer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlCenterTransfer.h; sourceTree = "<group>"; };
+		F70FD1C61E67552700C0FDA6 /* CCControlCenterTransfer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCControlCenterTransfer.m; sourceTree = "<group>"; };
 		F7145A2E1D12E62B00CAFEEC /* Nextcloud.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Nextcloud.entitlements; sourceTree = "<group>"; };
 		F7151A7F1D477A4B00E6AF45 /* en */ = {isa = PBXFileReference; lastKnownFileType = text; name = en; path = en.lproj/TTOpenInAppActivityLocalizable.string; sourceTree = "<group>"; };
 		F7151A801D477A4B00E6AF45 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/BKPasscodeView.strings; sourceTree = "<group>"; };
@@ -1867,8 +1869,6 @@
 		F750374B1DBFA91A008FB480 /* PureLayoutDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PureLayoutDefines.h; sourceTree = "<group>"; };
 		F7514EDA1C7B1336008F3338 /* CCHud.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCHud.h; sourceTree = "<group>"; };
 		F7514EDB1C7B1336008F3338 /* CCHud.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCHud.m; sourceTree = "<group>"; };
-		F75284911E671DE6003ACF39 /* CCControlCenterPageContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlCenterPageContent.h; sourceTree = "<group>"; };
-		F75284921E671DE6003ACF39 /* CCControlCenterPageContent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCControlCenterPageContent.m; sourceTree = "<group>"; };
 		F7540EE21D5B238600C3FFA8 /* aes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aes.h; sourceTree = "<group>"; };
 		F7540EE31D5B238600C3FFA8 /* asn1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asn1.h; sourceTree = "<group>"; };
 		F7540EE41D5B238600C3FFA8 /* asn1_mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asn1_mac.h; sourceTree = "<group>"; };
@@ -3673,11 +3673,11 @@
 				F72AE40A1E67246200B3E477 /* ControlCenter.storyboard */,
 				F7D6A0891D82DBFA0045AD1A /* CCControlCenter.h */,
 				F7D6A08A1D82DBFA0045AD1A /* CCControlCenter.m */,
-				F75284911E671DE6003ACF39 /* CCControlCenterPageContent.h */,
-				F75284921E671DE6003ACF39 /* CCControlCenterPageContent.m */,
 				F7D6A08B1D82DBFA0045AD1A /* CCControlCenterTransferCell.h */,
 				F7D6A08C1D82DBFA0045AD1A /* CCControlCenterTransferCell.m */,
 				F7D6A08D1D82DBFA0045AD1A /* CCControlCenterTransferCell.xib */,
+				F70FD1C51E67552700C0FDA6 /* CCControlCenterTransfer.h */,
+				F70FD1C61E67552700C0FDA6 /* CCControlCenterTransfer.m */,
 				F7D6A08E1D82DBFA0045AD1A /* CCMenu.h */,
 				F7D6A08F1D82DBFA0045AD1A /* CCMenu.m */,
 			);
@@ -4951,6 +4951,7 @@
 				084214AC1E646E0200C8F4F3 /* REMenuContainerView.m in Sources */,
 				084214AD1E646E0200C8F4F3 /* CCShareOC.m in Sources */,
 				084214AE1E646E0200C8F4F3 /* UIScrollView+EmptyDataSet.m in Sources */,
+				F70FD1C81E67552700C0FDA6 /* CCControlCenterTransfer.m in Sources */,
 				084214AF1E646E0200C8F4F3 /* MWGridCell.m in Sources */,
 				084214B01E646E0200C8F4F3 /* LMMediaPlayerView.m in Sources */,
 				084214B11E646E0200C8F4F3 /* TableLocalFile+CoreDataClass.m in Sources */,
@@ -4973,7 +4974,6 @@
 				084214C21E646E0200C8F4F3 /* ReaderThumbFetch.m in Sources */,
 				084214C31E646E0200C8F4F3 /* CCPassaporto.m in Sources */,
 				084214C41E646E0200C8F4F3 /* CTAssetItemViewController.m in Sources */,
-				F75284941E671DE6003ACF39 /* CCControlCenterPageContent.m in Sources */,
 				084214C51E646E0200C8F4F3 /* PSTCollectionView.m in Sources */,
 				084214C61E646E0200C8F4F3 /* CCLogin.m in Sources */,
 				084214C71E646E0200C8F4F3 /* CYRTextStorage.m in Sources */,
@@ -5545,6 +5545,7 @@
 				F77B0E621D118A16002130FE /* REMenuContainerView.m in Sources */,
 				F77B0E631D118A16002130FE /* CCShareOC.m in Sources */,
 				F73CCE261DC13788007E38D8 /* UIScrollView+EmptyDataSet.m in Sources */,
+				F70FD1C71E67552700C0FDA6 /* CCControlCenterTransfer.m in Sources */,
 				F7F54D071E5B14C800E19C62 /* MWGridCell.m in Sources */,
 				F77B0E651D118A16002130FE /* LMMediaPlayerView.m in Sources */,
 				F708CF731E56E8CC00271D8B /* TableLocalFile+CoreDataClass.m in Sources */,
@@ -5567,7 +5568,6 @@
 				F77B0E781D118A16002130FE /* ReaderThumbFetch.m in Sources */,
 				F77B0E7B1D118A16002130FE /* CCPassaporto.m in Sources */,
 				F7F06EA51DBFACC600099AE9 /* CTAssetItemViewController.m in Sources */,
-				F75284931E671DE6003ACF39 /* CCControlCenterPageContent.m in Sources */,
 				F7659A5A1DC0B760004860C4 /* PSTCollectionView.m in Sources */,
 				F7BF1B431D51E893000854F6 /* CCLogin.m in Sources */,
 				F77B0E7D1D118A16002130FE /* CYRTextStorage.m in Sources */,

+ 62 - 14
iOSClient/MenuAccount+ControlCenter/CCControlCenter.m

@@ -23,7 +23,7 @@
 
 #import "CCControlCenter.h"
 
-#import "CCControlCenterPageContent.h"
+#import "CCControlCenterTransfer.h"
 #import "AppDelegate.h"
 #import "CCMain.h"
 #import "CCDetail.h"
@@ -38,11 +38,6 @@
 
 #define ANIMATION_GESTURE 0.50f
 
-#define download 1
-#define downloadwwan 2
-#define upload 3
-#define uploadwwan 4
-
 @interface CCControlCenter ()
 {
     UIVisualEffectView *_mainView;
@@ -96,7 +91,7 @@
     _pageViewController.dataSource = self;
     _pageViewController.delegate = self;
     
-    CCControlCenterPageContent *startingViewController = [self viewControllerAtIndex:0];
+    UIViewController *startingViewController = [self viewControllerAtIndex:0];
     NSArray *viewControllers = @[startingViewController];
     
     [_pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
@@ -360,13 +355,57 @@
 #pragma mark ===== Page  =====
 #pragma --------------------------------------------------------------------------------------------
 
-- (CCControlCenterPageContent *)viewControllerAtIndex:(NSUInteger)index
+- (UIViewController *)viewControllerAtIndex:(NSUInteger)index
 {
     if (([self.pageType count] == 0) || (index >= [self.pageType count])) {
         return nil;
     }
     
-    CCControlCenterPageContent *pageContentViewController;
+    /*
+    if (index == 0) {
+        
+        CCControlCenterTransfer *pageContentViewController;
+
+        if ([self.controlCenterPagesContent count] >= index+1) {
+            
+            pageContentViewController = [self.controlCenterPagesContent objectAtIndex:index];
+            
+        } else {
+            
+            // Create a new view controller and pass suitable data.
+            pageContentViewController = [[UIStoryboard storyboardWithName: @"ControlCenter" bundle:[NSBundle mainBundle]]  instantiateViewControllerWithIdentifier:@"ControlCenterTransfer"];
+            [self.controlCenterPagesContent addObject:pageContentViewController];
+        }
+        
+        pageContentViewController.pageIndex = index;
+        pageContentViewController.pageType = self.pageType[index];
+        
+        return pageContentViewController;
+    }
+    
+    if (index == 1) {
+        
+        CCControlCenterTransfer *pageContentViewController;
+        
+        if ([self.controlCenterPagesContent count] >= index+1) {
+            
+            pageContentViewController = [self.controlCenterPagesContent objectAtIndex:index];
+            
+        } else {
+            
+            // Create a new view controller and pass suitable data.
+            pageContentViewController = [[UIStoryboard storyboardWithName: @"ControlCenter" bundle:[NSBundle mainBundle]]  instantiateViewControllerWithIdentifier:@"ControlCenterTransfer"];
+            [self.controlCenterPagesContent addObject:pageContentViewController];
+        }
+        
+        pageContentViewController.pageIndex = index;
+        pageContentViewController.pageType = self.pageType[index];
+        
+        return pageContentViewController;
+    }
+    */
+    
+    UIViewController *pageContentViewController;
     
     if ([self.controlCenterPagesContent count] >= index+1) {
         
@@ -375,19 +414,28 @@
     } else {
         
         // Create a new view controller and pass suitable data.
-        pageContentViewController = [[UIStoryboard storyboardWithName: @"ControlCenter" bundle:[NSBundle mainBundle]]  instantiateViewControllerWithIdentifier:@"ControlCenterPageContent"];
+        pageContentViewController = [[UIStoryboard storyboardWithName: @"ControlCenter" bundle:[NSBundle mainBundle]]  instantiateViewControllerWithIdentifier:@"ControlCenterTransfer"];
         [self.controlCenterPagesContent addObject:pageContentViewController];
     }
     
-    pageContentViewController.pageIndex = index;
-    pageContentViewController.pageType = self.pageType[index];
+    if (index == 0) {
+        
+        ((CCControlCenterTransfer *) pageContentViewController).pageIndex = index;
+        ((CCControlCenterTransfer *) pageContentViewController).pageType = self.pageType[index];
+    }
+
+    if (index == 1) {
+        
+        ((CCControlCenterTransfer *) pageContentViewController).pageIndex = index;
+        ((CCControlCenterTransfer *) pageContentViewController).pageType = self.pageType[index];
+    }
     
     return pageContentViewController;
 }
 
 - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController
 {
-    NSUInteger index = ((CCControlCenterPageContent *) viewController).pageIndex;
+    NSUInteger index = ((CCControlCenterTransfer *) viewController).pageIndex;
     
     if ((index == 0) || (index == NSNotFound)) {
         return nil;
@@ -399,7 +447,7 @@
 
 - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
 {
-    NSUInteger index = ((CCControlCenterPageContent *) viewController).pageIndex;
+    NSUInteger index = ((CCControlCenterTransfer *) viewController).pageIndex;
     
     if (index == NSNotFound) {
         return nil;

+ 2 - 2
iOSClient/MenuAccount+ControlCenter/CCControlCenterPageContent.h → iOSClient/MenuAccount+ControlCenter/CCControlCenterTransfer.h

@@ -1,5 +1,5 @@
 //
-//  CCControlCenterPageContent.h
+//  CCControlCenterTransfer.h
 //  Nextcloud
 //
 //  Created by Marino Faggiana on 01/03/17.
@@ -8,7 +8,7 @@
 
 #import <UIKit/UIKit.h>
 
-@interface CCControlCenterPageContent : UIViewController <UITableViewDataSource, UITableViewDelegate>
+@interface CCControlCenterTransfer : UIViewController <UITableViewDataSource, UITableViewDelegate>
 
 @property NSUInteger pageIndex;
 @property (nonatomic, strong) NSString *pageType;

+ 3 - 3
iOSClient/MenuAccount+ControlCenter/CCControlCenterPageContent.m → iOSClient/MenuAccount+ControlCenter/CCControlCenterTransfer.m

@@ -6,7 +6,7 @@
 //  Copyright © 2017 TWS. All rights reserved.
 //
 
-#import "CCControlCenterPageContent.h"
+#import "CCControlCenterTransfer.h"
 
 #import "AppDelegate.h"
 #import "CCMain.h"
@@ -20,14 +20,14 @@
 #define upload 3
 #define uploadwwan 4
 
-@interface CCControlCenterPageContent ()
+@interface CCControlCenterTransfer ()
 {    
     // Datasource
     CCSectionDataSource *_sectionDataSource;
 }
 @end
 
-@implementation CCControlCenterPageContent
+@implementation CCControlCenterTransfer
 
 - (void)viewDidLoad {
     

+ 3 - 3
iOSClient/MenuAccount+ControlCenter/ControlCenter.storyboard

@@ -17,11 +17,10 @@
             </objects>
             <point key="canvasLocation" x="6487" y="1218"/>
         </scene>
-        <!--Control Center Page Content-->
+        <!--Control Center Transfer-->
         <scene sceneID="Gv7-Uy-0Cg">
             <objects>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="U19-6b-Mxz" userLabel="First Responder" sceneMemberID="firstResponder"/>
-                <viewController storyboardIdentifier="ControlCenterPageContent" id="XDY-MZ-Gnz" customClass="CCControlCenterPageContent" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="ControlCenterTransfer" id="XDY-MZ-Gnz" customClass="CCControlCenterTransfer" sceneMemberID="viewController">
                     <layoutGuides>
                         <viewControllerLayoutGuide type="top" id="uPE-Nb-KVS"/>
                         <viewControllerLayoutGuide type="bottom" id="zG1-N8-9Mo"/>
@@ -46,6 +45,7 @@
                         <outlet property="tableView" destination="cFo-AN-kZv" id="vLq-gh-way"/>
                     </connections>
                 </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="U19-6b-Mxz" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
             <point key="canvasLocation" x="7125.6000000000004" y="1217.5412293853074"/>
         </scene>