Browse Source

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 years ago
parent
commit
fefcd43f2d
2 changed files with 34 additions and 9 deletions
  1. 26 6
      iOSClient/Color/NCColorPicker.storyboard
  2. 8 3
      iOSClient/Color/NCColorPicker.swift

+ 26 - 6
iOSClient/Color/NCColorPicker.storyboard

@@ -25,6 +25,11 @@
                                 </constraints>
                                 <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                             </button>
+                            <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Jc0-7X-JuE">
+                                <rect key="frame" x="60" y="21" width="250" height="18.5"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <textInputTraits key="textInputTraits"/>
+                            </textField>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Zr2-rF-YUt">
                                 <rect key="frame" x="10" y="60" width="40" height="40"/>
                                 <constraints>
@@ -33,13 +38,21 @@
                                 </constraints>
                                 <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                             </button>
-                            <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Jc0-7X-JuE">
-                                <rect key="frame" x="60" y="21" width="240" height="18.5"/>
+                            <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="p7z-g7-hkV">
+                                <rect key="frame" x="60" y="71" width="250" height="18.5"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                 <textInputTraits key="textInputTraits"/>
                             </textField>
-                            <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="p7z-g7-hkV">
-                                <rect key="frame" x="60" y="71" width="240" height="18.5"/>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dOn-SY-wnl">
+                                <rect key="frame" x="10" y="110" width="40" height="40"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="BI1-aU-56D"/>
+                                    <constraint firstAttribute="width" constant="40" id="v3I-Na-zQ5"/>
+                                </constraints>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            </button>
+                            <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="DoG-RI-jcO">
+                                <rect key="frame" x="60" y="121" width="250" height="18.5"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                 <textInputTraits key="textInputTraits"/>
                             </textField>
@@ -48,13 +61,18 @@
                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
                             <constraint firstItem="Jc0-7X-JuE" firstAttribute="leading" secondItem="JUR-Vj-yBU" secondAttribute="trailing" constant="10" id="7em-8z-JQY"/>
-                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="Jc0-7X-JuE" secondAttribute="trailing" constant="20" id="8gW-Zv-r2i"/>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="Jc0-7X-JuE" secondAttribute="trailing" constant="10" id="8gW-Zv-r2i"/>
                             <constraint firstItem="p7z-g7-hkV" firstAttribute="centerY" secondItem="Zr2-rF-YUt" secondAttribute="centerY" id="Jv1-Lb-kNB"/>
-                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="p7z-g7-hkV" secondAttribute="trailing" constant="20" id="YOZ-Wq-rX9"/>
+                            <constraint firstItem="DoG-RI-jcO" firstAttribute="centerY" secondItem="dOn-SY-wnl" secondAttribute="centerY" id="LeK-LM-8ri"/>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="DoG-RI-jcO" secondAttribute="trailing" constant="10" id="QU9-5b-yb2"/>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="p7z-g7-hkV" secondAttribute="trailing" constant="10" id="YOZ-Wq-rX9"/>
                             <constraint firstItem="JUR-Vj-yBU" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="10" id="ZH3-0g-M1x"/>
+                            <constraint firstItem="DoG-RI-jcO" firstAttribute="leading" secondItem="dOn-SY-wnl" secondAttribute="trailing" constant="10" id="ZIZ-QH-BXT"/>
                             <constraint firstItem="p7z-g7-hkV" firstAttribute="leading" secondItem="Zr2-rF-YUt" secondAttribute="trailing" constant="10" id="dFH-h5-ShO"/>
                             <constraint firstItem="Jc0-7X-JuE" firstAttribute="centerY" secondItem="JUR-Vj-yBU" secondAttribute="centerY" id="fR6-2Q-pkZ"/>
+                            <constraint firstItem="dOn-SY-wnl" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="10" id="gfe-aq-7nk"/>
                             <constraint firstItem="Zr2-rF-YUt" firstAttribute="top" secondItem="JUR-Vj-yBU" secondAttribute="bottom" constant="10" id="kLH-Zl-k0m"/>
+                            <constraint firstItem="dOn-SY-wnl" firstAttribute="top" secondItem="Zr2-rF-YUt" secondAttribute="bottom" constant="10" id="uIJ-Xj-Oe3"/>
                             <constraint firstItem="Zr2-rF-YUt" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="10" id="zBA-2T-5J8"/>
                             <constraint firstItem="JUR-Vj-yBU" firstAttribute="top" secondItem="vDu-zF-Fre" secondAttribute="top" constant="10" id="zbI-KC-mx0"/>
                         </constraints>
@@ -64,6 +82,8 @@
                         <outlet property="orangeText" destination="Jc0-7X-JuE" id="IAe-Ps-Cr2"/>
                         <outlet property="redButton" destination="Zr2-rF-YUt" id="jib-wX-2Of"/>
                         <outlet property="redText" destination="p7z-g7-hkV" id="FiU-ZR-JxH"/>
+                        <outlet property="violaButton" destination="dOn-SY-wnl" id="XFX-c3-ky3"/>
+                        <outlet property="violaText" destination="DoG-RI-jcO" id="axQ-8d-eQr"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>

+ 8 - 3
iOSClient/Color/NCColorPicker.swift

@@ -26,9 +26,11 @@ class NCColorPicker: UIViewController, NCColorPickerDelegate {
 
     @IBOutlet weak var orangeButton: UIButton!
     @IBOutlet weak var redButton: UIButton!
+    @IBOutlet weak var violaButton: UIButton!
 
     @IBOutlet weak var orangeText: UITextField!
     @IBOutlet weak var redText: UITextField!
+    @IBOutlet weak var violaText: UITextField!
 
     weak var delegate: NCColorPickerDelegate?
     var selectedColor: UIColor?
@@ -42,14 +44,17 @@ class NCColorPicker: UIViewController, NCColorPickerDelegate {
         orangeButton.backgroundColor = .orange
         orangeButton.layer.cornerRadius = 5
         orangeButton.layer.masksToBounds = true
-
-        orangeText.text = "Orange"
+        orangeText.text = NSLocalizedString("_orange_", comment: "")
 
         redButton.backgroundColor = .red
         redButton.layer.cornerRadius = 5
         redButton.layer.masksToBounds = true
+        redText.text = NSLocalizedString("_red_", comment: "")
 
-        redText.text = "Red"
+        violaButton.backgroundColor = UIColor(hex: "#8f00ff")
+        violaButton.layer.cornerRadius = 5
+        violaButton.layer.masksToBounds = true
+        violaText.text = NSLocalizedString("_viola_", comment: "")
 
     }