Browse Source

New view Activity

Marino Faggiana 8 years ago
parent
commit
c1661c9bdf

+ 14 - 0
Nextcloud.xcodeproj/project.pbxproj

@@ -520,6 +520,7 @@
 		F7A321561E9E2A070069AD1B /* CCFavoritesCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A321511E9E2A070069AD1B /* CCFavoritesCell.m */; };
 		F7A321571E9E2A070069AD1B /* CCFavoritesCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7A321521E9E2A070069AD1B /* CCFavoritesCell.xib */; };
 		F7A321581E9E2A070069AD1B /* CCSynchronize.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A321541E9E2A070069AD1B /* CCSynchronize.m */; };
+		F7A321651E9E37960069AD1B /* CCActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A321641E9E37960069AD1B /* CCActivity.m */; };
 		F7B1FBC41E72E3D1001781FE /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F7B1FBB11E72E3D1001781FE /* Media.xcassets */; };
 		F7B1FBC61E72E3D1001781FE /* SwiftModalWebVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B1FBBF1E72E3D1001781FE /* SwiftModalWebVC.swift */; };
 		F7B1FBC71E72E3D1001781FE /* SwiftWebVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B1FBC01E72E3D1001781FE /* SwiftWebVC.swift */; };
@@ -1480,6 +1481,8 @@
 		F7A321521E9E2A070069AD1B /* CCFavoritesCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CCFavoritesCell.xib; sourceTree = "<group>"; };
 		F7A321531E9E2A070069AD1B /* CCSynchronize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSynchronize.h; sourceTree = "<group>"; };
 		F7A321541E9E2A070069AD1B /* CCSynchronize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSynchronize.m; sourceTree = "<group>"; };
+		F7A321631E9E37960069AD1B /* CCActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActivity.h; sourceTree = "<group>"; };
+		F7A321641E9E37960069AD1B /* CCActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActivity.m; sourceTree = "<group>"; };
 		F7A54C341C6267B500E2C8BF /* CCExifGeo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCExifGeo.h; sourceTree = "<group>"; };
 		F7A54C351C6267B500E2C8BF /* CCExifGeo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCExifGeo.m; sourceTree = "<group>"; };
 		F7A582D61A24DAB500E903D7 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -2973,6 +2976,15 @@
 			path = Favorites;
 			sourceTree = "<group>";
 		};
+		F7A321621E9E37960069AD1B /* Activity */ = {
+			isa = PBXGroup;
+			children = (
+				F7A321631E9E37960069AD1B /* CCActivity.h */,
+				F7A321641E9E37960069AD1B /* CCActivity.m */,
+			);
+			path = Activity;
+			sourceTree = "<group>";
+		};
 		F7ACE4281BAC0268006C0017 /* Settings */ = {
 			isa = PBXGroup;
 			children = (
@@ -3368,6 +3380,7 @@
 				F7C1CDD91E6DFC6F005D92BE /* Brand */,
 				F70211F31BAC56E9003FC03E /* Main */,
 				F720E02A1E48C74C001A4B9E /* Actions */,
+				F7A321621E9E37960069AD1B /* Activity */,
 				F7ECBA6B1E239DCD003E6328 /* Create */,
 				F7A3214D1E9E2A070069AD1B /* Favorites */,
 				F7E95CEC1AC40BA40060D08E /* FileSystem */,
@@ -4156,6 +4169,7 @@
 				F77B0E121D118A16002130FE /* CCPatenteGuida.m in Sources */,
 				F7B1FBC61E72E3D1001781FE /* SwiftModalWebVC.swift in Sources */,
 				F7D6A0971D82DBFA0045AD1A /* CCMenu.m in Sources */,
+				F7A321651E9E37960069AD1B /* CCActivity.m in Sources */,
 				F77B0E131D118A16002130FE /* AppDelegate.m in Sources */,
 				F750374F1DBFA91A008FB480 /* NSArray+PureLayout.m in Sources */,
 				F7A13A031E7F3D5D00016680 /* CCProgressView.m in Sources */,

+ 36 - 0
iOSClient/Activity/CCActivity.h

@@ -0,0 +1,36 @@
+//
+//  CCActivity.h
+//  Crypto Cloud Technology Nextcloud
+//
+//  Created by Marino Faggiana on 12/04/17.
+//  Copyright (c) 2014 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  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 <Foundation/Foundation.h>
+
+@interface CCActivity : UICollectionViewController <UICollectionViewDataSource, UICollectionViewDelegate>
+
+@property NSUInteger pageIndex;
+
+@property (nonatomic, strong) NSDate *storeDateFirstActivity;
+@property (nonatomic, strong) NSString *pageType;
+
+- (void)reloadDatasource;
++ (CGFloat)getLabelHeight:(UILabel*)label width:(int)width;
+
+@end

+ 322 - 0
iOSClient/Activity/CCActivity.m

@@ -0,0 +1,322 @@
+//
+//  CCActivity.m
+//  Crypto Cloud Technology Nextcloud
+//
+//  Created by Marino Faggiana on 12/04/17.
+//  Copyright (c) 2014 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  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 "CCActivity.h"
+
+#import "AppDelegate.h"
+#import "CCSection.h"
+
+#define fontSizeData    [UIFont boldSystemFontOfSize:15]
+#define fontSizeAction  [UIFont systemFontOfSize:14]
+#define fontSizeNote    [UIFont systemFontOfSize:14]
+
+#define daysOfActivity  7
+
+@interface CCActivity ()
+{
+    BOOL _verbose;
+
+    // Datasource
+    NSArray *_sectionDataSource;
+}
+@end
+
+@implementation CCActivity
+
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark ===== Init =====
+#pragma --------------------------------------------------------------------------------------------
+
+-  (id)initWithCoder:(NSCoder *)aDecoder
+{
+    if (self = [super initWithCoder:aDecoder])  {
+        
+        app.activeActivity = self;
+    }
+    return self;
+}
+
+- (void)viewDidLoad {
+    
+    [super viewDidLoad];
+    
+    _verbose = [CCUtility getActivityVerboseHigh];
+    
+    _sectionDataSource = [NSArray new];
+    
+    self.title = NSLocalizedString(@"_activity_", nil);
+    
+    [self reloadDatasource];
+}
+
+// Apparirà
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    
+    _verbose = [CCUtility getActivityVerboseHigh];
+    
+    // Color
+    [CCAspect aspectNavigationControllerBar:self.navigationController.navigationBar encrypted:NO online:[app.reachability isReachable] hidden:NO];
+    [CCAspect aspectTabBar:self.tabBarController.tabBar hidden:NO];
+}
+
+// E' arrivato
+- (void)viewDidAppear:(BOOL)animated
+{
+    [super viewDidAppear:animated];
+    
+    [self reloadDatasource];
+}
+
+- (void)didReceiveMemoryWarning {
+    
+    [super didReceiveMemoryWarning];
+}
+
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark - ==== Datasource ====
+#pragma --------------------------------------------------------------------------------------------
+
+- (void)reloadDatasource
+{
+    // test
+    if (app.activeAccount.length == 0)
+        return;
+    
+    NSPredicate *predicate;
+        
+    NSDate *sixDaysAgo = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitDay value:-daysOfActivity toDate:[NSDate date] options:0];
+        
+    if (_verbose)
+        predicate = [NSPredicate predicateWithFormat:@"((account == %@) || (account == '')) AND (date > %@)", app.activeAccount, sixDaysAgo];
+    else
+        predicate = [NSPredicate predicateWithFormat:@"(account == %@) AND (verbose == %lu) AND (date > %@)", app.activeAccount, k_activityVerboseDefault, sixDaysAgo];
+
+    _sectionDataSource = [CCCoreData getAllTableActivityWithPredicate: predicate];
+        
+    [self reloadCollection];
+}
+
+- (void)reloadCollection
+{
+    NSDate *dateActivity;
+    
+    if ([_sectionDataSource count] == 0) {
+            
+        
+            
+    } else {
+            
+        dateActivity = ((TableActivity *)[_sectionDataSource objectAtIndex:0]).date;
+    }
+
+    if ([dateActivity compare:_storeDateFirstActivity] == NSOrderedDescending || _storeDateFirstActivity == nil || dateActivity == nil) {
+        _storeDateFirstActivity = dateActivity;
+        [self.collectionView reloadData];
+    }
+}
+    
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark - ==== Table ====
+#pragma --------------------------------------------------------------------------------------------
+
+- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
+{
+    return [_sectionDataSource count];
+}
+
+- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
+{
+    TableActivity *activity = [_sectionDataSource objectAtIndex:section];
+        
+    if ([activity.action isEqual: k_activityDebugActionDownload] || [activity.action isEqual: k_activityDebugActionUpload]) {
+        
+        if ([[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/%@.ico", app.directoryUser, activity.fileID]])
+            return 1;
+        else
+            return 0;
+    }
+    
+    return 0;
+}
+
+-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section
+{
+    TableActivity *activity = [_sectionDataSource objectAtIndex:section];
+    
+    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, collectionView.frame.size.width - 40, CGFLOAT_MAX)];
+    label.numberOfLines = 0;
+    label.lineBreakMode = NSLineBreakByWordWrapping;
+    [label sizeToFit];
+    
+    // Action
+    [label setFont:fontSizeAction];
+    label.text = [NSString stringWithFormat:@"%@ %@", activity.action, activity.file];
+    int heightAction = [[self class] getLabelHeight:label width:self.collectionView.frame.size.width];
+    
+    // Note
+    [label setFont:fontSizeNote];
+    
+    if (_verbose && activity.idActivity == 0 && [activity.selector length] > 0)
+        label.text = [NSString stringWithFormat:@"%@ Selector: %@", activity.note, activity.selector];
+    else
+        label.text = activity.note;
+    
+    int heightNote = [[self class] getLabelHeight:label width:self.collectionView.frame.size.width];
+    
+    int heightView = 40 + heightAction + heightNote + 17;
+    
+    return CGSizeMake(collectionView.frame.size.width, heightView);
+}
+
+- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
+{
+    UICollectionReusableView *reusableview;
+    
+    if (kind == UICollectionElementKindSectionHeader) {
+    
+        reusableview = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"header" forIndexPath:indexPath];
+        
+        TableActivity *activity = [_sectionDataSource objectAtIndex:indexPath.section];
+    
+        UILabel *dateLabel = (UILabel *)[reusableview viewWithTag:100];
+        UILabel *actionLabel = (UILabel *)[reusableview viewWithTag:101];
+        UILabel *noteLabel = (UILabel *)[reusableview viewWithTag:102];
+        UIImageView *typeImage = (UIImageView *) [reusableview viewWithTag:103];
+    
+        [dateLabel setFont:fontSizeData];
+        dateLabel.textColor = [UIColor colorWithRed:100.0/255.0 green:100.0/255.0 blue:100.0/255.0 alpha:1.0];
+    
+        if (_verbose) {
+        
+            dateLabel.text = [NSDateFormatter localizedStringFromDate:activity.date dateStyle:NSDateFormatterFullStyle timeStyle:NSDateFormatterMediumStyle];
+        
+        } else {
+        
+            NSDateComponents* comps = [[NSCalendar currentCalendar] components:NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay fromDate:activity.date];
+            dateLabel.text = [CCUtility getTitleSectionDate:[[NSCalendar currentCalendar] dateFromComponents:comps]];
+        }
+    
+        [actionLabel setFont:fontSizeAction];
+        [actionLabel sizeToFit];
+        actionLabel.text = [NSString stringWithFormat:@"%@ %@", activity.action, activity.file];
+
+        if ([activity.type isEqualToString:k_activityTypeInfo]) {
+        
+            actionLabel.textColor = COLOR_BRAND;
+        
+            if (activity.idActivity == 0)
+                typeImage.image = [UIImage imageNamed:@"activityTypeInfo"];
+            else
+                typeImage.image = [UIImage imageNamed:@"activityTypeInfoServer"];
+        }
+    
+        if ([activity.type isEqualToString:k_activityTypeSuccess]) {
+        
+            actionLabel.textColor = [UIColor colorWithRed:87.0/255.0 green:187.0/255.0 blue:57.0/255.0 alpha:1.0];;
+            typeImage.image = [UIImage imageNamed:@"activityTypeSuccess"];
+        }
+    
+        if ([activity.type isEqualToString:k_activityTypeFailure]) {
+        
+            actionLabel.textColor = [UIColor redColor];
+            typeImage.image = [UIImage imageNamed:@"activityTypeFailure"];
+        }
+    
+        [noteLabel setFont:fontSizeNote];
+        [noteLabel sizeToFit];
+        noteLabel.textColor = COLOR_TEXT_ANTHRACITE;
+        noteLabel.numberOfLines = 0;
+        noteLabel.lineBreakMode = NSLineBreakByWordWrapping;
+    
+        if (_verbose && activity.idActivity == 0 && [activity.selector length] > 0)
+            noteLabel.text = [NSString stringWithFormat:@"%@ Selector: %@", activity.note, activity.selector];
+        else
+            noteLabel.text = activity.note;
+    }
+    
+    if (kind == UICollectionElementKindSectionFooter) {
+        
+         reusableview = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"footer" forIndexPath:indexPath];
+    }
+    
+    return reusableview;
+}
+
+- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
+{
+    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
+    //cell.backgroundColor = [UIColor clearColor];
+    UIImageView *imageView = (UIImageView *)[cell viewWithTag:104];
+
+    TableActivity *activity = [_sectionDataSource objectAtIndex:indexPath.section];
+    
+    imageView.image = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.ico", app.directoryUser, activity.fileID]];
+    
+    return cell;
+}
+
+- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
+{
+    TableActivity *activity = [_sectionDataSource objectAtIndex:indexPath.section];
+    
+    CCMetadata *metadata = [CCCoreData getMetadataWithPreficate:[NSPredicate predicateWithFormat:@"(account == %@) AND (fileID == %@)", activity.account, activity.fileID] context:nil];
+    
+    if (metadata) {
+        
+        if (!self.splitViewController.isCollapsed && app.activeMain.detailViewController.isViewLoaded && app.activeMain.detailViewController.view.window)
+            [app.activeMain.navigationController popToRootViewControllerAnimated:NO];
+        
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
+            
+            [app.activeMain performSegueWithIdentifier:@"segueDetail" sender:metadata];            
+        });
+        
+    } else {
+        
+        [app messageNotification:@"_info_" description:@"_activity_file_not_present_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeInfo];
+    }
+}
+
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark - ==== Utility ====
+#pragma --------------------------------------------------------------------------------------------
+
++ (CGFloat)getLabelHeight:(UILabel*)label width:(int)width
+{
+    CGSize constraint = CGSizeMake(width, CGFLOAT_MAX);
+    
+    NSMutableParagraphStyle *paragraph = [NSMutableParagraphStyle new];
+    paragraph.lineBreakMode = NSLineBreakByWordWrapping;
+    NSDictionary *attributes = @{NSFontAttributeName : label.font, NSParagraphStyleAttributeName: paragraph};
+    
+    NSStringDrawingContext *context = [NSStringDrawingContext new];
+    CGSize boundingBox = [label.text boundingRectWithSize:constraint options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:context].size;
+    
+    CGSize size = CGSizeMake(ceil(boundingBox.width), ceil(boundingBox.height));
+    
+    return size.height;
+}
+
+@end

