Browse Source

improvements UI

Marino Faggiana 6 years ago
parent
commit
c4042ed157

+ 23 - 0
iOSClient/Images.xcassets/switchGrid.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "switchGrid.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "switchGrid@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "switchGrid@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/switchGrid.imageset/switchGrid.png


BIN
iOSClient/Images.xcassets/switchGrid.imageset/switchGrid@2x.png


BIN
iOSClient/Images.xcassets/switchGrid.imageset/switchGrid@3x.png


+ 23 - 0
iOSClient/Images.xcassets/switchList.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "switchList.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "switchList@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "switchList@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/switchList.imageset/switchList.png


BIN
iOSClient/Images.xcassets/switchList.imageset/switchList@2x.png


BIN
iOSClient/Images.xcassets/switchList.imageset/switchList@3x.png


+ 17 - 23
iOSClient/Trash/NCTrash.storyboard

@@ -23,52 +23,46 @@
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="fF1-wd-0xN">
                                     <size key="itemSize" width="0.0" height="0.0"/>
-                                    <size key="headerReferenceSize" width="50" height="30"/>
+                                    <size key="headerReferenceSize" width="50" height="50"/>
                                     <size key="footerReferenceSize" width="0.0" height="0.0"/>
                                     <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
                                 </collectionViewFlowLayout>
                                 <cells/>
                                 <collectionReusableView key="sectionHeaderView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" reuseIdentifier="header" id="AQ6-rS-Wxb" customClass="NCTrashHeader" customModule="Nextcloud" customModuleProvider="target">
-                                    <rect key="frame" x="0.0" y="0.0" width="375" height="30"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
                                     <autoresizingMask key="autoresizingMask"/>
                                     <subviews>
-                                        <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="trashMore" translatesAutoresizingMaskIntoConstraints="NO" id="2CA-s4-Jqg" userLabel="More">
-                                            <rect key="frame" x="332" y="2" width="26" height="26"/>
-                                            <constraints>
-                                                <constraint firstAttribute="height" constant="26" id="1jE-4z-D0D"/>
-                                                <constraint firstAttribute="width" constant="26" id="9NZ-3O-HHt"/>
-                                            </constraints>
-                                        </imageView>
                                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hva-qI-4Kl" userLabel="Separator">
-                                            <rect key="frame" x="0.0" y="29" width="375" height="1"/>
+                                            <rect key="frame" x="0.0" y="48" width="375" height="1"/>
                                             <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                             <color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                             <constraints>
                                                 <constraint firstAttribute="height" constant="1" id="5Wf-y6-RCg"/>
                                             </constraints>
                                         </view>
-                                        <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="trashMore" translatesAutoresizingMaskIntoConstraints="NO" id="nkV-w3-rdJ" userLabel="switch">
-                                            <rect key="frame" x="10" y="2" width="26" height="26"/>
+                                        <button opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gBv-v2-Zec" userLabel="buttonSwitch">
+                                            <rect key="frame" x="10" y="12.5" width="25" height="25"/>
                                             <constraints>
-                                                <constraint firstAttribute="width" constant="26" id="Ghm-eE-bE5"/>
-                                                <constraint firstAttribute="height" constant="26" id="gge-hx-5g4"/>
+                                                <constraint firstAttribute="height" constant="25" id="0mp-3J-eb3"/>
+                                                <constraint firstAttribute="width" constant="25" id="DxY-uU-Znk"/>
                                             </constraints>
-                                        </imageView>
+                                            <state key="normal" image="switchList"/>
+                                            <connections>
+                                                <action selector="touchUpInsideSwitch:" destination="AQ6-rS-Wxb" eventType="touchUpInside" id="gyW-3w-jyC"/>
+                                            </connections>
+                                        </button>
                                     </subviews>
                                     <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                     <constraints>
-                                        <constraint firstItem="nkV-w3-rdJ" firstAttribute="centerY" secondItem="AQ6-rS-Wxb" secondAttribute="centerY" id="1Rd-vo-7Qb"/>
-                                        <constraint firstItem="nkV-w3-rdJ" firstAttribute="leading" secondItem="AQ6-rS-Wxb" secondAttribute="leading" constant="10" id="Kdy-nZ-IGc"/>
-                                        <constraint firstAttribute="trailing" secondItem="2CA-s4-Jqg" secondAttribute="trailing" constant="17" id="MqZ-eT-w2f"/>
+                                        <constraint firstItem="gBv-v2-Zec" firstAttribute="leading" secondItem="AQ6-rS-Wxb" secondAttribute="leading" constant="10" id="Glf-95-Dxh"/>
                                         <constraint firstAttribute="trailing" secondItem="hva-qI-4Kl" secondAttribute="trailing" id="Nq8-X5-7Cq"/>
