Browse Source

new function closeAllMenu

Marino Faggiana 8 years ago
parent
commit
ff46afdc11

+ 2 - 0
iOSClient/AppDelegate.m

@@ -275,6 +275,8 @@
 //
 - (void)applicationWillResignActive:(UIApplication *)application
 {
+    [_activeMain closeAllMenu];
+    
     [self updateApplicationIconBadgeNumber];
 }
 

+ 1 - 0
iOSClient/Main/CCMain.h

@@ -74,6 +74,7 @@
 @property (nonatomic, weak) CCDetail *detailViewController;
 @property (nonatomic, strong) UISearchController *searchController;
 
+- (void)closeAllMenu;
 - (void)returnCreate:(NSInteger)type;
 
 - (void)createFolderCameraUpload;

+ 12 - 19
iOSClient/Main/CCMain.m

@@ -284,15 +284,7 @@
 {
     [super viewWillDisappear:animated];
     
-    // Close MainMenu & SelectMenu
-    if (app.reMainMenu.isOpen || app.reSelectMenu.isOpen) {
-        
-        [app.reMainMenu close];
-        [app.reSelectMenu close];
-    }
-    
-    // Close Menu Logo
-    [CCMenu dismissMenu];    
+    [self closeAllMenu];
 }
 
 - (void)didReceiveMemoryWarning
@@ -595,10 +587,6 @@
         self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:buttonMore, nil];
 
     self.navigationItem.leftBarButtonItem = nil;
-    
-    // close Menu
-    [app.reSelectMenu close];
-    [app.reMainMenu close];
 }
 
 - (void)setUINavigationBarSelected
@@ -616,12 +604,7 @@
 
 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
 {
-    // close the menus
-    if (app.reMainMenu.isOpen)
-        [app.reMainMenu close];
-    
-    if (app.reSelectMenu.isOpen)
-        [app.reSelectMenu close];
+    [self closeAllMenu];
     
     [coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
         
@@ -635,6 +618,16 @@
     [self tableViewSelect:NO];
 }
 
+- (void)closeAllMenu
+{
+    // close Menu
+    [app.reSelectMenu close];
+    [app.reMainMenu close];
+    
+    // Close Menu Logo
+    [CCMenu dismissMenu];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Document Picker =====
 #pragma --------------------------------------------------------------------------------------------

+ 3 - 5
iOSClient/MenuAccount+ControlCenter/CCControlCenterActivity.m

@@ -78,13 +78,11 @@
         return;
     
     if (app.controlCenter.isOpen) {
-        
-         //_sectionDataSource = [CCCoreData getAllTableActivityWithPredicate:[NSPredicate predicateWithFormat:@"(account == %@) AND (idActivity != 0)", app.activeAccount]];
-        
+                
         if ([CCUtility getActivityVerboseHigh])
-            _sectionDataSource = [CCCoreData getAllTableActivityWithPredicate:[NSPredicate predicateWithFormat:@"(account == %@)", app.activeAccount]];
+            _sectionDataSource = [CCCoreData getAllTableActivityWithPredicate:[NSPredicate predicateWithFormat:@"((account == %@) || (account == ''))", app.activeAccount]];
         else
-            _sectionDataSource = [CCCoreData getAllTableActivityWithPredicate:[NSPredicate predicateWithFormat:@"((account == %@) || (account == '')) AND (verbose == %lu)", app.activeAccount, k_activityVerboseDefault]];
+            _sectionDataSource = [CCCoreData getAllTableActivityWithPredicate:[NSPredicate predicateWithFormat:@"(account == %@) AND (verbose == %lu)", app.activeAccount, k_activityVerboseDefault]];
         
         if ([[app.controlCenter getActivePage] isEqualToString:k_pageControlCenterActivity]) {