+ 3 - 2
iOSClient/AppDelegate.h

@@ -35,7 +35,7 @@
 #import "CCUtility.h"
 #import "CCControlCenter.h"
 #import "CCControlCenterTransfer.h"
-#import "CCControlCenterActivity.h"
+#import "CCActivity.h"
 #import "CCDetail.h"
 #import "CCQuickActions.h"
 #import "CCMain.h"
@@ -118,7 +118,6 @@
 // List Transfert
 @property (nonatomic, retain) CCControlCenter *controlCenter;
 @property (nonatomic, retain) CCControlCenterTransfer *controlCenterTransfer;
-@property (nonatomic, retain) CCControlCenterActivity *controlCenterActivity;
 
 // List Change Task
 @property (nonatomic, retain) NSMutableDictionary *listChangeTask;
@@ -135,6 +134,8 @@
 @property (nonatomic, strong) CCPhotosCameraUpload *activePhotosCameraUpload;
 @property (nonatomic, retain) CCDetail *activeDetail;
 @property (nonatomic, retain) CCSettings *activeSettings;
+@property (nonatomic, retain) CCActivity *activeActivity;
+
 
 @property (nonatomic, strong) NSMutableDictionary *listMainVC;
 @property (nonatomic, strong) NSMutableDictionary *listProgressMetadata;

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -1063,7 +1063,7 @@
         [CCCoreData addActivityServer:activity account:app.activeAccount];
     
     // Reload Activity Data Source
