Browse Source

new share view

marinofaggiana 5 years ago
parent
commit
012d00fa43

+ 15 - 0
iOSClient/Images.xcassets/shareTypeEmail.imageset/Contents.json

@@ -0,0 +1,15 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "shareTypeEmail.pdf"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "preserves-vector-representation" : true
+  }
+}

BIN
iOSClient/Images.xcassets/shareTypeEmail.imageset/shareTypeEmail.pdf


+ 15 - 0
iOSClient/Images.xcassets/shareTypeGroup.imageset/Contents.json

@@ -0,0 +1,15 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "shareTypeGroup.pdf"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "preserves-vector-representation" : true
+  }
+}

BIN
iOSClient/Images.xcassets/shareTypeGroup.imageset/shareTypeGroup.pdf


+ 15 - 0
iOSClient/Images.xcassets/shareTypeLink.imageset/Contents.json

@@ -0,0 +1,15 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "shareTypeLink.pdf"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "preserves-vector-representation" : true
+  }
+}

BIN
iOSClient/Images.xcassets/shareTypeLink.imageset/shareTypeLink.pdf


+ 15 - 0
iOSClient/Images.xcassets/shareTypeUser.imageset/Contents.json

@@ -0,0 +1,15 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "shareTypeUser.pdf"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  },
+  "properties" : {
+    "preserves-vector-representation" : true
+  }
+}

BIN
iOSClient/Images.xcassets/shareTypeUser.imageset/shareTypeUser.pdf


+ 6 - 0
iOSClient/Share/NCShare.swift

@@ -212,12 +212,17 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
         
         dropDown.anchorView = searchField
         dropDown.bottomOffset = CGPoint(x: 0, y: searchField.bounds.height)
+        dropDown.width = searchField.bounds.width
         
         dropDown.cellNib = UINib(nibName: "NCShareUserDropDownCell", bundle: nil)
         dropDown.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in
             guard let cell = cell as? NCShareUserDropDownCell else { return }
             let item = items[index]
             NCShareCommon.sharedInstance.downloadAvatar(user: item.name, cell: cell)
+            if item.shareeType == 0 { cell.imageShareeType.image = UIImage(named: "shareTypeUser")}
+            if item.shareeType == 1 { cell.imageShareeType.image = UIImage(named: "shareTypeGroup")}
+            if item.shareeType == 3 { cell.imageShareeType.image = UIImage(named: "shareTypeLink")}
+            if item.shareeType == 4 { cell.imageShareeType.image = UIImage(named: "shareTypeEmail")}
         }
         
         dropDown.selectionAction = { [weak self] (index, item) in
@@ -366,4 +371,5 @@ protocol NCShareUserCellDelegate {
 class NCShareUserDropDownCell: DropDownCell {
     
     @IBOutlet weak var imageItem: UIImageView!
+    @IBOutlet weak var imageShareeType: UIImageView!
 }

+ 14 - 4
iOSClient/Share/NCShareUserDropDownCell.xib

@@ -12,7 +12,7 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="NCShareUserDropDownCell" customModule="Nextcloud" customModuleProvider="target">
-            <rect key="frame" x="0.0" y="0.0" width="359" height="50"/>
+            <rect key="frame" x="0.0" y="0.0" width="487" height="50"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
                 <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="avatar" translatesAutoresizingMaskIntoConstraints="NO" id="wwI-k5-kbU" customClass="NCAvatar" customModule="Nextcloud" customModuleProvider="target">
@@ -31,16 +31,25 @@
                     </userDefinedRuntimeAttributes>
                 </imageView>
                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VIB-Xt-ckX">
-                    <rect key="frame" x="50" y="9" width="45" height="31"/>
+                    <rect key="frame" x="50" y="9" width="397" height="31"/>
                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     <nil key="highlightedColor"/>
                 </label>
+                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="PlH-LZ-AzK">
+                    <rect key="frame" x="457" y="15" width="20" height="20"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="20" id="Ej8-sj-gmZ"/>
+                        <constraint firstAttribute="height" constant="20" id="pRc-Ln-wNF"/>
+                    </constraints>
+                </imageView>
             </subviews>
             <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
             <constraints>
                 <constraint firstAttribute="bottom" secondItem="VIB-Xt-ckX" secondAttribute="bottom" constant="10" id="0zj-tF-bzC"/>
-                <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="VIB-Xt-ckX" secondAttribute="trailing" constant="8" id="OSg-Aj-BFF"/>
+                <constraint firstAttribute="trailing" secondItem="PlH-LZ-AzK" secondAttribute="trailing" constant="10" id="K4R-2t-kFs"/>
+                <constraint firstItem="PlH-LZ-AzK" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="KFn-uE-DTl"/>
+                <constraint firstItem="PlH-LZ-AzK" firstAttribute="leading" secondItem="VIB-Xt-ckX" secondAttribute="trailing" constant="10" id="Lxn-FE-sOF"/>
                 <constraint firstItem="VIB-Xt-ckX" firstAttribute="leading" secondItem="wwI-k5-kbU" secondAttribute="trailing" constant="10" id="aUx-ZS-D4Q"/>
                 <constraint firstItem="VIB-Xt-ckX" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="9" id="fWz-fu-Ghl"/>
                 <constraint firstItem="wwI-k5-kbU" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="oNR-Ox-93x"/>
@@ -50,9 +59,10 @@
             <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
             <connections>
                 <outlet property="imageItem" destination="wwI-k5-kbU" id="SMZ-ie-2Ak"/>
+                <outlet property="imageShareeType" destination="PlH-LZ-AzK" id="rxA-rl-7xs"/>
                 <outlet property="optionLabel" destination="VIB-Xt-ckX" id="swX-Pi-eTf"/>
             </connections>
-            <point key="canvasLocation" x="632.79999999999995" y="412.89355322338832"/>
+            <point key="canvasLocation" x="735.20000000000005" y="412.89355322338832"/>
         </view>
     </objects>
     <resources>