marinofaggiana há 4 anos atrás
pai
commit
c2bd759997

+ 0 - 4
Nextcloud.xcodeproj/project.pbxproj

@@ -51,7 +51,6 @@
 		F70F2BA5225F2D8900EBB73E /* ZIPFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F70F2BA4225F2D8900EBB73E /* ZIPFoundation.framework */; };
 		F710C5F02471A6D1009AD8B7 /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F710C5EF2471A6D1009AD8B7 /* Sentry.framework */; };
 		F710D1F52405770F00A6033D /* NCViewerPDF.swift in Sources */ = {isa = PBXBuildFile; fileRef = F710D1F42405770F00A6033D /* NCViewerPDF.swift */; };
-		F710D1F724057C9400A6033D /* NCDetailNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F710D1F624057C9400A6033D /* NCDetailNavigationController.swift */; };
 		F710D1F924057C9D00A6033D /* NCDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F710D1F824057C9D00A6033D /* NCDetailViewController.swift */; };
 		F710D1FE24057E5E00A6033D /* NCActionSheetHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = F710D1FB24057E5E00A6033D /* NCActionSheetHeader.swift */; };
 		F710D1FF24057E5E00A6033D /* NCActionSheetHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F710D1FC24057E5E00A6033D /* NCActionSheetHeaderView.swift */; };
@@ -391,7 +390,6 @@
 		F70F2BA4225F2D8900EBB73E /* ZIPFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ZIPFoundation.framework; path = Carthage/Build/iOS/ZIPFoundation.framework; sourceTree = "<group>"; };
 		F710C5EF2471A6D1009AD8B7 /* Sentry.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sentry.framework; path = Carthage/Build/iOS/Sentry.framework; sourceTree = "<group>"; };
 		F710D1F42405770F00A6033D /* NCViewerPDF.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCViewerPDF.swift; sourceTree = "<group>"; };
-		F710D1F624057C9400A6033D /* NCDetailNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCDetailNavigationController.swift; sourceTree = "<group>"; };
 		F710D1F824057C9D00A6033D /* NCDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCDetailViewController.swift; sourceTree = "<group>"; };
 		F710D1FB24057E5E00A6033D /* NCActionSheetHeader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCActionSheetHeader.swift; sourceTree = "<group>"; };
 		F710D1FC24057E5E00A6033D /* NCActionSheetHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCActionSheetHeaderView.swift; sourceTree = "<group>"; };
@@ -1124,7 +1122,6 @@
 		F7A68AAC25382EE300A7C2E8 /* Detail */ = {
 			isa = PBXGroup;
 			children = (
-				F710D1F624057C9400A6033D /* NCDetailNavigationController.swift */,
 				F7A68AB525382F0D00A7C2E8 /* NCDetail.storyboard */,
 				F710D1F824057C9D00A6033D /* NCDetailViewController.swift */,
 			);
@@ -2019,7 +2016,6 @@
 				371B5A2E23D0B04500FAFAE9 /* NCMainMenuTableViewController.swift in Sources */,
 				F77444F8222816D5000D5EB0 /* NCPickerViewController.swift in Sources */,
 				F72A47EC2487B06B005AD489 /* NCOperationQueue.swift in Sources */,
-				F710D1F724057C9400A6033D /* NCDetailNavigationController.swift in Sources */,
 				F769454622E9F1B0000A798A /* NCShareCommon.swift in Sources */,
 				F7B0C1751EE839A30033AC24 /* NCAutoUpload.m in Sources */,
 				F738E8421F90FFD100F95C8E /* NCManageEndToEndEncryption.m in Sources */,

+ 13 - 14
iOSClient/AppDelegate.m

@@ -760,6 +760,12 @@
         
         dispatch_async(dispatch_get_main_queue(), ^{
 
+            UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
+            if ([tabBarController isKindOfClass:[UITabBarController class]]) {
+                
+            }
+            
+            
             UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
             if ([splitViewController isKindOfClass:[UISplitViewController class]]) {
                 UINavigationController *navigationControllerMaster = (UINavigationController *)splitViewController.viewControllers.firstObject;
@@ -809,20 +815,13 @@
     
     [UIApplication sharedApplication].applicationIconBadgeNumber = total;
     
-    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
-    if ([splitViewController isKindOfClass:[UISplitViewController class]]) {
-        UINavigationController *navigationController = (UINavigationController *)[splitViewController.viewControllers firstObject];
-        if ([navigationController isKindOfClass:[UINavigationController class]]) {
-            UITabBarController *tabBarController = (UITabBarController *)navigationController.topViewController;
-            if ([tabBarController isKindOfClass:[UITabBarController class]]) {
-                UITabBarItem *tabBarItem = [tabBarController.tabBar.items objectAtIndex:0];
-                    
-                if (total > 0) {
-                    [tabBarItem setBadgeValue:[NSString stringWithFormat:@"%li", (unsigned long)total]];
-                } else {
-                    [tabBarItem setBadgeValue:nil];
-                }
-            }
+    UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
+    if ([tabBarController isKindOfClass:[UITabBarController class]]) {
+        UITabBarItem *tabBarItem = [tabBarController.tabBar.items objectAtIndex:0];
+        if (total > 0) {
+            [tabBarItem setBadgeValue:[NSString stringWithFormat:@"%li", (unsigned long)total]];
+        } else {
+            [tabBarItem setBadgeValue:nil];
         }
     }
 }

+ 0 - 66
iOSClient/Detail/NCDetailNavigationController.swift

@@ -1,66 +0,0 @@
-//
-//  NCDetailNavigationController.swift
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 07/02/2020.
-//  Copyright © 2020 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  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
-
-class NCDetailNavigationController: UINavigationController {
-    
-    let appDelegate = UIApplication.shared.delegate as! AppDelegate
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        
-        NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: k_notificationCenter_changeTheming), object: nil)
-        
-        changeTheming()
-    }
-    
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        
-        let buttonMore = UIBarButtonItem.init(image: CCGraphics.changeThemingColorImage(UIImage(named: "more"), width: 50, height: 50, color: NCBrandColor.sharedInstance.textView), style: .plain, target: self, action: #selector(self.openMenuMore))
-        topViewController?.navigationItem.rightBarButtonItem = buttonMore
-               
-        topViewController?.navigationItem.leftBarButtonItem = nil
-        if let splitViewController = self.splitViewController {
-            if !splitViewController.isCollapsed {
-                topViewController?.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem
-            }
-        }        
-    }
-    
-    //MARK: - NotificationCenter
-
-    @objc func changeTheming() {
-        navigationBar.barTintColor = NCBrandColor.sharedInstance.backgroundView
-        navigationBar.tintColor = NCBrandColor.sharedInstance.brandElement
-    }
-
-    //MARK: - Button
-
-    @objc func openMenuMore() {
-        if let metadata = appDelegate.activeDetail?.metadata {
-            self.toggleMoreMenu(viewController: self, metadata: metadata)
-        }
-    }
-}

+ 2 - 1
iOSClient/Main/Menu/NCDetailNavigationController+Menu.swift

@@ -24,6 +24,7 @@
 import FloatingPanel
 import NCCommunication
 
+/*
 extension NCDetailNavigationController {
 
     @objc func toggleMoreMenu(viewController: UIViewController, metadata: tableMetadata) {
@@ -308,4 +309,4 @@ extension NCDetailNavigationController {
         return actions
     }
 }
-
+*/