marinofaggiana 5 năm trước cách đây
mục cha
commit
c3c1ce2187

+ 12 - 10
iOSClient/Main/CCMain.m

@@ -137,10 +137,10 @@
     
     // Load Rich Workspace
     self.viewRichWorkspace = [[[NSBundle mainBundle] loadNibNamed:@"NCRichWorkspace" owner:self options:nil] firstObject];
-    UITapGestureRecognizer *webViewTapped = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(viewRichWorkspaceTapAction:)];
-    webViewTapped.numberOfTapsRequired = 1;
-    webViewTapped.delegate = self;
-    [self.viewRichWorkspace addGestureRecognizer:webViewTapped];
+    UITapGestureRecognizer *viewRichWorkspaceTapped = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(viewRichWorkspaceTapAction:)];
+    viewRichWorkspaceTapped.numberOfTapsRequired = 1;
+    viewRichWorkspaceTapped.delegate = self;
+    [self.viewRichWorkspace addGestureRecognizer:viewRichWorkspaceTapped];
     
     // Pull-to-Refresh
     [self createRefreshControl];
@@ -3875,14 +3875,16 @@
     // Nextcloud 18
     tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilitesWithAccount:appDelegate.activeAccount];
     if (capabilities.versionMajor < k_nextcloud_version_18_0) {
+        
         [self.tableView setTableHeaderView:nil];
-        return;
-    }
+        
+    } else {
     
-    tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", appDelegate.activeAccount, self.serverUrl]];
-    [self.viewRichWorkspace setRichWorkspaceText:directory.richWorkspace];
-    [self.viewRichWorkspace setFrame:CGRectMake(0, 0, self.tableView.frame.size.width, CCUtility.getRichWorkspaceHeight)];
-    [self.tableView setTableHeaderView:self.viewRichWorkspace];
+        tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", appDelegate.activeAccount, self.serverUrl]];
+        [self.viewRichWorkspace setRichWorkspaceText:directory.richWorkspace];
+        [self.viewRichWorkspace setFrame:CGRectMake(0, 0, self.tableView.frame.size.width, CCUtility.getRichWorkspaceHeight)];
+        [self.tableView setTableHeaderView:self.viewRichWorkspace];
+    }
     
     [self.tableView reloadData];
 }

+ 5 - 9
iOSClient/Main/NCRichWorkspace.swift

@@ -28,14 +28,14 @@ import Foundation
         
         var html = ""
         
-        if richWorkspace == self.richWorkspace { return }
-        if richWorkspace != nil || richWorkspace!.count > 0 {
+        if richWorkspace != nil && richWorkspace!.count > 0 {
             html = "<h2><span style=\"color: #000000;\">" + richWorkspace! + "</span></h2>"
         } else {
             html = "<h2><span style=\"color: #000000;\">" + NSLocalizedString("_add_notes_readme_md_", comment: "") + "</span></h2>"
         }
         self.richWorkspace = richWorkspace
         webView.loadHTMLString(html, baseURL: Bundle.main.bundleURL)
+        webView.isUserInteractionEnabled = false
     }
 }
 
@@ -46,19 +46,14 @@ import Foundation
     var originalHeight: CGFloat = 0
     let minHeight: CGFloat = 0
     let maxHeight: CGFloat = UIScreen.main.bounds.size.height/3
-    
-    @IBOutlet weak var imageDrag: UIImageView!
 
     required init?(coder: NSCoder) {
         super.init(coder: coder)
         
-        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
-    }
-    
-    @objc func changeTheming() {
-        imageDrag.image = CCGraphics.changeThemingColorImage(UIImage(named: "dragHorizontal"), width: 20, height: 10, color: NCBrandColor.sharedInstance.brandText)
+        self.backgroundColor = NCBrandColor.sharedInstance.separator
     }
     
+    /*
     override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
         return false
     }
@@ -89,4 +84,5 @@ import Foundation
     override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
 //        appDelegate.activeMain.tableView.reloadData()
     }
+    */
 }

+ 5 - 22
iOSClient/Main/NCRichWorkspace.xib

@@ -15,7 +15,7 @@
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
                 <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XXz-cr-h4j">
-                    <rect key="frame" x="0.0" y="0.0" width="320" height="470"/>
+                    <rect key="frame" x="0.0" y="0.0" width="320" height="478"/>
                     <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     <wkWebViewConfiguration key="configuration">
                         <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
@@ -23,34 +23,20 @@
                     </wkWebViewConfiguration>
                 </wkWebView>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="C1O-Se-sSW" customClass="NCRichWorkspaceViewTouch" customModule="Nextcloud" customModuleProvider="target">
-                    <rect key="frame" x="3" y="470" width="315" height="10"/>
-                    <subviews>
-                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="dragHorizontal" translatesAutoresizingMaskIntoConstraints="NO" id="Kbb-up-Kk7">
-                            <rect key="frame" x="152.5" y="0.0" width="10" height="10"/>
-                            <constraints>
-                                <constraint firstAttribute="height" constant="10" id="BwK-Ih-xVq"/>
-                                <constraint firstAttribute="width" constant="10" id="Xec-7i-2RT"/>
-                            </constraints>
-                        </imageView>
-                    </subviews>
+                    <rect key="frame" x="0.0" y="478" width="320" height="2"/>
                     <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                     <constraints>
-                        <constraint firstItem="Kbb-up-Kk7" firstAttribute="centerY" secondItem="C1O-Se-sSW" secondAttribute="centerY" id="fbh-Mv-JiO"/>
-                        <constraint firstItem="Kbb-up-Kk7" firstAttribute="centerX" secondItem="C1O-Se-sSW" secondAttribute="centerX" id="v7j-DL-Weg"/>
-                        <constraint firstAttribute="height" constant="10" id="xy3-eG-rRi"/>
+                        <constraint firstAttribute="height" constant="2" id="xy3-eG-rRi"/>
                     </constraints>
-                    <connections>
-                        <outlet property="imageDrag" destination="Kbb-up-Kk7" id="Wsc-VP-jpa"/>
-                    </connections>
                 </view>
             </subviews>
             <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
             <constraints>
-                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="C1O-Se-sSW" secondAttribute="trailing" constant="2" id="CHl-hJ-Qnx"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="C1O-Se-sSW" secondAttribute="trailing" id="CHl-hJ-Qnx"/>
                 <constraint firstItem="XXz-cr-h4j" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="DCK-aY-jxF"/>
                 <constraint firstItem="XXz-cr-h4j" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" id="FBk-U6-oyG"/>
                 <constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="C1O-Se-sSW" secondAttribute="bottom" id="Zk1-rb-wAc"/>
-                <constraint firstItem="C1O-Se-sSW" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="3" id="fLO-Ez-t2Z"/>
+                <constraint firstItem="C1O-Se-sSW" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="fLO-Ez-t2Z"/>
                 <constraint firstItem="C1O-Se-sSW" firstAttribute="top" secondItem="XXz-cr-h4j" secondAttribute="bottom" id="oxW-bj-bTB"/>
                 <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="XXz-cr-h4j" secondAttribute="trailing" id="sSB-Ux-4JO"/>
             </constraints>
@@ -61,7 +47,4 @@
             <point key="canvasLocation" x="136" y="135"/>
         </view>
     </objects>
-    <resources>
-        <image name="dragHorizontal" width="312" height="312"/>
-    </resources>
 </document>