Kaynağa Gözat

page control center

Marino Faggiana 8 yıl önce
ebeveyn
işleme
9813e17e82

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

@@ -85,19 +85,6 @@
     // TEST
     //_mainView.backgroundColor = [UIColor yellowColor];
     
-    /*
-    _tableView = [[UITableView alloc] init];
-    [_tableView setFrame:CGRectMake(0, 0, self.navigationBar.frame.size.width, 0)];
-    _tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-    [_tableView registerNib:[UINib nibWithNibName:@"CCControlCenterTransferCell" bundle:nil] forCellReuseIdentifier:@"ControlCenterTransferCell"];
-    _tableView.delegate = self;
-    _tableView.dataSource = self;
-    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
-    _tableView.backgroundColor = [UIColor clearColor];
-
-    [_mainView addSubview:_tableView];
-    */
-    
     // Create data model
     _pageType = @[k_pageControlCenterTransfer, k_pageControlCenterActivity];
     _currentPageType = k_pageControlCenterTransfer;
@@ -125,6 +112,7 @@
 
     [_mainView addSubview:_noRecord];
     
+    
     _imageDrag = [[UIImageView alloc] init];
     [_imageDrag setFrame:CGRectMake(0, 0, self.navigationBar.frame.size.width, 0)];
     _imageDrag.image = [UIImage imageNamed:image_drag];
@@ -243,7 +231,6 @@
             _mainView.frame = CGRectMake(0, 0, navigationBarW, currentPoint.y);
             _pageViewController.view.frame = CGRectMake(0, currentPoint.y - heightScreen + navigationBarH, navigationBarW, heightTableView);
             _noRecord.frame = CGRectMake(0, currentPoint.y - centerMaxH - TOOLBAR_TRANSFER_H, navigationBarW, SIZE_FONT_NORECORD+10);
-            //_toolbarTask.frame = CGRectMake(0, currentPoint.y - BORDER_TOUCH_UPDOWN - TOOLBAR_TRANSFER_H - TOOLBAR_ADD_BORDER/2, _mainView.frame.size.width, TOOLBAR_TRANSFER_H);
             _imageDrag.frame = CGRectMake(0, currentPoint.y - BORDER_TOUCH_UPDOWN, navigationBarW, BORDER_TOUCH_UPDOWN);
             _endLine.frame = CGRectMake(0, currentPoint.y - BORDER_TOUCH_UPDOWN, navigationBarW, 1);
         
@@ -314,7 +301,6 @@
     _mainView.frame = CGRectMake(0, 0, size.width, [self getMaxH]);
     _pageViewController.view.frame = CGRectMake(0, navigationBarH, _mainView.frame.size.width, _mainView.frame.size.height - navigationBarH - BORDER_TOUCH_UPDOWN - TOOLBAR_TRANSFER_H - TOOLBAR_ADD_BORDER);
     _noRecord.frame = CGRectMake(0, _mainView.frame.size.height / 2 - TOOLBAR_TRANSFER_H, _mainView.frame.size.width, SIZE_FONT_NORECORD+10);
-    //_toolbarTask.frame = CGRectMake(0, _mainView.frame.size.height - BORDER_TOUCH_UPDOWN - TOOLBAR_TRANSFER_H - TOOLBAR_ADD_BORDER/2, _mainView.frame.size.width, TOOLBAR_TRANSFER_H);
     _imageDrag.frame = CGRectMake(0, _mainView.frame.size.height - BORDER_TOUCH_UPDOWN, _mainView.frame.size.width, BORDER_TOUCH_UPDOWN);
     _endLine.frame = CGRectMake(0, _mainView.frame.size.height - BORDER_TOUCH_UPDOWN, _mainView.frame.size.width, 1);
     

+ 4 - 9
iOSClient/MenuAccount+ControlCenter/CCControlCenterPageContent.m

@@ -36,20 +36,18 @@
     // Custom Cell
     [_tableView registerNib:[UINib nibWithNibName:@"CCControlCenterTransferCell" bundle:nil] forCellReuseIdentifier:@"ControlCenterTransferCell"];
     
-   
     _tableView.delegate = self;
     _tableView.dataSource = self;
     _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
     _tableView.backgroundColor = [UIColor redColor];
+    
+    [self reloadDatasource];
 }
 
 // Apparirà
 - (void)viewWillAppear:(BOOL)animated
 {
     [super viewWillAppear:animated];
-    
-    
-    [self reloadDatasource];
 }
 
 // E' arrivato
@@ -223,15 +221,12 @@
     if (app.activeAccount.length == 0)
         return;
     
-   // if (_isOpen) {
-        
-        NSArray *recordsTableMetadata = [CCCoreData getTableMetadataWithPredicate:[NSPredicate predicateWithFormat:@"(account == %@) AND ((session CONTAINS 'upload') OR (session CONTAINS 'download' AND (sessionSelector != 'loadPlist')))", app.activeAccount] fieldOrder:@"sessionTaskIdentifier" ascending:YES];
+    NSArray *recordsTableMetadata = [CCCoreData getTableMetadataWithPredicate:[NSPredicate predicateWithFormat:@"(account == %@) AND ((session CONTAINS 'upload') OR (session CONTAINS 'download' AND (sessionSelector != 'loadPlist')))", app.activeAccount] fieldOrder:@"sessionTaskIdentifier" ascending:YES];
         
-        _sectionDataSource  = [CCSection creataDataSourseSectionMetadata:recordsTableMetadata listProgressMetadata:app.listProgressMetadata groupByField:@"session" replaceDateToExifDate:NO activeAccount:app.activeAccount];
+    _sectionDataSource  = [CCSection creataDataSourseSectionMetadata:recordsTableMetadata listProgressMetadata:app.listProgressMetadata groupByField:@"session" replaceDateToExifDate:NO activeAccount:app.activeAccount];
         
     //    if ([_sectionDataSource.allRecordsDataSource count] == 0) _noRecord.hidden = NO;
     //    else _noRecord.hidden = YES;
-    //}
     
     [_tableView reloadData];