Browse Source

control center page

Marino Faggiana 8 years ago
parent
commit
b824b17a8c

+ 8 - 0
Nextcloud.xcodeproj/project.pbxproj

@@ -656,6 +656,8 @@
 		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 */; };
+		F70FD1CB1E675F1500C0FDA6 /* CCControlCenterActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = F70FD1CA1E675F1500C0FDA6 /* CCControlCenterActivity.m */; };
+		F70FD1CC1E675F1500C0FDA6 /* CCControlCenterActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = F70FD1CA1E675F1500C0FDA6 /* CCControlCenterActivity.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 */; };
@@ -1690,6 +1692,8 @@
 		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>"; };
+		F70FD1C91E675F1500C0FDA6 /* CCControlCenterActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlCenterActivity.h; sourceTree = "<group>"; };
+		F70FD1CA1E675F1500C0FDA6 /* CCControlCenterActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCControlCenterActivity.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>"; };
@@ -3678,6 +3682,8 @@
 				F7D6A08D1D82DBFA0045AD1A /* CCControlCenterTransferCell.xib */,
 				F70FD1C51E67552700C0FDA6 /* CCControlCenterTransfer.h */,
 				F70FD1C61E67552700C0FDA6 /* CCControlCenterTransfer.m */,
+				F70FD1C91E675F1500C0FDA6 /* CCControlCenterActivity.h */,
+				F70FD1CA1E675F1500C0FDA6 /* CCControlCenterActivity.m */,
 				F7D6A08E1D82DBFA0045AD1A /* CCMenu.h */,
 				F7D6A08F1D82DBFA0045AD1A /* CCMenu.m */,
 			);
@@ -4866,6 +4872,7 @@
 				084214581E646E0200C8F4F3 /* CCGraphics.m in Sources */,
 				084214591E646E0200C8F4F3 /* NSExpression+XLFormAdditions.m in Sources */,
 				0842145A1E646E0200C8F4F3 /* BKPasscodeDummyViewController.m in Sources */,
+				F70FD1CC1E675F1500C0FDA6 /* CCControlCenterActivity.m in Sources */,
 				0842145B1E646E0200C8F4F3 /* ReaderThumbQueue.m in Sources */,
 				0842145C1E646E0200C8F4F3 /* PSTGridLayoutRow.m in Sources */,
 				0842145D1E646E0200C8F4F3 /* CCShareUserOC.m in Sources */,
@@ -5460,6 +5467,7 @@
 				F77B0E1B1D118A16002130FE /* CCGraphics.m in Sources */,
 				F73CCE071DC13776007E38D8 /* NSExpression+XLFormAdditions.m in Sources */,
 				F77B0E1C1D118A16002130FE /* BKPasscodeDummyViewController.m in Sources */,
+				F70FD1CB1E675F1500C0FDA6 /* CCControlCenterActivity.m in Sources */,
 				F77B0E1D1D118A16002130FE /* ReaderThumbQueue.m in Sources */,
 				F7659A6E1DC0B760004860C4 /* PSTGridLayoutRow.m in Sources */,
 				F77B0E201D118A16002130FE /* CCShareUserOC.m in Sources */,

+ 11 - 58
iOSClient/MenuAccount+ControlCenter/CCControlCenter.m

@@ -22,8 +22,10 @@
 //
 
 #import "CCControlCenter.h"
-
 #import "CCControlCenterTransfer.h"
+
+#import "CCControlCenterActivity.h"
+
 #import "AppDelegate.h"
 #import "CCMain.h"
 #import "CCDetail.h"
@@ -361,50 +363,6 @@
         return nil;
     }
     
