marinofaggiana 4 жил өмнө
parent
commit
40023356c0

+ 26 - 7
iOSClient/Main/NCMainNavigationController.swift

@@ -34,14 +34,33 @@ class NCMainNavigationController: UINavigationController {
     }
     }
     
     
     @objc func changeTheming() {
     @objc func changeTheming() {
-                   
-        navigationBar.barStyle = .default
+                  
+        if #available(iOS 13.0, *) {
+            
+            var navBarAppearance = UINavigationBarAppearance()
+            
+            navBarAppearance.configureWithOpaqueBackground()
+            navBarAppearance.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
+            navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.backgroundView
+            navBarAppearance.shadowColor = .clear
+            navBarAppearance.shadowImage = UIImage()
+            
+            navBarAppearance = UINavigationBarAppearance()
+            
+            navBarAppearance.configureWithOpaqueBackground()
+            navBarAppearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.sharedInstance.textView]
+            navBarAppearance.backgroundColor = NCBrandColor.sharedInstance.tabBar
 
 
-        navigationBar.backgroundColor = NCBrandColor.sharedInstance.backgroundView
-        navigationBar.barTintColor = NCBrandColor.sharedInstance.backgroundView
+            navigationBar.scrollEdgeAppearance = navBarAppearance
+            navigationBar.standardAppearance = navBarAppearance
+            
+        } else {
+            navigationBar.barStyle = .default
+            navigationBar.barTintColor = NCBrandColor.sharedInstance.backgroundView
+            navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor:NCBrandColor.sharedInstance.textView]
+            navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor:NCBrandColor.sharedInstance.textView]
+        }
         navigationBar.tintColor = NCBrandColor.sharedInstance.brandElement
         navigationBar.tintColor = NCBrandColor.sharedInstance.brandElement
-
-        navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor:NCBrandColor.sharedInstance.textView]
-        navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor:NCBrandColor.sharedInstance.textView]            
+        navigationBar.setNeedsLayout()
     }
     }
 }
 }

+ 2 - 2
iOSClient/Viewer/NCViewerVideo/NCViewerVideo.storyboard

@@ -18,7 +18,7 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                         <subviews>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U2u-Ng-quR">
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U2u-Ng-quR">
-                                <rect key="frame" x="0.0" y="49" width="414" height="847"/>
+                                <rect key="frame" x="0.0" y="49" width="414" height="837"/>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             </view>
                             </view>
                         </subviews>
                         </subviews>
@@ -26,7 +26,7 @@
                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
                         <constraints>
                             <constraint firstItem="U2u-Ng-quR" firstAttribute="top" secondItem="I8r-2q-gEp" secondAttribute="top" constant="5" id="JMx-LP-euj"/>
                             <constraint firstItem="U2u-Ng-quR" firstAttribute="top" secondItem="I8r-2q-gEp" secondAttribute="top" constant="5" id="JMx-LP-euj"/>
-                            <constraint firstAttribute="bottom" secondItem="U2u-Ng-quR" secondAttribute="bottom" id="OB5-oL-uWd"/>
+                            <constraint firstAttribute="bottom" secondItem="U2u-Ng-quR" secondAttribute="bottom" constant="10" id="OB5-oL-uWd"/>
                             <constraint firstAttribute="trailing" secondItem="U2u-Ng-quR" secondAttribute="trailing" id="fK9-2n-mIB"/>
                             <constraint firstAttribute="trailing" secondItem="U2u-Ng-quR" secondAttribute="trailing" id="fK9-2n-mIB"/>
                             <constraint firstItem="U2u-Ng-quR" firstAttribute="leading" secondItem="ZUd-xF-jbc" secondAttribute="leading" id="zBR-Jl-ZtK"/>
                             <constraint firstItem="U2u-Ng-quR" firstAttribute="leading" secondItem="ZUd-xF-jbc" secondAttribute="leading" id="zBR-Jl-ZtK"/>
                         </constraints>
                         </constraints>

+ 1 - 0
iOSClient/Viewer/NCViewerVideo/NCViewerVideo.swift

@@ -43,6 +43,7 @@ class NCViewerVideo: UIViewController {
         NotificationCenter.default.addObserver(self, selector: #selector(moveFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_moveFile), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(moveFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_moveFile), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(viewUnload), name: NSNotification.Name(rawValue: k_notificationCenter_menuDetailClose), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(viewUnload), name: NSNotification.Name(rawValue: k_notificationCenter_menuDetailClose), object: nil)
         
         
+        view.backgroundColor = .black
         let frame = CGRect(x: 0, y: 0, width: backgroundView.frame.width, height: backgroundView.frame.height)
         let frame = CGRect(x: 0, y: 0, width: backgroundView.frame.width, height: backgroundView.frame.height)
         NCViewerVideoCommon.sharedInstance.viewMedia(metadata, view: backgroundView, frame: frame)
         NCViewerVideoCommon.sharedInstance.viewMedia(metadata, view: backgroundView, frame: frame)
     }
     }