ソースを参照

improvements UI

Marino Faggiana 6 年 前
コミット
7a6f210531

+ 4 - 4
Nextcloud.xcodeproj/project.pbxproj

@@ -192,7 +192,7 @@
 		F73D71621F2673C200E233EB /* NCText.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73D71611F2673C200E233EB /* NCText.swift */; };
 		F73D71641F2674A400E233EB /* NCText.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F73D71631F2674A400E233EB /* NCText.storyboard */; };
 		F73F537F1E929C8500F8678D /* CCMore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73F537E1E929C8500F8678D /* CCMore.swift */; };
-		F7417DB3216CE925007D05F5 /* NCTrashHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7417DB2216CE925007D05F5 /* NCTrashHeader.swift */; };
+		F7417DB3216CE925007D05F5 /* NCTrashHeaderMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7417DB2216CE925007D05F5 /* NCTrashHeaderMenu.swift */; };
 		F7417DB5216CFE8E007D05F5 /* NCTrashGridCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7417DB4216CFE8E007D05F5 /* NCTrashGridCell.xib */; };
 		F7417DB7216CFED0007D05F5 /* NCTrashGridCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7417DB6216CFED0007D05F5 /* NCTrashGridCell.swift */; };
 		F7434B3420E23FD700417916 /* NCDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB41ED5A87C00B7EAD4 /* NCDatabase.swift */; };
@@ -921,7 +921,7 @@
 		F73D71611F2673C200E233EB /* NCText.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCText.swift; sourceTree = "<group>"; };
 		F73D71631F2674A400E233EB /* NCText.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCText.storyboard; sourceTree = "<group>"; };
 		F73F537E1E929C8500F8678D /* CCMore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCMore.swift; sourceTree = "<group>"; };
-		F7417DB2216CE925007D05F5 /* NCTrashHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCTrashHeader.swift; sourceTree = "<group>"; };
+		F7417DB2216CE925007D05F5 /* NCTrashHeaderMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCTrashHeaderMenu.swift; sourceTree = "<group>"; };
 		F7417DB4216CFE8E007D05F5 /* NCTrashGridCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCTrashGridCell.xib; sourceTree = "<group>"; };
 		F7417DB6216CFED0007D05F5 /* NCTrashGridCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCTrashGridCell.swift; sourceTree = "<group>"; };
 		F7434B5F20E2440600417916 /* FileProviderExtension-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FileProviderExtension-Bridging-Header.h"; sourceTree = "<group>"; };
@@ -2745,7 +2745,7 @@
 			isa = PBXGroup;
 			children = (
 				F78F74332163757000C2ADAD /* NCTrash.storyboard */,
-				F7417DB2216CE925007D05F5 /* NCTrashHeader.swift */,
+				F7417DB2216CE925007D05F5 /* NCTrashHeaderMenu.swift */,
 				F78F74352163781100C2ADAD /* NCTrash.swift */,
 				F7ED7EDB216B83D5007AB4D9 /* NCTrashListCell.xib */,
 				F7ED7EDD216B85DA007AB4D9 /* NCTrashListCell.swift */,
@@ -4184,7 +4184,7 @@
 				F73CC07E1E813DFF006E3047 /* BKTouchIDSwitchView.m in Sources */,
 				F77B0E5F1D118A16002130FE /* CCSettings.m in Sources */,
 				F78F74362163781100C2ADAD /* NCTrash.swift in Sources */,
-				F7417DB3216CE925007D05F5 /* NCTrashHeader.swift in Sources */,
+				F7417DB3216CE925007D05F5 /* NCTrashHeaderMenu.swift in Sources */,
 				F7F878AE1FB9E3B900599E4F /* NCEndToEndMetadata.swift in Sources */,
 				F7D424611F063B82009C9782 /* CTAssetScrollView.m in Sources */,
 				F762CB141EACB66200B38484 /* XLFormRightImageButton.m in Sources */,

+ 4 - 4
iOSClient/Trash/NCTrash.storyboard

@@ -28,7 +28,7 @@
                                     <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">
+                                <collectionReusableView key="sectionHeaderView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" reuseIdentifier="headerMenu" id="AQ6-rS-Wxb" customClass="NCTrashHeaderMenu" customModule="Nextcloud" customModuleProvider="target">
                                     <rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
                                     <autoresizingMask key="autoresizingMask"/>
                                     <subviews>
