Browse Source

Add MarqueeLabel

marinofaggiana 3 years ago
parent
commit
902ec82120
2 changed files with 9 additions and 6 deletions
  1. 3 3
      iOSClient/More/NCMore.swift
  2. 6 3
      iOSClient/More/NCMoreUserCell.xib

+ 3 - 3
iOSClient/More/NCMore.swift

@@ -21,9 +21,9 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
-
 import UIKit
 import NCCommunication
+import MarqueeLabel
 
 class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
 
@@ -349,6 +349,7 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
                     cell.icon.image = status.onlineStatus
                     cell.status.text = status.statusMessage
                     cell.status.textColor = NCBrandColor.shared.label
+                    cell.status.trailingBuffer = cell.status.frame.width
                 }
             }
             
@@ -470,6 +471,5 @@ class NCMoreUserCell: UITableViewCell {
     @IBOutlet weak var displayName: UILabel!
     @IBOutlet weak var avatar: UIImageView!
     @IBOutlet weak var icon: UIImageView!
-    @IBOutlet weak var status: UILabel!
-
+    @IBOutlet weak var status: MarqueeLabel!
 }

+ 6 - 3
iOSClient/More/NCMoreUserCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -21,10 +21,13 @@
                         <fontDescription key="fontDescription" type="system" pointSize="15"/>
                         <nil key="highlightedColor"/>
                     </label>
-                    <label opaque="NO" userInteractionEnabled="NO" tag="102" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="status" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p7I-KN-FVZ">
+                    <label opaque="NO" userInteractionEnabled="NO" tag="102" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="status" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p7I-KN-FVZ" customClass="MarqueeLabel" customModule="MarqueeLabel">
                         <rect key="frame" x="335" y="48" width="245" height="14.5"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <nil key="highlightedColor"/>
+                        <userDefinedRuntimeAttributes>
+                            <userDefinedRuntimeAttribute type="boolean" keyPath="tapToScroll" value="YES"/>
+                        </userDefinedRuntimeAttributes>
                     </label>
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" translatesAutoresizingMaskIntoConstraints="NO" id="5">
                         <rect key="frame" x="275" y="10" width="50" height="50"/>