Browse Source

fix gui

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
be31317bef
2 changed files with 18 additions and 9 deletions
  1. 2 2
      Nextcloud.xcodeproj/project.pbxproj
  2. 16 7
      iOSClient/Share/NCSharePaging.swift

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -4134,8 +4134,8 @@
 			isa = XCRemoteSwiftPackageReference;
 			repositoryURL = "https://github.com/rechsteiner/Parchment";
 			requirement = {
-				branch = main;
-				kind = branch;
+				kind = upToNextMajorVersion;
+				minimumVersion = 3.0.0;
 			};
 		};
 		F7D56B182972405400FA46C4 /* XCRemoteSwiftPackageReference "Mantis" */ = {

+ 16 - 7
iOSClient/Share/NCSharePaging.swift

@@ -99,7 +99,11 @@ class NCSharePaging: UIViewController {
 
         NotificationCenter.default.addObserver(self, selector: #selector(self.orientationDidChange), name: UIDevice.orientationDidChangeNotification, object: nil)
 
-        pagingViewController.indicatorColor = NCBrandColor.shared.brandElement
+        if sharingEnabled {
+            pagingViewController.indicatorColor = NCBrandColor.shared.brandElement
+        } else {
+            pagingViewController.indicatorColor = .clear
+        }
         (pagingViewController.view as? NCSharePagingView)?.setupConstraints()
         pagingViewController.reloadMenu()
     }
@@ -241,12 +245,17 @@ extension NCSharePaging: PagingViewControllerDataSource {
 
     func pagingViewController(_: PagingViewController, pagingItemAt index: Int) -> PagingItem {
 
-        switch NCGlobal.NCSharePagingIndex(rawValue: index) {
-        case .activity:
-            return PagingIndexItem(index: index, title: NSLocalizedString("_activity_", comment: ""))
-        case .sharing:
-            return PagingIndexItem(index: index, title: NSLocalizedString("_sharing_", comment: ""))
-        default:
+        if sharingEnabled {
+            switch NCGlobal.NCSharePagingIndex(rawValue: index) {
+            case .activity:
+                return PagingIndexItem(index: index, title: NSLocalizedString("_activity_", comment: ""))
+            case .sharing:
+                return PagingIndexItem(index: index, title: NSLocalizedString("_sharing_", comment: ""))
+            default:
+                return PagingIndexItem(index: index, title: "")
+            }
+        } else {
+            self.title = NSLocalizedString("_activity_", comment: "")
             return PagingIndexItem(index: index, title: "")
         }
     }