@@ -48,7 +48,7 @@
                                             </constraints>
                                             <state key="normal" image="switchList"/>
                                             <connections>
-                                                <action selector="touchUpInsideSwitch:" destination="AQ6-rS-Wxb" eventType="touchUpInside" id="gyW-3w-jyC"/>
+                                                <action selector="touchUpInsideSwitch:" destination="AQ6-rS-Wxb" eventType="touchUpInside" id="b4W-Pc-nCw"/>
                                             </connections>
                                         </button>
                                     </subviews>
@@ -61,8 +61,8 @@
                                         <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="buttonSwitch" destination="gBv-v2-Zec" id="yBa-g0-ChU"/>
+                                        <outlet property="separator" destination="hva-qI-4Kl" id="rP4-bg-nt9"/>
                                     </connections>
                                 </collectionReusableView>
                                 <connections>

+ 12 - 4
iOSClient/Trash/NCTrash.swift

@@ -9,7 +9,7 @@
 import Foundation
  
 
-class NCTrash: UIViewController , UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIGestureRecognizerDelegate, NCTrashListDelegate, NCTrashGridDelegate, NCTrashHeaderDelegate {
+class NCTrash: UIViewController , UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIGestureRecognizerDelegate, NCTrashListDelegate, NCTrashGridDelegate, NCTrashHeaderMenuDelegate {
     
     @IBOutlet fileprivate weak var collectionView: UICollectionView!
 
@@ -82,7 +82,7 @@ class NCTrash: UIViewController , UICollectionViewDataSource, UICollectionViewDe
         print("tap item more")
     }
     
-    func tapSwitchHeader() {
+    func tapSwitchHeaderMenu() {
         
         if collectionView.collectionViewLayout == gridLayout {
             // list layout
@@ -103,7 +103,7 @@ class NCTrash: UIViewController , UICollectionViewDataSource, UICollectionViewDe
         }
     }
     
-    func tapMoreHeader() {
+    func tapMoreHeaderMenu() {
         print("tap header more")
     }
 
@@ -111,7 +111,15 @@ class NCTrash: UIViewController , UICollectionViewDataSource, UICollectionViewDe
     
     func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
         
-        let trashHeader = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "header", for: indexPath) as! NCTrashHeader
+        let trashHeader = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "headerMenu", for: indexPath) as! NCTrashHeaderMenu
+        
+        if collectionView.collectionViewLayout == gridLayout {
+            trashHeader.buttonSwitch.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "switchList"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), for: .normal)
+
+        } else {
+            trashHeader.buttonSwitch.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "switchGrid"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), for: .normal)
+        }
+        
         trashHeader.delegate = self
         
         return trashHeader

+ 8 - 8
iOSClient/Trash/NCTrashHeader.swift → iOSClient/Trash/NCTrashHeaderMenu.swift

@@ -1,5 +1,5 @@
 //
-//  NCTrashHeader.swift
+//  NCTrashHeaderMenu.swift
 //  Nextcloud
 //
 //  Created by Marino Faggiana on 09/10/2018.
@@ -8,14 +8,14 @@
 
 import Foundation
 
-class NCTrashHeader: UICollectionReusableView {
+class NCTrashHeaderMenu: UICollectionReusableView {
     
     @IBOutlet weak var buttonMore: UIButton!
     @IBOutlet weak var buttonSwitch: UIButton!
     
     @IBOutlet weak var separator: UIView!
     
-    var delegate: NCTrashHeaderDelegate?
+    var delegate: NCTrashHeaderMenuDelegate?
 
     override func awakeFromNib() {
         super.awakeFromNib()
@@ -26,16 +26,16 @@ class NCTrashHeader: UICollectionReusableView {
     }
     
     @IBAction func touchUpInsideMore(_ sender: Any) {
-        delegate?.tapMoreHeader()
+        delegate?.tapMoreHeaderMenu()
     }
     
     @IBAction func touchUpInsideSwitch(_ sender: Any) {
-        delegate?.tapSwitchHeader()
+        delegate?.tapSwitchHeaderMenu()
     }
 }
 
-protocol NCTrashHeaderDelegate {
-    func tapSwitchHeader()
-    func tapMoreHeader()
+protocol NCTrashHeaderMenuDelegate {
+    func tapSwitchHeaderMenu()
+    func tapMoreHeaderMenu()
 }