Browse Source

Merge pull request #2071 from nextcloud/fix/441

Fix/441
Marino Faggiana 2 years ago
parent
commit
753c86d70a

+ 25 - 12
iOSClient/Diagnostics/NCCapabilitiesViewController.swift

@@ -86,66 +86,79 @@ class NCCapabilitiesViewController: UIViewController, UIDocumentInteractionContr
 
         textView.layer.cornerRadius = 15
         textView.layer.masksToBounds = true
+        textView.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         statusFileSharing.layer.cornerRadius = 12.5
         statusFileSharing.layer.borderWidth = 0.5
-        statusFileSharing.layer.borderColor = UIColor.gray.cgColor
+        statusFileSharing.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
         statusFileSharing.layer.masksToBounds = true
+        statusFileSharing.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         statusExternalSite.layer.cornerRadius = 12.5
         statusExternalSite.layer.borderWidth = 0.5
-        statusExternalSite.layer.borderColor = UIColor.gray.cgColor
+        statusExternalSite.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
         statusExternalSite.layer.masksToBounds = true
+        statusExternalSite.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         statusEndToEndEncryption.layer.cornerRadius = 12.5
         statusEndToEndEncryption.layer.borderWidth = 0.5
-        statusEndToEndEncryption.layer.borderColor = UIColor.gray.cgColor
+        statusEndToEndEncryption.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
         statusEndToEndEncryption.layer.masksToBounds = true
+        statusEndToEndEncryption.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         statusActivity.layer.cornerRadius = 12.5
         statusActivity.layer.borderWidth = 0.5
-        statusActivity.layer.borderColor = UIColor.gray.cgColor
+        statusActivity.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
         statusActivity.layer.masksToBounds = true
+        statusActivity.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         statusNotification.layer.cornerRadius = 12.5
         statusNotification.layer.borderWidth = 0.5
-        statusNotification.layer.borderColor = UIColor.gray.cgColor
+        statusNotification.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
         statusNotification.layer.masksToBounds = true
+        statusNotification.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         statusDeletedFiles.layer.cornerRadius = 12.5
         statusDeletedFiles.layer.borderWidth = 0.5
-        statusDeletedFiles.layer.borderColor = UIColor.gray.cgColor
+        statusDeletedFiles.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
         statusDeletedFiles.layer.masksToBounds = true
+        statusDeletedFiles.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         statusText.layer.cornerRadius = 12.5
         statusText.layer.borderWidth = 0.5
-        statusText.layer.borderColor = UIColor.gray.cgColor
+        statusText.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
         statusText.layer.masksToBounds = true
+        statusText.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         statusCollabora.layer.cornerRadius = 12.5
         statusCollabora.layer.borderWidth = 0.5
-        statusCollabora.layer.borderColor = UIColor.gray.cgColor
+        statusCollabora.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
         statusCollabora.layer.masksToBounds = true
+        statusCollabora.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         statusOnlyOffice.layer.cornerRadius = 12.5
         statusOnlyOffice.layer.borderWidth = 0.5
-        statusOnlyOffice.layer.borderColor = UIColor.gray.cgColor
+        statusOnlyOffice.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
         statusOnlyOffice.layer.masksToBounds = true
+        statusOnlyOffice.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         statusUserStatus.layer.cornerRadius = 12.5
         statusUserStatus.layer.borderWidth = 0.5
-        statusUserStatus.layer.borderColor = UIColor.gray.cgColor
+        statusUserStatus.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
         statusUserStatus.layer.masksToBounds = true
+        statusUserStatus.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         statusComments.layer.cornerRadius = 12.5
         statusComments.layer.borderWidth = 0.5
-        statusComments.layer.borderColor = UIColor.gray.cgColor
+        statusComments.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
         statusComments.layer.masksToBounds = true
+        statusComments.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         statusLockFile.layer.cornerRadius = 12.5
         statusLockFile.layer.borderWidth = 0.5
-        statusLockFile.layer.borderColor = UIColor.gray.cgColor
+        statusLockFile.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
         statusLockFile.layer.masksToBounds = true
