marinofaggiana 3 lat temu
rodzic
commit
1c2efc08df

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -211,6 +211,7 @@
 "_online_status_"           = "Online status";
 "_clear_status_message_"    = "Clear status message";
 "_set_status_message_"      = "Set status message";
+"_clear_status_message_after_"  = "Clear status message after";
 
 "_network_available_"       = "Network available";
 "_network_not_available_"   = "Network unavailable";

+ 6 - 6
iOSClient/UserStatus/NCUserStatus.storyboard

@@ -208,7 +208,7 @@
                                 <textInputTraits key="textInputTraits"/>
                             </textField>
                             <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="what's your status?" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="qXf-nl-3Li">
-                                <rect key="frame" x="43" y="319" width="342" height="34"/>
+                                <rect key="frame" x="43" y="319" width="337" height="34"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="34" id="0in-EY-eBM"/>
                                 </constraints>
@@ -258,20 +258,20 @@
                                 </connections>
                             </tableView>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3CT-dJ-sEj">
-                                <rect key="frame" x="10" y="770" width="170" height="30"/>
+                                <rect key="frame" x="10" y="770" width="175" height="30"/>
                                 <color key="backgroundColor" systemColor="systemGray6Color"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="30" id="1F4-Cv-RzK"/>
-                                    <constraint firstAttribute="width" constant="170" id="77H-1R-knu"/>
+                                    <constraint firstAttribute="width" constant="175" id="77H-1R-knu"/>
                                 </constraints>
                                 <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
                                 <state key="normal" title="clear status message"/>
                             </button>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3xN-e7-N0L">
-                                <rect key="frame" x="210" y="770" width="170" height="30"/>
+                                <rect key="frame" x="205" y="770" width="175" height="30"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="30" id="66i-0j-Qrn"/>
-                                    <constraint firstAttribute="width" constant="170" id="wvf-2Z-fgc"/>
+                                    <constraint firstAttribute="width" constant="175" id="wvf-2Z-fgc"/>
                                 </constraints>
                                 <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
                                 <state key="normal" title="set status message"/>
@@ -306,7 +306,7 @@
                             <constraint firstItem="ldK-hD-vsJ" firstAttribute="top" secondItem="Hed-Bz-0g1" secondAttribute="bottom" constant="40" id="K8i-hZ-ic0"/>
                             <constraint firstItem="3CT-dJ-sEj" firstAttribute="top" secondItem="rha-b0-jMR" secondAttribute="bottom" constant="20" id="KlN-Ud-r2X"/>
                             <constraint firstItem="Hed-Bz-0g1" firstAttribute="top" secondItem="ukn-PZ-9sx" secondAttribute="bottom" constant="30" id="LJ2-Qn-qbJ"/>
-                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="qXf-nl-3Li" secondAttribute="trailing" constant="5" id="MLs-tH-cbf"/>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="qXf-nl-3Li" secondAttribute="trailing" constant="10" id="MLs-tH-cbf"/>
                             <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="P09-kU-gUI" secondAttribute="trailing" constant="10" id="Qm6-Nb-VLH"/>
                             <constraint firstItem="3CT-dJ-sEj" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="10" id="Ra0-dj-zWy"/>
                             <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="ukn-PZ-9sx" secondAttribute="trailing" constant="10" id="Sxc-Bi-ERz"/>

+ 16 - 33
iOSClient/UserStatus/NCUserStatus.swift

