Browse Source

new view share (comments)

marinofaggiana 5 years ago
parent
commit
5a85249e9f

+ 43 - 2
iOSClient/Share/NCShare.storyboard

@@ -51,13 +51,54 @@
                     <view key="view" contentMode="scaleToFill" id="5MM-pX-rNX">
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jzJ-Ra-l4b" userLabel="View container">
+                                <rect key="frame" x="0.0" y="244" width="409" height="618"/>
+                                <subviews>
+                                    <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="249" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="j5C-gO-XF8">
+                                        <rect key="frame" x="5" y="10" width="399" height="30"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="30" id="Cia-Ws-3fQ"/>
+                                        </constraints>
+                                        <nil key="textColor"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                        <textInputTraits key="textInputTraits"/>
+                                    </textField>
+                                    <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="DFs-4t-iWX">
+                                        <rect key="frame" x="5" y="50" width="404" height="558"/>
+                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                    </tableView>
+                                </subviews>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstItem="DFs-4t-iWX" firstAttribute="top" secondItem="j5C-gO-XF8" secondAttribute="bottom" constant="10" id="2W4-MV-Q3t"/>
+                                    <constraint firstItem="j5C-gO-XF8" firstAttribute="top" secondItem="jzJ-Ra-l4b" secondAttribute="top" constant="10" id="FVU-Ra-LGp"/>
+                                    <constraint firstItem="DFs-4t-iWX" firstAttribute="leading" secondItem="jzJ-Ra-l4b" secondAttribute="leading" constant="5" id="JN4-2m-lYt"/>
+                                    <constraint firstItem="j5C-gO-XF8" firstAttribute="leading" secondItem="jzJ-Ra-l4b" secondAttribute="leading" constant="5" id="TyF-h2-Kf2"/>
+                                    <constraint firstAttribute="trailing" secondItem="DFs-4t-iWX" secondAttribute="trailing" id="ZcL-Ph-LOK"/>
+                                    <constraint firstAttribute="trailing" secondItem="j5C-gO-XF8" secondAttribute="trailing" constant="5" id="baS-fH-yjJ"/>
+                                    <constraint firstAttribute="bottom" secondItem="DFs-4t-iWX" secondAttribute="bottom" constant="10" id="ghq-O1-zbF"/>
+                                </constraints>
+                            </view>
+                        </subviews>
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <constraints>
+                            <constraint firstItem="jzJ-Ra-l4b" firstAttribute="leading" secondItem="j3W-IW-lzW" secondAttribute="leading" id="B4V-GC-zYM"/>
+                            <constraint firstItem="j3W-IW-lzW" firstAttribute="trailing" secondItem="jzJ-Ra-l4b" secondAttribute="trailing" constant="5" id="WPr-LS-NPk"/>
+                            <constraint firstItem="j3W-IW-lzW" firstAttribute="bottom" secondItem="jzJ-Ra-l4b" secondAttribute="bottom" id="qNg-QS-tUI"/>
+                            <constraint firstItem="jzJ-Ra-l4b" firstAttribute="top" secondItem="j3W-IW-lzW" secondAttribute="top" constant="200" id="vgD-mh-dz8"/>
+                        </constraints>
                         <viewLayoutGuide key="safeArea" id="j3W-IW-lzW"/>
                     </view>
+                    <connections>
+                        <outlet property="newCommentField" destination="j5C-gO-XF8" id="bYE-r4-F6m"/>
+                        <outlet property="tableView" destination="DFs-4t-iWX" id="oU5-M6-jh0"/>
+                        <outlet property="viewContainerConstraint" destination="vgD-mh-dz8" id="CC9-oG-uiP"/>
+                    </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="l4G-HZ-s1x" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="2236" y="-388"/>
+            <point key="canvasLocation" x="2047.826086956522" y="-167.41071428571428"/>
         </scene>
         <!--Share-->
         <scene sceneID="Iqh-6B-MEV">
@@ -206,7 +247,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="4Te-U6-4XT" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="2234.7826086956525" y="403.79464285714283"/>
+            <point key="canvasLocation" x="2689.8550724637685" y="-167.41071428571428"/>
         </scene>
     </scenes>
     <resources>

+ 10 - 2
iOSClient/Share/NCShareComments.swift

@@ -25,12 +25,20 @@ import Foundation
 
 class NCShareComments: UIViewController {
     
-    var metadata: tableMetadata?
+    @IBOutlet weak var viewContainerConstraint: NSLayoutConstraint!
+    @IBOutlet weak var tableView: UITableView!
+    @IBOutlet weak var newCommentField: UITextField!
+
     private let appDelegate = UIApplication.shared.delegate as! AppDelegate
-    
+
+    var metadata: tableMetadata?
+    public var height: CGFloat = 0
+
     override func viewDidLoad() {
         super.viewDidLoad()
         
+        viewContainerConstraint.constant = height
+
         guard let metadata = self.metadata else { return }
 
         OCNetworking.sharedManager()?.getCommentsWithAccount(appDelegate.activeAccount, fileID: metadata.fileID, completion: { (account, items, message, errorCode) in

+ 1 - 0
iOSClient/Share/NCSharePaging.swift

@@ -92,6 +92,7 @@ extension NCSharePaging: PagingViewControllerDataSource {
         case 1:
             let viewController = UIStoryboard(name: "NCShare", bundle: nil).instantiateViewController(withIdentifier: "comments") as! NCShareComments
             viewController.metadata = metadata!
+            viewController.height = height
             return viewController
         case 2:
             let viewController = UIStoryboard(name: "NCShare", bundle: nil).instantiateViewController(withIdentifier: "sharing") as! NCShare