marinofaggiana 5 years ago
parent
commit
d469493bf2

+ 10 - 10
iOSClient/Main/Create cloud/NCCreateFormUploadConflict.storyboard

@@ -27,7 +27,7 @@
                                 <constraints>
                                     <constraint firstAttribute="height" constant="71" id="k4n-DL-b4D"/>
                                 </constraints>
-                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                 <nil key="textColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
@@ -38,25 +38,25 @@
                                         <rect key="frame" x="0.0" y="0.0" width="51" height="31"/>
                                     </switch>
                                     <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ge9-Fi-Rb1">
-                                        <rect key="frame" x="345" y="0.0" width="51" height="31"/>
+                                        <rect key="frame" x="340" y="0.0" width="51" height="31"/>
                                     </switch>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="New files" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="H7Y-Nu-nJ3">
-                                        <rect key="frame" x="0.0" y="36" width="70.5" height="24"/>
-                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                        <rect key="frame" x="0.0" y="36" width="63" height="24"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                         <nil key="textColor"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Already existing files" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3Tf-oD-aTF">
-                                        <rect key="frame" x="237" y="36" width="157" height="24"/>
-                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                        <rect key="frame" x="248" y="36" width="141" height="24"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                         <nil key="textColor"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                 </subviews>
                                 <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
                                 <constraints>
-                                    <constraint firstAttribute="trailing" secondItem="3Tf-oD-aTF" secondAttribute="trailing" id="0gO-Y8-9Dl"/>
-                                    <constraint firstAttribute="trailing" secondItem="ge9-Fi-Rb1" secondAttribute="trailing" id="AkQ-ni-sBE"/>
+                                    <constraint firstAttribute="trailing" secondItem="3Tf-oD-aTF" secondAttribute="trailing" constant="5" id="0gO-Y8-9Dl"/>
+                                    <constraint firstAttribute="trailing" secondItem="ge9-Fi-Rb1" secondAttribute="trailing" constant="5" id="AkQ-ni-sBE"/>
                                     <constraint firstItem="ge9-Fi-Rb1" firstAttribute="top" secondItem="qry-YF-g1N" secondAttribute="top" id="OXS-I0-XDN"/>
                                     <constraint firstAttribute="height" constant="65" id="PKH-cZ-F2x"/>
                                     <constraint firstItem="H7Y-Nu-nJ3" firstAttribute="top" secondItem="08D-oc-nWS" secondAttribute="bottom" constant="5" id="WLj-QZ-Ogj"/>
@@ -68,7 +68,7 @@
                                 </constraints>
                             </view>
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="wkN-gS-XKZ">
-                                <rect key="frame" x="10" y="247.5" width="394" height="544.5"/>
+                                <rect key="frame" x="10" y="257.5" width="394" height="534.5"/>
                                 <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
                                 <connections>
                                     <outlet property="dataSource" destination="30l-Wp-khL" id="TVO-SU-fFp"/>
@@ -112,7 +112,7 @@
                             <constraint firstItem="pSm-Za-OgF" firstAttribute="bottom" secondItem="Fow-JU-J8L" secondAttribute="bottom" constant="10" id="9H9-d9-7ST"/>
                             <constraint firstItem="pSm-Za-OgF" firstAttribute="trailing" secondItem="wkN-gS-XKZ" secondAttribute="trailing" constant="10" id="BDJ-k9-p0j"/>
                             <constraint firstItem="pSm-Za-OgF" firstAttribute="trailing" secondItem="qry-YF-g1N" secondAttribute="trailing" constant="10" id="GFR-EG-gbz"/>
-                            <constraint firstItem="wkN-gS-XKZ" firstAttribute="top" secondItem="qry-YF-g1N" secondAttribute="bottom" constant="10" id="HDO-22-kC7"/>
+                            <constraint firstItem="wkN-gS-XKZ" firstAttribute="top" secondItem="qry-YF-g1N" secondAttribute="bottom" constant="20" id="HDO-22-kC7"/>
                             <constraint firstItem="pSm-Za-OgF" firstAttribute="trailing" secondItem="bXc-v3-Lun" secondAttribute="trailing" constant="10" id="J1O-5e-Kr9"/>
                             <constraint firstItem="wkN-gS-XKZ" firstAttribute="leading" secondItem="pSm-Za-OgF" secondAttribute="leading" constant="10" id="JjQ-Dd-hXO"/>
                             <constraint firstItem="qry-YF-g1N" firstAttribute="top" secondItem="bXc-v3-Lun" secondAttribute="bottom" constant="10" id="Lrv-4d-zee"/>

+ 15 - 3
iOSClient/Main/Create cloud/NCCreateFormUploadConflict.swift

@@ -64,7 +64,7 @@ import Foundation
 extension NCCreateFormUploadConflict: UITableViewDelegate {
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return 100
+        return 120
     }
 }
 
