Marino Faggiana 6 years ago
parent
commit
bf4732f776

+ 1 - 2
iOSClient/Create/CCCreateCloud.swift

@@ -958,8 +958,7 @@ class NCCreateScanDocument : NSObject, ImageScannerControllerDelegate {
         let storyboard = UIStoryboard(name: "Scan", bundle: nil)
         let controller = storyboard.instantiateInitialViewController()!
         controller.modalPresentationStyle = UIModalPresentationStyle.pageSheet
-        appDelegate.activeMain.present(controller, animated: true, completion: nil)
-        
+        appDelegate.window.rootViewController?.present(controller, animated: true, completion: nil)        
         
         //        let imageData = UIImageJPEGRepresentation(imageBN, 0.8)!
         //        try? imageData.write(to: fileNamePath)

+ 17 - 2
iOSClient/Scan/Scan.storyboard

@@ -19,7 +19,7 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="jwq-kF-6Nq" userLabel="collectionViewSource">
-                                <rect key="frame" x="0.0" y="72" width="375" height="160"/>
+                                <rect key="frame" x="57" y="72" width="318" height="160"/>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="160" id="0Wb-eO-Qiu"/>
@@ -133,16 +133,29 @@
                                 <nil key="textColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0Gy-eG-A0f">
+                                <rect key="frame" x="18" y="136" width="30" height="30"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="30" id="A6e-zC-q5t"/>
+                                    <constraint firstAttribute="width" constant="30" id="U2p-ow-Iad"/>
+                                </constraints>
+                                <state key="normal" title="+" image="add"/>
+                                <connections>
+                                    <action selector="addWithSender:" destination="BYZ-38-t0r" eventType="touchUpInside" id="bkr-97-4RR"/>
+                                </connections>
+                            </button>
                         </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
                             <constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="YHy-9G-ngy" secondAttribute="trailing" id="3ff-G8-wiq"/>
                             <constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="jwq-kF-6Nq" secondAttribute="trailing" id="6EM-YK-lEy"/>
                             <constraint firstItem="YHy-9G-ngy" firstAttribute="top" secondItem="jwq-kF-6Nq" secondAttribute="bottom" constant="8" id="90f-NC-udY"/>
-                            <constraint firstItem="jwq-kF-6Nq" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="ELU-RG-o16"/>
+                            <constraint firstItem="0Gy-eG-A0f" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="18" id="BNZ-HM-6yi"/>
+                            <constraint firstItem="jwq-kF-6Nq" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="57" id="ELU-RG-o16"/>
                             <constraint firstItem="fGo-qU-AYi" firstAttribute="trailing" secondItem="6Tk-OE-BBY" secondAttribute="trailing" id="Ew2-9q-DKl"/>
                             <constraint firstAttribute="bottom" secondItem="fGo-qU-AYi" secondAttribute="bottom" constant="50" id="Eza-ZC-K9z"/>
                             <constraint firstItem="YHy-9G-ngy" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="FvJ-EK-Evb"/>
+                            <constraint firstItem="0Gy-eG-A0f" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" constant="72" id="O4H-NJ-Mot"/>
                             <constraint firstItem="fGo-qU-AYi" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="aU0-Bn-B6T"/>
                             <constraint firstItem="jwq-kF-6Nq" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" constant="8" id="dyH-ym-lrb"/>
                             <constraint firstItem="fGo-qU-AYi" firstAttribute="top" secondItem="YHy-9G-ngy" secondAttribute="bottom" constant="8" id="x2i-aj-hzf"/>
@@ -162,6 +175,7 @@
                         </barButtonItem>
                     </navigationItem>
                     <connections>
+                        <outlet property="add" destination="0Gy-eG-A0f" id="Rjq-mB-EBd"/>
                         <outlet property="cancel" destination="9KU-yn-lBS" id="zw7-9b-sq4"/>
                         <outlet property="collectionViewDestination" destination="fGo-qU-AYi" id="ATh-9Q-SWs"/>
                         <outlet property="collectionViewSource" destination="jwq-kF-6Nq" id="6hn-7D-P8K"/>
@@ -197,6 +211,7 @@
         </scene>
     </scenes>
     <resources>
+        <image name="add" width="25" height="25"/>
         <image name="deleteImagePage" width="25" height="25"/>
     </resources>
 </document>

+ 10 - 1
iOSClient/Scan/ScanCollectionView.swift

@@ -43,7 +43,9 @@ class DragDropViewController: UIViewController {
     
     @IBOutlet weak var cancel: UIBarButtonItem!
     @IBOutlet weak var save: UIBarButtonItem!
-    
+
+    @IBOutlet weak var add: UIButton!
+
     @IBOutlet weak var labelTitlePDFzone: UILabel!
 
     
@@ -64,6 +66,8 @@ class DragDropViewController: UIViewController {
         cancel.title = NSLocalizedString("_cancel_", comment: "")
         save.title = NSLocalizedString("_save_", comment: "")
         labelTitlePDFzone.text = NSLocalizedString("_scan_label_PDF_zone_", comment: "")
+        
+        add.setImage(CCGraphics.changeThemingColorImage(UIImage(named: "add"), multiplier:2, color: NCBrandColor.sharedInstance.brand), for: .normal)
     }
     
     override func viewWillAppear(_ animated: Bool) {
@@ -93,6 +97,11 @@ class DragDropViewController: UIViewController {
         }
     }
     
+    @IBAction func add(sender: UIButton) {
+        
+        
+    }
+    
     //MARK: Private Methods
     
     private func loadImage(atPath: String, items: inout [String]) {