Explorar el Código

Improved Select view

marinofaggiana hace 3 años
padre
commit
aeb2d0f7ec
Se han modificado 2 ficheros con 15 adiciones y 32 borrados
  1. 4 21
      iOSClient/Select/NCSelect.swift
  2. 11 11
      iOSClient/Select/NCSelectCommandViewCopyMove.xib

+ 4 - 21
iOSClient/Select/NCSelect.swift

@@ -65,7 +65,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
     private var isEditMode = false
     private var networkInProgress = false
     private var selectOcId: [String] = []
-    private var overwrite = false
+    private var overwrite = true
     
     private var dataSource = NCDataSource()
     internal var richWorkspaceText: String?
@@ -151,7 +151,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
             selectCommandViewSelect?.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0).isActive = true
             selectCommandViewSelect?.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 0).isActive = true
             selectCommandViewSelect?.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: 0).isActive = true
-            selectCommandViewSelect?.heightAnchor.constraint(equalToConstant: 120).isActive = true
+            selectCommandViewSelect?.heightAnchor.constraint(equalToConstant: 150).isActive = true
         }
         
         NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
@@ -165,22 +165,6 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
         
         self.navigationItem.title = titleCurrentFolder
         
-        /*
-        buttonDone.setTitle(titleButtonDone, for: .normal)
-        buttonDone1.setTitle(titleButtonDone1, for: .normal)
-        buttonDone1.isHidden = isButtonDone1Hide
-        overwriteSwitch.isOn = overwrite
-        overwriteView.isHidden = isOverwriteHide
-        
-        if selectFile {
-            buttonDone.isHidden = true
-        }
-        
-        if hideButtonCreateFolder {
-            buttonCreateFolder.isHidden = true
-        }
-        */
-        
         // set the serverUrl
         if serverUrl == "" {
             serverUrl = NCUtilityFileSystem.shared.getHomeServer(urlBase: activeAccount.urlBase, account: activeAccount.account)
@@ -227,8 +211,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
         collectionView.backgroundColor = NCBrandColor.shared.backgroundView
         collectionView.reloadData()
         refreshControl.backgroundColor = NCBrandColor.shared.backgroundView
-        //toolbar.backgroundColor = NCBrandColor.shared.tabBar
-        //separator.backgroundColor = NCBrandColor.shared.graySoft
+        selectCommandViewSelect?.separatorView.backgroundColor = NCBrandColor.shared.separator
     }
     
     func presentationControllerDidDismiss( _ presentationController: UIPresentationController) {
@@ -256,7 +239,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
     
     // MARK: ACTION
     
-    @IBAction func actionCancel(_ sender: Any) {
+    @IBAction func actionCancel(_ sender: UIBarButtonItem) {
         delegate?.dismissSelect(serverUrl: nil, metadata: nil, type: type, items: items, cancel: true, overwrite: overwrite, select: false, copy: false, move: false)
         self.dismiss(animated: true, completion: nil)
     }

+ 11 - 11
iOSClient/Select/NCSelectCommandViewCopyMove.xib

@@ -23,16 +23,16 @@
                     </constraints>
                 </view>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DhT-bZ-rgC" userLabel="Command View">
-                    <rect key="frame" x="0.0" y="180" width="320" height="120"/>
+                    <rect key="frame" x="0.0" y="190" width="320" height="100"/>
                     <subviews>
                         <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="h1j-Bi-at4">
-                            <rect key="frame" x="20" y="10" width="51" height="31"/>
+                            <rect key="frame" x="20" y="0.0" width="51" height="31"/>
                             <connections>
                                 <action selector="valueChangedSwitchOverwrite:" destination="iN0-l3-epB" eventType="valueChanged" id="GaC-ye-b4N"/>
                             </connections>
                         </switch>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Overwrite" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tE2-bY-JfT">
-                            <rect key="frame" x="77" y="17.5" width="100" height="16"/>
+                            <rect key="frame" x="77" y="7.5" width="100" height="16"/>
                             <constraints>
                                 <constraint firstAttribute="width" constant="100" id="C4z-aI-zCo"/>
                             </constraints>
@@ -41,7 +41,7 @@
                             <nil key="highlightedColor"/>
                         </label>
                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WCL-bl-0j0">
-                            <rect key="frame" x="20" y="80" width="120" height="30"/>
+                            <rect key="frame" x="20" y="70" width="120" height="30"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="30" id="AHg-gX-UT0"/>
                                 <constraint firstAttribute="width" constant="120" id="e9E-Zi-Svf"/>
@@ -53,7 +53,7 @@
                             </connections>
                         </button>
                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Mg4-vG-Xr7">
-                            <rect key="frame" x="180" y="10" width="120" height="30"/>
+                            <rect key="frame" x="180" y="0.0" width="120" height="30"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="30" id="aRa-Cb-dIJ"/>
                                 <constraint firstAttribute="width" constant="120" id="q7x-Zg-aFX"/>
@@ -65,7 +65,7 @@
                             </connections>
                         </button>
                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Oq2-Kg-sDp">
-                            <rect key="frame" x="180" y="80" width="120" height="30"/>
+                            <rect key="frame" x="180" y="70" width="120" height="30"/>
                             <constraints>
                                 <constraint firstAttribute="width" constant="120" id="JyD-uF-cFT"/>
                                 <constraint firstAttribute="height" constant="30" id="QAO-kF-IOZ"/>
@@ -82,13 +82,13 @@
                         <constraint firstItem="tE2-bY-JfT" firstAttribute="leading" secondItem="h1j-Bi-at4" secondAttribute="trailing" constant="8" symbolic="YES" id="BBW-Mt-T2Q"/>
                         <constraint firstItem="h1j-Bi-at4" firstAttribute="leading" secondItem="DhT-bZ-rgC" secondAttribute="leading" constant="20" id="BK8-FJ-PCw"/>
                         <constraint firstAttribute="trailing" secondItem="Mg4-vG-Xr7" secondAttribute="trailing" constant="20" id="Efe-Jl-OSp"/>
-                        <constraint firstItem="h1j-Bi-at4" firstAttribute="top" secondItem="DhT-bZ-rgC" secondAttribute="top" constant="10" id="H3s-ru-V9X"/>
-                        <constraint firstAttribute="bottom" secondItem="WCL-bl-0j0" secondAttribute="bottom" constant="10" id="TzK-c5-jnE"/>
+                        <constraint firstItem="h1j-Bi-at4" firstAttribute="top" secondItem="DhT-bZ-rgC" secondAttribute="top" id="H3s-ru-V9X"/>
+                        <constraint firstAttribute="bottom" secondItem="WCL-bl-0j0" secondAttribute="bottom" id="TzK-c5-jnE"/>
                         <constraint firstItem="WCL-bl-0j0" firstAttribute="leading" secondItem="DhT-bZ-rgC" secondAttribute="leading" constant="20" id="caB-Op-vpM"/>
-                        <constraint firstAttribute="height" constant="120" id="dTc-rJ-Jrz"/>
+                        <constraint firstAttribute="height" constant="100" id="dTc-rJ-Jrz"/>
                         <constraint firstItem="tE2-bY-JfT" firstAttribute="centerY" secondItem="h1j-Bi-at4" secondAttribute="centerY" id="fRN-zY-g9L"/>
-                        <constraint firstItem="Mg4-vG-Xr7" firstAttribute="top" secondItem="DhT-bZ-rgC" secondAttribute="top" constant="10" id="fzS-ny-eXi"/>
-                        <constraint firstAttribute="bottom" secondItem="Oq2-Kg-sDp" secondAttribute="bottom" constant="10" id="omd-Zc-koD"/>
+                        <constraint firstItem="Mg4-vG-Xr7" firstAttribute="top" secondItem="DhT-bZ-rgC" secondAttribute="top" id="fzS-ny-eXi"/>
+                        <constraint firstAttribute="bottom" secondItem="Oq2-Kg-sDp" secondAttribute="bottom" id="omd-Zc-koD"/>
                         <constraint firstAttribute="trailing" secondItem="Oq2-Kg-sDp" secondAttribute="trailing" constant="20" id="pkS-bX-XZ5"/>
                     </constraints>
                 </view>