marinofaggiana 5 anos atrás
pai
commit
a219cec402

+ 11 - 10
iOSClient/RichWorkspace/NCRichWorkspace.swift

@@ -11,7 +11,7 @@ import SwiftRichString
 
 @objc class NCViewRichWorkspace: UIView {
     
-    @IBOutlet weak var textLabel: UILabel!
+    @IBOutlet weak var textView: UITextView!
     var richWorkspace: String = ""
 
     required init?(coder: NSCoder) {
@@ -29,31 +29,31 @@ import SwiftRichString
     @objc func setRichWorkspaceText(_ richWorkspace: String) {
         
         let h1 = Style {
-            $0.font = UIFont.systemFont(ofSize: 20, weight: .bold)
+            $0.font = UIFont.systemFont(ofSize: 25, weight: .bold)
             $0.color = NCBrandColor.sharedInstance.textView
         }
         let h2 = Style {
-            $0.font = UIFont.systemFont(ofSize: 18, weight: .bold)
+            $0.font = UIFont.systemFont(ofSize: 23, weight: .bold)
             $0.color = NCBrandColor.sharedInstance.textView
         }
         let h3 = Style {
-            $0.font = UIFont.systemFont(ofSize: 16, weight: .bold)
+            $0.font = UIFont.systemFont(ofSize: 21, weight: .bold)
             $0.color = NCBrandColor.sharedInstance.textView
         }
         let h4 = Style {
-            $0.font = UIFont.systemFont(ofSize: 14, weight: .bold)
+            $0.font = UIFont.systemFont(ofSize: 19, weight: .bold)
             $0.color = NCBrandColor.sharedInstance.textView
         }
         let h5 = Style {
-            $0.font = UIFont.systemFont(ofSize: 12, weight: .bold)
+            $0.font = UIFont.systemFont(ofSize: 17, weight: .bold)
             $0.color = NCBrandColor.sharedInstance.textView
         }
         let h6 = Style {
-            $0.font = UIFont.systemFont(ofSize: 10, weight: .bold)
+            $0.font = UIFont.systemFont(ofSize: 15, weight: .bold)
             $0.color = NCBrandColor.sharedInstance.textView
         }
         let normal = Style {
-            $0.font = UIFont.systemFont(ofSize: 10)
+            $0.font = UIFont.systemFont(ofSize: 15)
             $0.color = NCBrandColor.sharedInstance.textView
         }
        
@@ -79,8 +79,9 @@ import SwiftRichString
             }
         }
         
-        textLabel.attributedText = richWorkspaceStyling.set(style: StyleGroup(base: normal, ["h1": h1, "h2": h2, "h3": h3, "h4": h4, "h5": h5, "h6": h6]))
-        textLabel.isUserInteractionEnabled = false
+        textView.attributedText = richWorkspaceStyling.set(style: StyleGroup(base: normal, ["h1": h1, "h2": h2, "h3": h3, "h4": h4, "h5": h5, "h6": h6]))
+        textView.isUserInteractionEnabled = false
+        textView.sizeToFit()
     }
 }
 

+ 12 - 10
iOSClient/RichWorkspace/NCRichWorkspace.xib

@@ -14,23 +14,25 @@
             <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
-                <label opaque="NO" userInteractionEnabled="NO" contentMode="TopLeft" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dZp-91-Nnq">
+                <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="wri-16-tQY">
                     <rect key="frame" x="15" y="5" width="295" height="470"/>
-                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                    <nil key="textColor"/>
-                    <nil key="highlightedColor"/>
-                </label>
+                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
+                    <color key="textColor" systemColor="labelColor" cocoaTouchSystemColor="darkTextColor"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                    <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
+                </textView>
             </subviews>
             <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
             <constraints>
-                <constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="dZp-91-Nnq" secondAttribute="bottom" constant="5" id="Fmt-BL-zWO"/>
-                <constraint firstItem="dZp-91-Nnq" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" constant="5" id="Tpz-Mh-Qkc"/>
-                <constraint firstItem="dZp-91-Nnq" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="15" id="aQH-58-OaN"/>
-                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="dZp-91-Nnq" secondAttribute="trailing" constant="10" id="rz6-hD-xTs"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="wri-16-tQY" secondAttribute="bottom" constant="5" id="Ei6-vr-4dN"/>
+                <constraint firstItem="wri-16-tQY" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" constant="5" id="O2Y-0W-v0n"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="wri-16-tQY" secondAttribute="trailing" constant="10" id="Rg0-g6-cT4"/>
+                <constraint firstItem="wri-16-tQY" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="15" id="o8o-lo-wZd"/>
             </constraints>
             <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
             <connections>
-                <outlet property="textLabel" destination="dZp-91-Nnq" id="fly-de-eVa"/>
+                <outlet property="textView" destination="wri-16-tQY" id="pwA-gm-dfK"/>
             </connections>
             <point key="canvasLocation" x="136.875" y="88.75"/>
         </view>