Browse Source

update UI

Marino Faggiana 6 years ago
parent
commit
102a9354ac
2 changed files with 42 additions and 47 deletions
  1. 9 20
      iOSClient/Trash/NCTrashListCell.swift
  2. 33 27
      iOSClient/Trash/NCTrashListCell.xib

+ 9 - 20
iOSClient/Trash/NCTrashListCell.swift

@@ -16,12 +16,12 @@ class NCTrashListCell: UICollectionViewCell {
     @IBOutlet weak var labelTitle: UILabel!
     @IBOutlet weak var labelInfo: UILabel!
     
-    @IBOutlet weak var restore: UIImageView!
-    @IBOutlet weak var tapRestore: UIImageView!
-
     @IBOutlet weak var more: UIImageView!
-    @IBOutlet weak var tapMore: UIImageView!
+    @IBOutlet weak var restore: UIImageView!
 
+    @IBOutlet weak var buttonMore: UIButton!
+    @IBOutlet weak var buttonRestore: UIButton!
+    
     @IBOutlet weak var separator: UIView!
 
     var delegate: NCTrashListDelegate?
@@ -35,26 +35,15 @@ class NCTrashListCell: UICollectionViewCell {
         more.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "more"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)
         
         separator.backgroundColor = NCBrandColor.sharedInstance.seperator
-        
-        let tapGestureRestore = UITapGestureRecognizer(target: self, action: #selector(NCTrashListCell.tapRestore(sender:)))
-        addGestureRecognizer(tapGestureRestore)
-        tapGestureRestore.numberOfTapsRequired = 1
-        tapRestore.isUserInteractionEnabled = true
-        tapRestore.addGestureRecognizer(tapGestureRestore)
-        
-        let tapGestureMore = UITapGestureRecognizer(target: self, action: #selector(NCTrashListCell.tapMore(sender:)))
-        addGestureRecognizer(tapGestureMore)
-        tapGestureMore.numberOfTapsRequired = 1
-        tapMore.isUserInteractionEnabled = true
-        tapMore.addGestureRecognizer(tapGestureMore)
     }
     
-    @objc func tapRestore(sender: UITapGestureRecognizer) {
-        delegate?.tapRestoreItem(with: fileID)
-    }
-    @objc func tapMore(sender: UITapGestureRecognizer) {
+    @IBAction func touchUpInsideMore(_ sender: Any) {
         delegate?.tapMoreItem(with: fileID)
     }
+    
+    @IBAction func touchUpInsideRestore(_ sender: Any) {
+        delegate?.tapRestoreItem(with: fileID)
+    }
 }
 
 protocol NCTrashListDelegate {

+ 33 - 27
iOSClient/Trash/NCTrashListCell.xib

@@ -27,24 +27,27 @@
                         </constraints>
                     </imageView>
                     <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UtT-L6-mgW" userLabel="Label Title">
-                        <rect key="frame" x="55" y="13" width="417" height="18"/>
+                        <rect key="frame" x="55" y="13" width="425" height="18"/>
                         <fontDescription key="fontDescription" type="system" pointSize="15"/>
                         <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" tag="102" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AXX-71-9Q6" userLabel="Label Info File">
-                        <rect key="frame" x="55" y="31" width="417" height="15"/>
+                        <rect key="frame" x="55" y="31" width="425" height="15"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="d22-W3-pnz" userLabel="tapMore">
+                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yhy-xd-w5C" userLabel="buttonMore">
                         <rect key="frame" x="540" y="0.0" width="60" height="60"/>
                         <constraints>
-                            <constraint firstAttribute="height" constant="60" id="0DY-32-6ZD"/>
-                            <constraint firstAttribute="width" constant="60" id="0aK-fH-Yu4"/>
+                            <constraint firstAttribute="width" constant="60" id="ZgH-mI-l2k"/>
+                            <constraint firstAttribute="height" constant="60" id="woC-64-Tyc"/>
                         </constraints>
-                    </imageView>
+                        <connections>
+                            <action selector="touchUpInsideMore:" destination="jxV-Pk-fPt" eventType="touchUpInside" id="mrd-cC-VV8"/>
+                        </connections>
+                    </button>
                     <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="dgL-g5-Nkc" userLabel="More">
                         <rect key="frame" x="560" y="20" width="20" height="20"/>
                         <constraints>
@@ -52,13 +55,16 @@
                             <constraint firstAttribute="height" constant="20" id="Jet-eo-x1M" userLabel="height = 20"/>
                         </constraints>
                     </imageView>
-                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="nwZ-pi-Igj" userLabel="restore">
-                        <rect key="frame" x="500" y="20" width="20" height="20"/>
+                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3mk-e2-iDg" userLabel="buttonRestore">
+                        <rect key="frame" x="480" y="0.0" width="60" height="60"/>
                         <constraints>
-                            <constraint firstAttribute="width" constant="20" id="5Zc-h7-ZRJ"/>
-                            <constraint firstAttribute="height" constant="20" id="xvo-pN-hfE"/>
+                            <constraint firstAttribute="height" constant="60" id="c3w-wJ-nqd"/>
+                            <constraint firstAttribute="width" constant="60" id="eC4-Ee-c7B"/>
                         </constraints>
-                    </imageView>
+                        <connections>
+                            <action selector="touchUpInsideRestore:" destination="jxV-Pk-fPt" eventType="touchUpInside" id="xMV-fb-0ta"/>
+                        </connections>
+                    </button>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Egg-cb-EhZ" userLabel="Separator">
                         <rect key="frame" x="45" y="59" width="555" height="1"/>
                         <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -67,47 +73,47 @@
                             <constraint firstAttribute="height" constant="1" id="G5S-67-boG"/>
                         </constraints>
                     </view>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="qR4-Xj-bmo" userLabel="tapRestore">
-                        <rect key="frame" x="480" y="0.0" width="60" height="60"/>
+                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="nwZ-pi-Igj" userLabel="restore">
+                        <rect key="frame" x="500" y="20" width="20" height="20"/>
                         <constraints>
-                            <constraint firstAttribute="height" constant="60" id="1PC-Az-sTW"/>
-                            <constraint firstAttribute="width" constant="60" id="9V3-4O-QtD"/>
+                            <constraint firstAttribute="width" constant="20" id="5Zc-h7-ZRJ"/>
+                            <constraint firstAttribute="height" constant="20" id="xvo-pN-hfE"/>
                         </constraints>
                     </imageView>
                 </subviews>
             </view>
             <constraints>
-                <constraint firstItem="nwZ-pi-Igj" firstAttribute="centerY" secondItem="qR4-Xj-bmo" secondAttribute="centerY" id="2kA-Bs-F1L"/>
-                <constraint firstItem="qR4-Xj-bmo" firstAttribute="leading" secondItem="AXX-71-9Q6" secondAttribute="trailing" constant="8" id="5Bg-iG-g1D"/>
-                <constraint firstItem="dgL-g5-Nkc" firstAttribute="centerX" secondItem="d22-W3-pnz" secondAttribute="centerX" id="7ir-57-5fQ"/>
                 <constraint firstItem="Gu8-oz-zWa" firstAttribute="bottom" secondItem="Egg-cb-EhZ" secondAttribute="bottom" id="81D-sw-EaX"/>
-                <constraint firstItem="nwZ-pi-Igj" firstAttribute="centerX" secondItem="qR4-Xj-bmo" secondAttribute="centerX" id="Ayt-Rm-giN"/>
-                <constraint firstItem="dgL-g5-Nkc" firstAttribute="centerY" secondItem="d22-W3-pnz" secondAttribute="centerY" id="F7Q-Co-oIr"/>
+                <constraint firstItem="nwZ-pi-Igj" firstAttribute="centerY" secondItem="3mk-e2-iDg" secondAttribute="centerY" id="A31-Yy-Gyn"/>
                 <constraint firstItem="Egg-cb-EhZ" firstAttribute="leading" secondItem="w2m-Vw-hpd" secondAttribute="trailing" id="JCm-UU-Pxu"/>
-                <constraint firstItem="qR4-Xj-bmo" firstAttribute="leading" secondItem="UtT-L6-mgW" secondAttribute="trailing" constant="8" id="NUN-8y-Sux"/>
+                <constraint firstItem="dgL-g5-Nkc" firstAttribute="centerY" secondItem="yhy-xd-w5C" secondAttribute="centerY" id="OMy-Cu-HAx"/>
                 <constraint firstItem="UtT-L6-mgW" firstAttribute="leading" secondItem="w2m-Vw-hpd" secondAttribute="trailing" constant="10" id="PQ8-0b-fLa"/>
+                <constraint firstItem="yhy-xd-w5C" firstAttribute="leading" secondItem="3mk-e2-iDg" secondAttribute="trailing" id="PxA-lT-Gll"/>
                 <constraint firstItem="AXX-71-9Q6" firstAttribute="leading" secondItem="w2m-Vw-hpd" secondAttribute="trailing" constant="10" id="Qvq-r5-AX9"/>
-                <constraint firstItem="d22-W3-pnz" firstAttribute="centerY" secondItem="Gu8-oz-zWa" secondAttribute="centerY" id="Spf-sY-iBZ"/>
+                <constraint firstItem="3mk-e2-iDg" firstAttribute="leading" secondItem="AXX-71-9Q6" secondAttribute="trailing" id="UtX-Ca-aBN"/>
+                <constraint firstItem="dgL-g5-Nkc" firstAttribute="centerX" secondItem="yhy-xd-w5C" secondAttribute="centerX" id="Y8o-r5-jeN"/>
+                <constraint firstItem="yhy-xd-w5C" firstAttribute="centerY" secondItem="Gu8-oz-zWa" secondAttribute="centerY" id="ZO7-Ny-L3I"/>
+                <constraint firstItem="3mk-e2-iDg" firstAttribute="leading" secondItem="UtT-L6-mgW" secondAttribute="trailing" id="cEw-b3-odo"/>
                 <constraint firstItem="Gu8-oz-zWa" firstAttribute="bottom" secondItem="AXX-71-9Q6" secondAttribute="bottom" constant="14" id="d06-sn-I3Y"/>
-                <constraint firstItem="qR4-Xj-bmo" firstAttribute="centerY" secondItem="Gu8-oz-zWa" secondAttribute="centerY" id="hMm-kr-vzh"/>
                 <constraint firstItem="Gu8-oz-zWa" firstAttribute="trailing" secondItem="Egg-cb-EhZ" secondAttribute="trailing" id="k8f-bU-D6I"/>
+                <constraint firstItem="nwZ-pi-Igj" firstAttribute="centerY" secondItem="Gu8-oz-zWa" secondAttribute="centerY" id="ldm-kv-P98"/>
                 <constraint firstItem="w2m-Vw-hpd" firstAttribute="leading" secondItem="Gu8-oz-zWa" secondAttribute="leading" constant="5" id="mBb-ff-7HD"/>
                 <constraint firstItem="UtT-L6-mgW" firstAttribute="top" secondItem="Gu8-oz-zWa" secondAttribute="top" constant="13" id="nrY-2F-QZ2"/>
-                <constraint firstItem="Gu8-oz-zWa" firstAttribute="trailing" secondItem="d22-W3-pnz" secondAttribute="trailing" id="oje-Cb-lK2"/>
                 <constraint firstItem="w2m-Vw-hpd" firstAttribute="centerY" secondItem="Gu8-oz-zWa" secondAttribute="centerY" id="qKl-4Y-m5t"/>
-                <constraint firstItem="d22-W3-pnz" firstAttribute="leading" secondItem="qR4-Xj-bmo" secondAttribute="trailing" id="xXk-xM-gSc"/>
+                <constraint firstItem="Gu8-oz-zWa" firstAttribute="trailing" secondItem="yhy-xd-w5C" secondAttribute="trailing" id="s2S-RP-cw5"/>
+                <constraint firstItem="nwZ-pi-Igj" firstAttribute="centerX" secondItem="3mk-e2-iDg" secondAttribute="centerX" id="vYW-cL-DlK"/>
             </constraints>
             <viewLayoutGuide key="safeArea" id="Gu8-oz-zWa"/>
             <size key="customSize" width="650" height="58"/>
             <connections>
+                <outlet property="buttonMore" destination="yhy-xd-w5C" id="agm-M9-xtq"/>
+                <outlet property="buttonRestore" destination="3mk-e2-iDg" id="rGX-0C-OHo"/>
                 <outlet property="imageItem" destination="w2m-Vw-hpd" id="iY5-ed-crD"/>
                 <outlet property="labelInfo" destination="AXX-71-9Q6" id="krb-tZ-UQ7"/>
                 <outlet property="labelTitle" destination="UtT-L6-mgW" id="Xv6-zM-2v1"/>
                 <outlet property="more" destination="dgL-g5-Nkc" id="FOg-ZX-Yti"/>
                 <outlet property="restore" destination="nwZ-pi-Igj" id="CHB-Fl-yAZ"/>
                 <outlet property="separator" destination="Egg-cb-EhZ" id="uhq-Nc-z8K"/>
-                <outlet property="tapMore" destination="d22-W3-pnz" id="6tZ-rQ-i8S"/>
-                <outlet property="tapRestore" destination="qR4-Xj-bmo" id="M4Q-YB-fuh"/>
             </connections>
             <point key="canvasLocation" x="97.599999999999994" y="129.53523238380811"/>
         </collectionViewCell>