@@ -63,11 +63,6 @@ class NCUserStatus: UIViewController {
     private var statusPredefinedStatuses: [NCCommunicationUserStatus] = []
     private var userStatusRetrieveStatuses: [NCCommunicationUserStatus] = []
     
-    private let heightCell: CGFloat = 45
-    
-    
-
-
     // MARK: - View Life Cycle
 
     override func viewDidLoad() {
@@ -77,7 +72,7 @@ class NCUserStatus: UIViewController {
 
         onlineButton.layer.cornerRadius = 10
         onlineButton.layer.masksToBounds = true
-        onlineButton.backgroundColor = NCBrandColor.shared.systemGray6
+        onlineButton.backgroundColor = NCBrandColor.shared.systemGray5
         //onlineLabel.layer.borderWidth = 0.5
         //onlineLabel.layer.borderColor = NCBrandColor.shared.brand.cgColor
         let onLine = NCUtility.shared.getUserStatus(userIcon: nil, userStatus: "online", userMessage: nil)
@@ -87,7 +82,7 @@ class NCUserStatus: UIViewController {
        
         awayButton.layer.cornerRadius = 10
         awayButton.layer.masksToBounds = true
-        awayButton.backgroundColor = NCBrandColor.shared.systemGray6
+        awayButton.backgroundColor = NCBrandColor.shared.systemGray5
         //onlineLabel.layer.borderWidth = 0.5
         //onlineLabel.layer.borderColor = NCBrandColor.shared.brand.cgColor
         let away = NCUtility.shared.getUserStatus(userIcon: nil, userStatus: "away", userMessage: nil)
@@ -97,7 +92,7 @@ class NCUserStatus: UIViewController {
         
         dndButton.layer.cornerRadius = 10
         dndButton.layer.masksToBounds = true
-        dndButton.backgroundColor = NCBrandColor.shared.systemGray6
+        dndButton.backgroundColor = NCBrandColor.shared.systemGray5
         //onlineLabel.layer.borderWidth = 0.5
         //onlineLabel.layer.borderColor = NCBrandColor.shared.brand.cgColor
         let dnd = NCUtility.shared.getUserStatus(userIcon: nil, userStatus: "dnd", userMessage: nil)
@@ -109,9 +104,9 @@ class NCUserStatus: UIViewController {
         
         invisibleButton.layer.cornerRadius = 10
         invisibleButton.layer.masksToBounds = true
-        invisibleButton.backgroundColor = NCBrandColor.shared.systemGray6
-        //onlineLabel.layer.borderWidth = 0.5
-        //onlineLabel.layer.borderColor = NCBrandColor.shared.brand.cgColor
+        invisibleButton.backgroundColor = NCBrandColor.shared.systemGray5
+        invisibleButton.layer.borderWidth = 1.5
+        invisibleButton.layer.borderColor = NCBrandColor.shared.brand.cgColor
         let offline = NCUtility.shared.getUserStatus(userIcon: nil, userStatus: "offline", userMessage: nil)
         invisibleImage.image = offline.onlineStatus
         invisibleLabel.text = offline.statusMessage
@@ -123,7 +118,7 @@ class NCUserStatus: UIViewController {
         statusMessageLabel.textColor = NCBrandColor.shared.label
 
         statusMessageEmojiTextField.delegate = self
-        statusMessageEmojiTextField.backgroundColor = NCBrandColor.shared.systemGray6
+        statusMessageEmojiTextField.backgroundColor = NCBrandColor.shared.systemGray5
         
         statusMessageTextField.placeholder = NSLocalizedString("_status_message_placehorder_", comment: "")
         statusMessageTextField.textColor = NCBrandColor.shared.label
@@ -131,11 +126,14 @@ class NCUserStatus: UIViewController {
         tableView.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.size.width, height: 1))
         tableView.separatorStyle = UITableViewCell.SeparatorStyle.none
         
+        clearStatusMessageAfterLabel.text = NSLocalizedString("_clear_status_message_after_", comment: "")
+        clearStatusMessageAfterLabel.textColor = NCBrandColor.shared.label
+        
         clearStatusMessageButton.layer.cornerRadius = 15
         clearStatusMessageButton.layer.masksToBounds = true
         clearStatusMessageButton.layer.borderWidth = 0.5
         clearStatusMessageButton.layer.borderColor = UIColor.darkGray.cgColor
-        clearStatusMessageButton.backgroundColor = NCBrandColor.shared.systemGray6
+        clearStatusMessageButton.backgroundColor = NCBrandColor.shared.systemGray5
         clearStatusMessageButton.setTitle(NSLocalizedString("_clear_status_message_", comment: ""), for: .normal)
         clearStatusMessageButton.setTitleColor(NCBrandColor.shared.label, for: .normal)
         
@@ -145,6 +143,7 @@ class NCUserStatus: UIViewController {
         setStatusMessageButton.setTitle(NSLocalizedString("_set_status_message_", comment: ""), for: .normal)
         setStatusMessageButton.setTitleColor(NCBrandColor.shared.brandText, for: .normal)
 
+        changeTheming()
         getStatus()
     }
     
@@ -152,8 +151,8 @@ class NCUserStatus: UIViewController {
     
     @objc func changeTheming() {
         
-        view.backgroundColor = NCBrandColor.shared.secondarySystemBackground
-        tableView.backgroundColor = NCBrandColor.shared.secondarySystemBackground
+        view.backgroundColor = NCBrandColor.shared.systemBackground
+        tableView.backgroundColor = NCBrandColor.shared.systemBackground
         
         tableView.reloadData()
     }
@@ -261,29 +260,13 @@ class emojiTextField: UITextField {
 extension NCUserStatus: UITableViewDelegate {
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return heightCell
+        return 45
     }
     
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         
-        /*
-        if indexPath.row == accounts.count {
-            
-            dismiss(animated: true)
-            delegate?.accountRequestAddAccount()
-            
-        } else {
+        let status = statusPredefinedStatuses[indexPath.row]
         
-            let account = accounts[indexPath.row]
-            if account.account != activeAccount?.account {
-                dismiss(animated: true) {
-                    self.delegate?.accountRequestChangeAccount(account: account.account)
-                }
-            } else {
-                dismiss(animated: true)
-            }
-        }
-        */
     }
 }