-    [app.controlCenterActivity reloadDatasource];
+    [app.activeActivity reloadDatasource];
 }
 
 - (void)getActivityServerFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode

+ 3 - 0
iOSClient/Main/CCMore.swift

@@ -131,6 +131,9 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         // Menu Function
         if (indexPath.section == 0) {
             
+            if (indexPath.row == 1) {
+                self.navigationController?.performSegue(withIdentifier: "segueActivity", sender: self)
+            }
             if (indexPath.row == 2) {
                 self.navigationController?.performSegue(withIdentifier: "segueLocalStorage", sender: self)
             }

+ 108 - 10
iOSClient/Main/Main.storyboard

@@ -58,7 +58,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="wVn-RD-GD2" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="11260" y="1218"/>
+            <point key="canvasLocation" x="12524" y="1218"/>
         </scene>
         <!--More-->
         <scene sceneID="Mdr-ch-zRI">
@@ -341,7 +341,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="TUv-7S-62D" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="11260" y="3024"/>
+            <point key="canvasLocation" x="12511" y="3246"/>
         </scene>
         <!--Navigation Controller-->
         <scene sceneID="eDq-6m-h8d">
@@ -360,7 +360,7 @@
                 </navigationController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="38M-dR-dlY" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="11260" y="2254"/>
+            <point key="canvasLocation" x="12511" y="2476"/>
         </scene>
         <!--Manage Account-->
         <scene sceneID="OhO-6f-Vhc">
@@ -380,7 +380,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="EDa-LU-0rn" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="13332" y="2254"/>
+            <point key="canvasLocation" x="14583" y="2476"/>
         </scene>
         <!--Manage Crypto Cloud-->
         <scene sceneID="cbW-au-eCe">
@@ -400,7 +400,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="ksn-Ew-8Z0" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="12631" y="2250"/>
+            <point key="canvasLocation" x="13881" y="2472"/>
         </scene>
         <!--Manage Camera Upload-->
         <scene sceneID="YAa-hT-VHe">
@@ -420,7 +420,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="g5a-uE-sF6" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="11932" y="2254"/>
+            <point key="canvasLocation" x="13183" y="2476"/>
         </scene>
         <!--Manage Optimizations-->
         <scene sceneID="dOW-Mw-bEM">
@@ -440,7 +440,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="0UA-CF-A4C" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="9895" y="2254"/>
+            <point key="canvasLocation" x="11145" y="2476"/>
         </scene>
         <!--Main Tab Bar Controller-->
         <scene sceneID="gY3-Ur-rTC">
@@ -676,7 +676,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="2YG-G9-yyB" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="10615" y="2254"/>
+            <point key="canvasLocation" x="11865" y="2476"/>
         </scene>
         <!--Manage Help-->
         <scene sceneID="Kwp-bi-zU9">
@@ -696,7 +696,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="oeH-9e-IVz" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="9212" y="2251"/>
+            <point key="canvasLocation" x="10463" y="2472"/>
         </scene>
         <!--Navigation Controller-->
         <scene sceneID="cip-AF-Ks2">
@@ -732,6 +732,7 @@
                         <segue destination="9DM-ts-oJu" kind="relationship" relationship="rootViewController" id="KD8-1A-v76"/>
                         <segue destination="amx-XG-NId" kind="show" identifier="segueSettings" id="iJw-qx-dwJ"/>
                         <segue destination="o4I-W3-sMH" kind="show" identifier="segueLocalStorage" id="iz8-HB-F2p"/>
+                        <segue destination="QIL-R2-8iE" kind="show" identifier="segueActivity" id="dwq-EG-6sD"/>
                     </connections>
                 </navigationController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="D7n-Z1-9wU" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -771,6 +772,103 @@
             </objects>
             <point key="canvasLocation" x="9849" y="1218"/>
         </scene>
+        <!--Activity-->
+        <scene sceneID="Mfj-Rm-dhR">
+            <objects>
+                <collectionViewController storyboardIdentifier="CCActivity" id="QIL-R2-8iE" customClass="CCActivity" sceneMemberID="viewController">
+                    <collectionView key="view" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" misplaced="YES" dataMode="prototypes" id="KRS-wA-Hbs">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="iB1-bP-HYQ">
+                            <size key="itemSize" width="40" height="40"/>
+                            <size key="headerReferenceSize" width="50" height="92"/>
+                            <size key="footerReferenceSize" width="50" height="5"/>
+                            <inset key="sectionInset" minX="48" minY="5" maxX="0.0" maxY="0.0"/>
+                        </collectionViewFlowLayout>
+                        <cells>
+                            <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="cell" id="PlB-7F-7NQ">
+                                <rect key="frame" x="48" y="97" width="40" height="40"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+                                    <rect key="frame" x="0.0" y="0.0" width="40" height="40"/>
+                                    <autoresizingMask key="autoresizingMask"/>
+                                    <subviews>
+                                        <imageView opaque="NO" userInteractionEnabled="NO" tag="104" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xxE-ZN-5bC">
+                                            <rect key="frame" x="0.0" y="0.0" width="40" height="40"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                        </imageView>
+                                    </subviews>
+                                </view>
+                            </collectionViewCell>
+                        </cells>
+                        <collectionReusableView key="sectionHeaderView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="header" id="c6C-th-mGd">
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="92"/>
+                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <subviews>
+                                <label opaque="NO" userInteractionEnabled="NO" tag="100" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zFm-yb-x7l">
+                                    <rect key="frame" x="48" y="8" width="319" height="20"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="20" id="Qjl-qZ-jEg"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                    <nil key="textColor"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qcm-XY-Fpz">
+                                    <rect key="frame" x="48" y="33" width="319" height="20"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="TWj-kc-Si2"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                    <nil key="textColor"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <imageView userInteractionEnabled="NO" tag="103" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="TlA-sj-tgw">
+                                    <rect key="frame" x="8" y="33" width="30" height="30"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="30" id="Ucg-P7-bvA"/>
+                                        <constraint firstAttribute="width" constant="30" id="vQc-T5-kTd"/>
+                                    </constraints>
+                                </imageView>
+                                <label opaque="NO" userInteractionEnabled="NO" tag="102" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Bo6-HW-PJo">
+                                    <rect key="frame" x="48" y="58" width="319" height="20"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="UM4-6y-8gx"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                    <nil key="textColor"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="zFm-yb-x7l" firstAttribute="trailing" secondItem="c6C-th-mGd" secondAttribute="trailingMargin" id="2Sc-H6-mz5"/>
+                                <constraint firstItem="qcm-XY-Fpz" firstAttribute="leading" secondItem="TlA-sj-tgw" secondAttribute="trailing" constant="10" id="6gb-jH-Jmp"/>
+                                <constraint firstItem="qcm-XY-Fpz" firstAttribute="trailing" secondItem="c6C-th-mGd" secondAttribute="trailingMargin" id="7s9-8J-8R5"/>
+                                <constraint firstItem="Bo6-HW-PJo" firstAttribute="top" secondItem="qcm-XY-Fpz" secondAttribute="bottom" constant="5" id="L4Z-x4-vef"/>
+                                <constraint firstItem="zFm-yb-x7l" firstAttribute="leading" secondItem="c6C-th-mGd" secondAttribute="leadingMargin" constant="40" id="Soc-qb-NoL"/>
+                                <constraint firstItem="Bo6-HW-PJo" firstAttribute="leading" secondItem="TlA-sj-tgw" secondAttribute="trailing" constant="10" id="Va6-nO-ZSm"/>
+                                <constraint firstItem="zFm-yb-x7l" firstAttribute="top" secondItem="c6C-th-mGd" secondAttribute="topMargin" id="YKi-3E-K3q"/>
+                                <constraint firstItem="Bo6-HW-PJo" firstAttribute="trailing" secondItem="c6C-th-mGd" secondAttribute="trailingMargin" id="avJ-9r-HJf"/>
+                                <constraint firstItem="TlA-sj-tgw" firstAttribute="leading" secondItem="c6C-th-mGd" secondAttribute="leadingMargin" id="mE0-4V-fsK"/>
+                                <constraint firstItem="TlA-sj-tgw" firstAttribute="top" secondItem="c6C-th-mGd" secondAttribute="topMargin" constant="25" id="qnN-Bw-afg"/>
+                                <constraint firstItem="qcm-XY-Fpz" firstAttribute="top" secondItem="zFm-yb-x7l" secondAttribute="bottom" constant="5" id="sMO-xL-xdp"/>
+                            </constraints>
+                        </collectionReusableView>
+                        <collectionReusableView key="sectionFooterView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="footer" id="nhY-ro-z91">
+                            <rect key="frame" x="0.0" y="137" width="375" height="5"/>
+                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                        </collectionReusableView>
+                        <connections>
+                            <outlet property="dataSource" destination="QIL-R2-8iE" id="Zgp-JD-dSD"/>
+                            <outlet property="delegate" destination="QIL-R2-8iE" id="27o-gc-9d0"/>
+                        </connections>
+                    </collectionView>
+                </collectionViewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="BFK-QR-oce" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="10503" y="1218"/>
+        </scene>
     </scenes>
     <resources>
         <image name="Plus" width="40" height="40"/>
@@ -783,6 +881,6 @@
         <image name="tabBarPhotos" width="25" height="21"/>
     </resources>
     <inferredMetricsTieBreakers>
-        <segue reference="45n-bF-9RO"/>
+        <segue reference="1IV-5w-SfJ"/>
     </inferredMetricsTieBreakers>
 </document>

+ 0 - 1
iOSClient/MenuAccount+ControlCenter/CCControlCenter.m

@@ -305,7 +305,6 @@
             _isOpen = YES;
 
             [app.controlCenterTransfer reloadDatasource];
-            [app.controlCenterActivity reloadDatasource];
         }
         
     } else {

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

@@ -36,7 +36,6 @@
 {
     if (self = [super initWithCoder:aDecoder])  {
         
-        app.controlCenterActivity = self;
     }
     return self;
 }

+ 2 - 2
iOSClient/MenuAccount+ControlCenter/CCControlCenterTransferCell.xib

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
         <capability name="Alignment constraints to the first baseline" minToolsVersion="6.0"/>
         <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>

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

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
         <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -22,10 +22,9 @@
         <scene sceneID="9Yy-2x-V4o">
             <objects>
                 <collectionViewController storyboardIdentifier="ControlCenterActivity" id="Sa9-Gr-Uug" customClass="CCControlCenterActivity" sceneMemberID="viewController">
-                    <collectionView key="view" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="cgR-Jd-WnD">
+                    <collectionView key="view" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" misplaced="YES" dataMode="prototypes" id="cgR-Jd-WnD">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                         <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="cmY-iB-PWk">
                             <size key="itemSize" width="40" height="40"/>
                             <size key="headerReferenceSize" width="50" height="92"/>

+ 2 - 2
iOSClient/Settings/CCManageHelp.m

@@ -130,7 +130,7 @@
         }
         
         // Clear Date read Activity for force reload datasource
-        app.controlCenterActivity.storeDateFirstActivity = nil;
+        app.activeActivity.storeDateFirstActivity = nil;
     }
 }
 
@@ -253,7 +253,7 @@
     
     [CCCoreData flushTableActivityAccount:app.activeAccount];
     
-    [app.controlCenterActivity reloadDatasource];
+    [app.activeActivity reloadDatasource];
 }
 
 @end