+        statusLockFile.backgroundColor = NCBrandColor.shared.secondarySystemBackground
 
         imageFileSharing.image = UIImage(named: "share")!.image(color: NCBrandColor.shared.gray, size: 50)
         imageExternalSite.image = NCUtility.shared.loadImage(named: "network", color: NCBrandColor.shared.gray)

+ 8 - 9
iOSClient/Files/NCFiles.swift

@@ -77,6 +77,9 @@ class NCFiles: NCCollectionViewCommon {
     override func reloadDataSource(forced: Bool = true) {
         super.reloadDataSource()
 
+        DispatchQueue.main.async {
+            self.refreshControl.endRefreshing()
+        }
         guard !isSearching, !appDelegate.account.isEmpty, !appDelegate.urlBase.isEmpty, !serverUrl.isEmpty else { return }
 
         self.metadatasSource = NCManageDatabase.shared.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, serverUrl))
@@ -104,7 +107,6 @@ class NCFiles: NCCollectionViewCommon {
             searchResults: self.searchResults)
 
         DispatchQueue.main.async {
-            self.refreshControl.endRefreshing()
             self.collectionView.reloadData()
         }
     }
@@ -127,14 +129,11 @@ class NCFiles: NCCollectionViewCommon {
                 }
             }
 
-            DispatchQueue.main.async {
-                self.isReloadDataSourceNetworkInProgress = false
-                self.richWorkspaceText = tableDirectory?.richWorkspace
-                self.refreshControl.endRefreshing()
-                self.collectionView?.reloadData()
-                if metadatasUpdate?.count ?? 0 > 0 || metadatasDelete?.count ?? 0 > 0 || forced {
-                    self.reloadDataSource(forced: false)
-                }
+            self.isReloadDataSourceNetworkInProgress = false
+            self.richWorkspaceText = tableDirectory?.richWorkspace
+
+            if metadatasUpdate?.count ?? 0 > 0 || metadatasDelete?.count ?? 0 > 0 || forced {
+                self.reloadDataSource(forced: false)
             }
         }
     }

+ 2 - 0
iOSClient/Login/NCLogin.swift

@@ -101,6 +101,8 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
             navBarAppearance.configureWithTransparentBackground()
             navBarAppearance.shadowColor = .clear
             navBarAppearance.shadowImage = UIImage()