-    /*
-    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) {
@@ -413,23 +371,18 @@
         
     } else {
         
-        // Create a new view controller and pass suitable data.
-        pageContentViewController = [[UIStoryboard storyboardWithName: @"ControlCenter" bundle:[NSBundle mainBundle]]  instantiateViewControllerWithIdentifier:@"ControlCenterTransfer"];
-        [self.controlCenterPagesContent addObject:pageContentViewController];
-    }
-    
-    if (index == 0) {
+        if (index == 0)
+            pageContentViewController = [[UIStoryboard storyboardWithName: @"ControlCenter" bundle:[NSBundle mainBundle]]  instantiateViewControllerWithIdentifier:@"ControlCenterTransfer"];
         
-        ((CCControlCenterTransfer *) pageContentViewController).pageIndex = index;
-        ((CCControlCenterTransfer *) pageContentViewController).pageType = self.pageType[index];
-    }
-
-    if (index == 1) {
+        if (index == 1)
+            pageContentViewController = [[UIStoryboard storyboardWithName: @"ControlCenter" bundle:[NSBundle mainBundle]]  instantiateViewControllerWithIdentifier:@"ControlCenterActivity"];
         
-        ((CCControlCenterTransfer *) pageContentViewController).pageIndex = index;
-        ((CCControlCenterTransfer *) pageContentViewController).pageType = self.pageType[index];
+        [self.controlCenterPagesContent addObject:pageContentViewController];
     }
     
+    ((CCControlCenterTransfer *) pageContentViewController).pageIndex = index;
+    ((CCControlCenterTransfer *) pageContentViewController).pageType = self.pageType[index];
+    
     return pageContentViewController;
 }
 

+ 18 - 0
iOSClient/MenuAccount+ControlCenter/CCControlCenterActivity.h

@@ -0,0 +1,18 @@
+//
+//  CCControlCenterActivity.h
+//  Nextcloud
+//
+//  Created by Marino Faggiana on 01/03/17.
+//  Copyright © 2017 TWS. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface CCControlCenterActivity : UIViewController <UITableViewDataSource, UITableViewDelegate>
+
+@property NSUInteger pageIndex;
+@property (nonatomic, strong) NSString *pageType;
+
+@property (nonatomic, weak) IBOutlet UITableView *tableView;
+
+@end

+ 26 - 0
iOSClient/MenuAccount+ControlCenter/CCControlCenterActivity.m

@@ -0,0 +1,26 @@
+//
+//  CCControlCenterActivity.m
+//  Nextcloud
+//
+//  Created by Marino Faggiana on 01/03/17.
+//  Copyright © 2017 TWS. All rights reserved.
+//
+
+#import "CCControlCenterActivity.h"
+
+@implementation CCControlCenterActivity
+
+- (void)viewDidLoad {
+    
+    [super viewDidLoad];
+    
+    // Custom Cell
+    [_tableView registerNib:[UINib nibWithNibName:@"CCControlCenterTransferCell" bundle:nil] forCellReuseIdentifier:@"ControlCenterTransferCell"];
+    
+    _tableView.delegate = self;
+    _tableView.dataSource = self;
+    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
+    _tableView.backgroundColor = [UIColor greenColor];
+}
+
+@end

+ 33 - 1
iOSClient/MenuAccount+ControlCenter/ControlCenter.storyboard

@@ -47,7 +47,39 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="U19-6b-Mxz" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="7125.6000000000004" y="1217.5412293853074"/>
+            <point key="canvasLocation" x="7161" y="982"/>
+        </scene>
+        <!--Control Center Activity-->
+        <scene sceneID="Lj5-ZZ-gWT">
+            <objects>
+                <viewController storyboardIdentifier="ControlCenterActivity" id="bIB-Pq-Xl4" customClass="CCControlCenterActivity" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="hth-v8-all"/>
+                        <viewControllerLayoutGuide type="bottom" id="hV0-xB-mel"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="TKW-wP-WbG">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="qY2-Sb-k19">
+                                <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <connections>
+                                    <outlet property="dataSource" destination="bIB-Pq-Xl4" id="ngz-AY-uPG"/>
+                                    <outlet property="delegate" destination="bIB-Pq-Xl4" id="kCx-nZ-bYr"/>
+                                </connections>
+                            </tableView>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    </view>
+                    <connections>
+                        <outlet property="tableView" destination="qY2-Sb-k19" id="1CN-d4-ABG"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="BoE-1I-xzs" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="7161" y="1668"/>
         </scene>
     </scenes>
 </document>