@@ -77,14 +77,26 @@ extension NCCreateFormUploadConflict: UITableViewDataSource {
     }
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return metadatas.count
+        return metadatasConflict.count
     }
     
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         
         if let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as? NCCreateFormUploadConflictCell {
             
-            let metadata = metadatas[indexPath.row]
+            let metadata = metadatasConflict[indexPath.row]
+            
+            if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, fileNameView: metadata.fileName)) {
+                NCUtility.sharedInstance.loadImage(ocId: metadata.ocId, fileNameView: metadata.fileNameView) { (image) in
+                    cell.imageFile.image = image
+                }
+            } else {
+                if metadata.iconName.count > 0 {
+                    cell.imageFile.image = UIImage.init(named: metadata.iconName)
+                } else {
+                    cell.imageFile.image = UIImage.init(named: "file")
+                }
+            }
             
             cell.labelFileName.text = metadata.fileNameView
             

+ 10 - 10
iOSClient/Main/Create cloud/NCCreateFormUploadConflictCell.xib

@@ -10,13 +10,13 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" rowHeight="118" id="eGO-5i-ez1" customClass="NCCreateFormUploadConflictCell" customModule="Nextcloud" customModuleProvider="target">
-            <rect key="frame" x="0.0" y="0.0" width="589" height="117"/>
+            <rect key="frame" x="0.0" y="0.0" width="539" height="117"/>
             <autoresizingMask key="autoresizingMask"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="eGO-5i-ez1" id="y6Q-vz-Xda">
-                <rect key="frame" x="0.0" y="0.0" width="589" height="117"/>
+                <rect key="frame" x="0.0" y="0.0" width="539" height="117"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
-                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="WSQ-HI-Wkg">
+                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="WSQ-HI-Wkg">
                         <rect key="frame" x="5" y="5" width="50" height="50"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="50" id="cfG-23-jOI"/>
@@ -24,32 +24,32 @@
                         </constraints>
                     </imageView>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Hv8-qJ-lkR">
-                        <rect key="frame" x="63" y="5" width="521" height="21"/>
+                        <rect key="frame" x="63" y="5" width="471" height="21"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <nil key="textColor"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0hq-re-YVn">
-                        <rect key="frame" x="63" y="36" width="521" height="21"/>
+                        <rect key="frame" x="63" y="36" width="471" height="21"/>
                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                         <nil key="textColor"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="FUL-4V-OgL">
-                        <rect key="frame" x="6" y="75" width="51" height="31"/>
+                        <rect key="frame" x="5" y="75" width="51" height="31"/>
                     </switch>
                     <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jBi-8r-tc5">
-                        <rect key="frame" x="530" y="75" width="51" height="31"/>
+                        <rect key="frame" x="485" y="75" width="51" height="31"/>
                     </switch>
                 </subviews>
                 <constraints>
                     <constraint firstItem="Hv8-qJ-lkR" firstAttribute="leading" secondItem="WSQ-HI-Wkg" secondAttribute="trailing" constant="8" id="1jg-OV-Uy4"/>
                     <constraint firstItem="WSQ-HI-Wkg" firstAttribute="leading" secondItem="y6Q-vz-Xda" secondAttribute="leading" constant="5" id="2lG-h5-UAz"/>
-                    <constraint firstItem="FUL-4V-OgL" firstAttribute="leading" secondItem="y6Q-vz-Xda" secondAttribute="leading" constant="6" id="7rL-L6-lPT"/>
+                    <constraint firstItem="FUL-4V-OgL" firstAttribute="leading" secondItem="y6Q-vz-Xda" secondAttribute="leading" constant="5" id="7rL-L6-lPT"/>
                     <constraint firstItem="0hq-re-YVn" firstAttribute="leading" secondItem="WSQ-HI-Wkg" secondAttribute="trailing" constant="8" id="DtR-am-9J1"/>
                     <constraint firstItem="0hq-re-YVn" firstAttribute="top" secondItem="Hv8-qJ-lkR" secondAttribute="bottom" constant="10" id="QuN-sJ-Hb0"/>
                     <constraint firstItem="WSQ-HI-Wkg" firstAttribute="top" secondItem="y6Q-vz-Xda" secondAttribute="top" constant="5" id="TCY-Jz-66h"/>
-                    <constraint firstAttribute="trailing" secondItem="jBi-8r-tc5" secondAttribute="trailing" constant="10" id="Vv4-gx-2nv"/>
+                    <constraint firstAttribute="trailing" secondItem="jBi-8r-tc5" secondAttribute="trailing" constant="5" id="Vv4-gx-2nv"/>
                     <constraint firstAttribute="trailing" secondItem="0hq-re-YVn" secondAttribute="trailing" constant="5" id="bsY-9d-e86"/>
                     <constraint firstAttribute="trailing" secondItem="Hv8-qJ-lkR" secondAttribute="trailing" constant="5" id="m8P-xo-tVw"/>
                     <constraint firstItem="jBi-8r-tc5" firstAttribute="centerY" secondItem="FUL-4V-OgL" secondAttribute="centerY" id="oZZ-e1-nuY"/>
@@ -64,7 +64,7 @@
                 <outlet property="switchAlreadyExistingFile" destination="jBi-8r-tc5" id="L0M-zb-k6v"/>
                 <outlet property="switchNewFile" destination="FUL-4V-OgL" id="jhA-7N-hqA"/>
             </connections>
-            <point key="canvasLocation" x="135.50724637681159" y="21.09375"/>
+            <point key="canvasLocation" x="99.275362318840592" y="21.09375"/>
         </tableViewCell>
     </objects>
 </document>