+            navBarAppearance.titleTextAttributes = [.foregroundColor: textColor]
+            navBarAppearance.largeTitleTextAttributes = [.foregroundColor: textColor]
             self.navigationController?.navigationBar.standardAppearance = navBarAppearance
             self.navigationController?.view.backgroundColor = NCBrandColor.shared.customer
         } else {

+ 5 - 3
iOSClient/Notification/NCNotification.swift

@@ -164,18 +164,20 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate, NCEmpty
         cell.primary.isEnabled = false
         cell.primary.isHidden = true
         cell.primary.titleLabel?.font = .systemFont(ofSize: 15)
-        cell.primary.setTitleColor(.white, for: .normal)
         cell.primary.layer.cornerRadius = 15
         cell.primary.layer.masksToBounds = true
         cell.primary.layer.backgroundColor = NCBrandColor.shared.brandElement.cgColor
+        cell.primary.setTitleColor(NCBrandColor.shared.brandText, for: .normal)
 
         cell.secondary.isEnabled = false
         cell.secondary.isHidden = true
         cell.secondary.titleLabel?.font = .systemFont(ofSize: 15)
-        cell.secondary.setTitleColor(NCBrandColor.shared.label, for: .normal)
         cell.secondary.layer.cornerRadius = 15
         cell.secondary.layer.masksToBounds = true
-        cell.secondary.layer.backgroundColor = NCBrandColor.shared.systemFill.cgColor
+        cell.secondary.layer.borderWidth = 1
+        cell.secondary.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
+        cell.secondary.layer.backgroundColor = NCBrandColor.shared.secondarySystemBackground.cgColor
+        cell.secondary.setTitleColor(.black, for: .normal)
 
         // Action
         if let actions = notification.actions,

+ 12 - 0
iOSClient/Select/NCSelect.swift

@@ -813,18 +813,30 @@ class NCSelectCommandView: UIView {
         selectButton?.layer.cornerRadius = 15
         selectButton?.layer.masksToBounds = true
         selectButton?.setTitle(NSLocalizedString("_select_", comment: ""), for: .normal)
+        selectButton?.backgroundColor = NCBrandColor.shared.brand
+        selectButton?.setTitleColor(UIColor(white: 1, alpha: 0.3), for: .highlighted)
+        selectButton?.setTitleColor(NCBrandColor.shared.brandText, for: .normal)
 
         createFolderButton?.layer.cornerRadius = 15
         createFolderButton?.layer.masksToBounds = true
         createFolderButton?.setTitle(NSLocalizedString("_create_folder_", comment: ""), for: .normal)
+        createFolderButton?.backgroundColor = NCBrandColor.shared.brand
+        createFolderButton?.setTitleColor(UIColor(white: 1, alpha: 0.3), for: .highlighted)
+        createFolderButton?.setTitleColor(NCBrandColor.shared.brandText, for: .normal)
 
         copyButton?.layer.cornerRadius = 15
         copyButton?.layer.masksToBounds = true
         copyButton?.setTitle(NSLocalizedString("_copy_", comment: ""), for: .normal)
+        copyButton?.backgroundColor = NCBrandColor.shared.brand
+        copyButton?.setTitleColor(UIColor(white: 1, alpha: 0.3), for: .highlighted)
+        copyButton?.setTitleColor(NCBrandColor.shared.brandText, for: .normal)
 
         moveButton?.layer.cornerRadius = 15
         moveButton?.layer.masksToBounds = true
         moveButton?.setTitle(NSLocalizedString("_move_", comment: ""), for: .normal)
+        moveButton?.backgroundColor = NCBrandColor.shared.brand
+        moveButton?.setTitleColor(UIColor(white: 1, alpha: 0.3), for: .highlighted)
+        moveButton?.setTitleColor(NCBrandColor.shared.brandText, for: .normal)
     }
 
     @IBAction func createFolderButtonPressed(_ sender: UIButton) {

+ 4 - 6
iOSClient/Share/Advanced/NCShareAdvancePermissionFooter.swift

@@ -37,23 +37,21 @@ class NCShareAdvancePermissionFooter: UIView {
         self.delegate = delegate
         backgroundColor = .clear
 
-        buttonCancel.backgroundColor = .clear
-        buttonCancel.addTarget(self, action: #selector(cancelClicked), for: .touchUpInside)
         buttonCancel.setTitle(NSLocalizedString("_cancel_", comment: ""), for: .normal)
-
         buttonCancel.layer.cornerRadius = 25
         buttonCancel.layer.masksToBounds = true
         buttonCancel.layer.borderWidth = 1
-        buttonCancel.backgroundColor = NCBrandColor.shared.secondarySystemBackground
         buttonCancel.layer.borderColor = NCBrandColor.shared.systemGray.cgColor
-        buttonCancel.setTitleColor(NCBrandColor.shared.label.withAlphaComponent(0.3), for: .highlighted)
+        buttonCancel.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+        buttonCancel.addTarget(self, action: #selector(cancelClicked), for: .touchUpInside)
+        buttonCancel.setTitleColor(.black, for: .normal)
 
         buttonNext.setTitle(NSLocalizedString(delegate?.isNewShare == true ? "_share_" : "_save_", comment: ""), for: .normal)
         buttonNext.layer.cornerRadius = 25
         buttonNext.layer.masksToBounds = true
         buttonNext.backgroundColor = NCBrandColor.shared.brand
         buttonNext.addTarget(self, action: #selector(nextClicked), for: .touchUpInside)
-        buttonNext.setTitleColor(UIColor(white: 1, alpha: 0.3), for: .highlighted)
+        buttonNext.setTitleColor(NCBrandColor.shared.brandText, for: .normal)
     }
 
     @objc func cancelClicked() {

+ 5 - 6
iOSClient/UserStatus/NCUserStatus.storyboard

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="QH7-hC-pPW">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="QH7-hC-pPW">
     <device id="retina6_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -236,7 +236,7 @@
                                                 </constraints>
                                                 <prototypes>
                                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" rowHeight="45" id="laP-fj-qDh">
-                                                        <rect key="frame" x="0.0" y="24.333333969116211" width="408" height="45"/>
+                                                        <rect key="frame" x="0.0" y="44.666666030883789" width="408" height="45"/>
                                                         <autoresizingMask key="autoresizingMask"/>
                                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="laP-fj-qDh" id="HIM-ev-wMc">
                                                             <rect key="frame" x="0.0" y="0.0" width="408" height="45"/>
@@ -334,11 +334,10 @@
                                     </label>
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="tailTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3CT-dJ-sEj">
                                         <rect key="frame" x="10" y="67" width="192.66666666666666" height="30"/>
-                                        <color key="backgroundColor" systemColor="systemGray6Color"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="30" id="1F4-Cv-RzK"/>
                                         </constraints>
-                                        <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                         <state key="normal" title="clear status message"/>
                                         <connections>
                                             <action selector="actionClearStatusMessage:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="kSK-3g-AiY"/>
@@ -349,7 +348,7 @@
                                         <constraints>
                                             <constraint firstAttribute="height" constant="30" id="66i-0j-Qrn"/>
                                         </constraints>
-                                        <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                         <state key="normal" title="set status message"/>
                                         <connections>
                                             <action selector="actionSetStatusMessage:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="p47-hL-BCM"/>

+ 3 - 0
iOSClient/Utility/CCUtility.h

@@ -183,6 +183,9 @@
 + (BOOL)getPresentErrorITMS90076;
 + (void)setPresentErrorITMS90076:(BOOL)set;
 
++ (BOOL)getPlayerPlay;
++ (void)setPlayerPlay:(BOOL)set;
+
 // ===== Varius =====
 
 + (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL;

+ 11 - 0
iOSClient/Utility/CCUtility.m

@@ -734,6 +734,17 @@
     [UICKeyChainStore setString:sSet forKey:@"errorITMS90076" service:NCGlobal.shared.serviceShareKeyChain];
 }
 
++ (BOOL)getPlayerPlay
+{
+    return [[UICKeyChainStore stringForKey:@"playerPlay" service:NCGlobal.shared.serviceShareKeyChain] boolValue];
+}
+
++ (void)setPlayerPlay:(BOOL)set
+{
+    NSString *sSet = (set) ? @"true" : @"false";
+    [UICKeyChainStore setString:sSet forKey:@"playerPlay" service:NCGlobal.shared.serviceShareKeyChain];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Various =====
 #pragma --------------------------------------------------------------------------------------------

+ 1 - 1
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift

@@ -186,7 +186,7 @@ class NCPlayer: NSObject {
                         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterShowPlayerToolBar, userInfo: ["ocId":self.metadata.ocId, "enableTimerAutoHide": false])
                     }
                     self.activateObserver()
-                    if self.autoPlay {
+                    if self.autoPlay || CCUtility.getPlayerPlay() {
                         self.player?.play()
                     }
                     self.isStartPlayer = true

+ 2 - 0
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift

@@ -427,10 +427,12 @@ class NCPlayerToolBar: UIView {
     @IBAction func tapPlayerPause(_ sender: Any) {
 
         if ncplayer?.player?.timeControlStatus == .playing {
+            CCUtility.setPlayerPlay(false)
             ncplayer?.playerPause()
             ncplayer?.saveCurrentTime()
             timerAutoHide?.invalidate()
         } else if ncplayer?.player?.timeControlStatus == .paused {
+            CCUtility.setPlayerPlay(true)
             ncplayer?.playerPlay()
             startTimerAutoHide()
         } else if ncplayer?.player?.timeControlStatus == .waitingToPlayAtSpecifiedRate {

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

@@ -388,6 +388,7 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate {
     }
 
     @objc func gestureOpenPdfThumbnail(_ recognizer: UIScreenEdgePanGestureRecognizer) {
+        guard let pdfDocument = pdfView.document, !pdfDocument.isLocked else { return }
 
         if UIDevice.current.userInterfaceIdiom == .phone && self.pdfThumbnailScrollView.isHidden {
             if let tipView = self.tipView {