+                                        <constraint firstItem="gBv-v2-Zec" firstAttribute="centerY" secondItem="AQ6-rS-Wxb" secondAttribute="centerY" id="OEU-E8-r92"/>
                                         <constraint firstItem="hva-qI-4Kl" firstAttribute="leading" secondItem="AQ6-rS-Wxb" secondAttribute="leading" id="a0G-P5-ZTU"/>
-                                        <constraint firstAttribute="bottom" secondItem="hva-qI-4Kl" secondAttribute="bottom" id="ixp-nm-HUt"/>
-                                        <constraint firstItem="2CA-s4-Jqg" firstAttribute="centerY" secondItem="AQ6-rS-Wxb" secondAttribute="centerY" id="xmf-F2-GEE"/>
+                                        <constraint firstAttribute="bottom" secondItem="hva-qI-4Kl" secondAttribute="bottom" constant="1" id="ixp-nm-HUt"/>
                                     </constraints>
                                     <connections>
+                                        <outlet property="buttonSwitch" destination="gBv-v2-Zec" id="Ad5-mq-XMb"/>
                                         <outlet property="separator" destination="hva-qI-4Kl" id="3Zy-ap-3kf"/>
-                                        <outlet property="tapMore" destination="2CA-s4-Jqg" id="ZrC-Kw-hzQ"/>
-                                        <outlet property="tapSwitch" destination="nkV-w3-rdJ" id="FFs-uz-jv7"/>
                                     </connections>
                                 </collectionReusableView>
                                 <connections>
@@ -96,6 +90,6 @@
         </scene>
     </scenes>
     <resources>
-        <image name="trashMore" width="80" height="80"/>
+        <image name="switchList" width="80" height="80"/>
     </resources>
 </document>

+ 1 - 1
iOSClient/Trash/NCTrash.swift

@@ -118,7 +118,7 @@ class NCTrash: UIViewController , UICollectionViewDataSource, UICollectionViewDe
     }
     
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
-        return CGSize(width: collectionView.frame.width, height: 30)
+        return CGSize(width: collectionView.frame.width, height: 50)
     }
     
     

+ 10 - 21
iOSClient/Trash/NCTrashHeader.swift

@@ -10,8 +10,9 @@ import Foundation
 
 class NCTrashHeader: UICollectionReusableView {
     
-    @IBOutlet weak var tapSwitch: UIImageView!
-    @IBOutlet weak var tapMore: UIImageView!
+    @IBOutlet weak var buttonMore: UIButton!
+    @IBOutlet weak var buttonSwitch: UIButton!
+    
     @IBOutlet weak var separator: UIView!
     
     var delegate: NCTrashHeaderDelegate?
@@ -19,30 +20,18 @@ class NCTrashHeader: UICollectionReusableView {
     override func awakeFromNib() {
         super.awakeFromNib()
         
-        tapMore.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "more"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)
-        tapSwitch.image = CCGraphics.changeThemingColorImage(UIImage.init(named: "more"), multiplier: 2, color: NCBrandColor.sharedInstance.optionItem)
-
-        separator.backgroundColor = NCBrandColor.sharedInstance.seperator
+        buttonSwitch.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "switchList"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), for: .normal)
         
-        let tapGestureSwitch = UITapGestureRecognizer(target: self, action: #selector(NCTrashHeader.tapSwitch(sender:)))
-        addGestureRecognizer(tapGestureSwitch)
-        tapGestureSwitch.numberOfTapsRequired = 1
-        tapSwitch.isUserInteractionEnabled = true
-        tapSwitch.addGestureRecognizer(tapGestureSwitch)
-        
-        let tapGestureMore = UITapGestureRecognizer(target: self, action: #selector(NCTrashHeader.tapMore(sender:)))
-        addGestureRecognizer(tapGestureMore)
-        tapGestureMore.numberOfTapsRequired = 1
-        tapMore.isUserInteractionEnabled = true
-        tapMore.addGestureRecognizer(tapGestureMore)
+        separator.backgroundColor = NCBrandColor.sharedInstance.seperator
     }
     
-    @objc func tapSwitch(sender: UITapGestureRecognizer) {
-        delegate?.tapSwitchHeader()
-    }
-    @objc func tapMore(sender: UITapGestureRecognizer) {
+    @IBAction func touchUpInsideMore(_ sender: Any) {
         delegate?.tapMoreHeader()
     }
+    
+    @IBAction func touchUpInsideSwitch(_ sender: Any) {
+        delegate?.tapSwitchHeader()
+    }
 }
 
 protocol NCTrashHeaderDelegate {