marinofaggiana 4 жил өмнө
parent
commit
00be65fe4c

+ 7 - 3
iOSClient/Main/Cell/NCListCell.swift

@@ -39,6 +39,7 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCImageCell
     @IBOutlet weak var labelInfo: UILabel!
 
     @IBOutlet weak var imageShared: UIImageView!
+    @IBOutlet weak var buttonShared: UIButton!
     @IBOutlet weak var sharedLeftConstraint: NSLayoutConstraint!
 
     @IBOutlet weak var imageMore: UIImageView!
@@ -61,9 +62,7 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCImageCell
 
     override func awakeFromNib() {
         super.awakeFromNib()
-       
-        separator.backgroundColor = NCBrandColor.sharedInstance.separator
-        
+               
         imageItem.layer.cornerRadius = 6
         imageItem.layer.masksToBounds = true
         
@@ -120,6 +119,11 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCImageCell
         imageMore.isHidden = true
         sharedLeftConstraint.constant = 5
     }
+    
+    func hideButtonShare(status: Bool) {
+        imageShared.isHidden = status
+        buttonShared.isHidden = status
+    }
 }
 
 protocol NCListCellDelegate {

+ 1 - 0
iOSClient/Main/Cell/NCListCell.xib

@@ -148,6 +148,7 @@
             <size key="customSize" width="650" height="58"/>
             <connections>
                 <outlet property="buttonMore" destination="yhy-xd-w5C" id="agm-M9-xtq"/>
+                <outlet property="buttonShared" destination="o4u-0K-Qpt" id="5hT-Su-kWL"/>
                 <outlet property="imageFavorite" destination="C4K-Nv-phA" id="3nc-zz-N5c"/>
                 <outlet property="imageItem" destination="w2m-Vw-hpd" id="iY5-ed-crD"/>
                 <outlet property="imageItemLeftConstraint" destination="mBb-ff-7HD" id="fsR-5N-1NC"/>

+ 3 - 0
iOSClient/Main/Collection/NCCollectionCommon.swift

@@ -290,6 +290,9 @@ class NCCollectionCommon: NSObject {
                 cell.imageStatus.image = NCCollectionCommonImages.cellLivePhotoImage
             }
             
+            // Button Share
+            cell.hideButtonShare(status: metadata.e2eEncrypted)
+            
             // Remove last separator
             if collectionView.numberOfItems(inSection: indexPath.section) == indexPath.row + 1 {
                 cell.separator.isHidden = true

+ 11 - 9
iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift

@@ -129,16 +129,18 @@ extension NCCollectionViewCommon {
         }
 
         // All
-        actions.append(
-            NCMenuAction(
-                title: NSLocalizedString("_details_", comment: ""),
-                icon: CCGraphics.changeThemingColorImage(UIImage(named: "details"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                action: { menuAction in
-                    NCMainCommon.shared.openShare(ViewController: self, metadata: metadata, indexPage: 0)
-                }
+        if !metadata.e2eEncrypted {
+            actions.append(
+                NCMenuAction(
+                    title: NSLocalizedString("_details_", comment: ""),
+                    icon: CCGraphics.changeThemingColorImage(UIImage(named: "details"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
+                    action: { menuAction in
+                        NCMainCommon.shared.openShare(ViewController: self, metadata: metadata, indexPage: 0)
+                    }
+                )
             )
-        )
-
+        }
+        
         if !metadata.directory && !NCBrandOptions.sharedInstance.disable_openin_file {
             actions.append(
                 NCMenuAction(