marinofaggiana 4 жил өмнө
parent
commit
e99b8af4ec

+ 48 - 15
iOSClient/Viewer/NCViewerImage/NCViewerImage.storyboard

@@ -110,33 +110,59 @@
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="P8R-4f-zAl" customClass="NCViewerImageDetailView" customModule="Nextcloud" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="462" width="414" height="317"/>
+                                        <rect key="frame" x="0.0" y="462" width="414" height="318"/>
                                         <subviews>
+                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HRq-3M-yeb">
+                                                <rect key="frame" x="15" y="50" width="384" height="1"/>
+                                                <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="1" id="X4S-cr-F2P"/>
+                                                </constraints>
+                                            </view>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="size" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WXS-Lw-DkI">
-                                                <rect key="frame" x="15" y="60" width="384" height="17"/>
+                                                <rect key="frame" x="15" y="61" width="80" height="17"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="80" id="DLa-7b-rDS"/>
+                                                </constraints>
+                                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                                <color key="textColor" systemColor="systemGrayColor"/>
+                                                <nil key="highlightedColor"/>
+                                            </label>
+                                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="size value" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XLb-0a-du9">
+                                                <rect key="frame" x="105" y="61" width="294" height="17"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="294" id="P2f-xx-Fs0"/>
+                                                </constraints>
                                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                                <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                 <nil key="highlightedColor"/>
                                             </label>
                                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="date" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Son-CZ-zFa">
-                                                <rect key="frame" x="15" y="87" width="384" height="17"/>
+                                                <rect key="frame" x="15" y="88" width="80" height="17"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="width" constant="80" id="e83-SZ-3FA"/>
+                                                </constraints>
                                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                                <color key="textColor" systemColor="systemGrayColor"/>
                                                 <nil key="highlightedColor"/>
                                             </label>
-                                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HRq-3M-yeb" userLabel="Divisor">
-                                                <rect key="frame" x="15" y="50" width="384" height="0.0"/>
-                                                <color key="backgroundColor" systemColor="opaqueSeparatorColor"/>
+                                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="date value" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hBd-KD-Jq5">
+                                                <rect key="frame" x="105" y="88" width="294" height="17"/>
                                                 <constraints>
-                                                    <constraint firstAttribute="height" id="X4S-cr-F2P"/>
+                                                    <constraint firstAttribute="width" constant="294" id="vdo-6b-FoE"/>
                                                 </constraints>
-                                            </view>
+                                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                                <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                                <nil key="highlightedColor"/>
+                                            </label>
                                             <mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="Typ-A8-XIO">
-                                                <rect key="frame" x="15" y="114" width="384" height="174"/>
+                                                <rect key="frame" x="15" y="115" width="384" height="174"/>
                                                 <constraints>
                                                     <constraint firstAttribute="height" constant="174" id="VRv-eR-bwo"/>
                                                 </constraints>
                                             </mapView>
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="oov-9f-Oeu">
-                                                <rect key="frame" x="15" y="288" width="384" height="29"/>
+                                                <rect key="frame" x="15" y="289" width="384" height="29"/>
                                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                                 <state key="normal" title="location"/>
                                                 <connections>
@@ -147,28 +173,35 @@
                                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <constraints>
                                             <constraint firstItem="WXS-Lw-DkI" firstAttribute="top" secondItem="HRq-3M-yeb" secondAttribute="bottom" constant="10" id="2RK-lk-nQe"/>
-                                            <constraint firstAttribute="trailing" secondItem="Son-CZ-zFa" secondAttribute="trailing" constant="15" id="7sl-TV-ydt"/>
+                                            <constraint firstItem="XLb-0a-du9" firstAttribute="centerY" secondItem="WXS-Lw-DkI" secondAttribute="centerY" id="6k5-Ur-AKZ"/>
                                             <constraint firstAttribute="trailing" secondItem="HRq-3M-yeb" secondAttribute="trailing" constant="15" id="DIq-e4-T4P"/>
                                             <constraint firstItem="Typ-A8-XIO" firstAttribute="top" secondItem="Son-CZ-zFa" secondAttribute="bottom" constant="10" id="IOL-oZ-F3c"/>
+                                            <constraint firstItem="XLb-0a-du9" firstAttribute="leading" secondItem="WXS-Lw-DkI" secondAttribute="trailing" constant="10" id="Iqg-lN-NpB"/>
                                             <constraint firstItem="oov-9f-Oeu" firstAttribute="top" secondItem="Typ-A8-XIO" secondAttribute="bottom" id="MUo-UC-1d4"/>
-                                            <constraint firstAttribute="trailing" secondItem="WXS-Lw-DkI" secondAttribute="trailing" constant="15" id="O4f-ro-Lg4"/>
+                                            <constraint firstItem="hBd-KD-Jq5" firstAttribute="centerY" secondItem="Son-CZ-zFa" secondAttribute="centerY" id="Tez-na-gqC"/>
                                             <constraint firstItem="HRq-3M-yeb" firstAttribute="top" secondItem="P8R-4f-zAl" secondAttribute="top" constant="50" id="UF1-fO-9hX"/>
                                             <constraint firstAttribute="bottom" secondItem="oov-9f-Oeu" secondAttribute="bottom" id="YuK-2v-kzk"/>
+                                            <constraint firstItem="hBd-KD-Jq5" firstAttribute="leading" secondItem="Son-CZ-zFa" secondAttribute="trailing" constant="10" id="YuO-13-KTh"/>
                                             <constraint firstItem="WXS-Lw-DkI" firstAttribute="leading" secondItem="P8R-4f-zAl" secondAttribute="leading" constant="15" id="bRd-bi-Imh"/>
                                             <constraint firstItem="Typ-A8-XIO" firstAttribute="leading" secondItem="P8R-4f-zAl" secondAttribute="leading" constant="15" id="jre-DM-hm3"/>
                                             <constraint firstItem="oov-9f-Oeu" firstAttribute="leading" secondItem="P8R-4f-zAl" secondAttribute="leading" constant="15" id="lXY-IM-uQB"/>
                                             <constraint firstAttribute="trailing" secondItem="oov-9f-Oeu" secondAttribute="trailing" constant="15" id="mpQ-4V-Yfc"/>
                                             <constraint firstAttribute="trailing" secondItem="Typ-A8-XIO" secondAttribute="trailing" constant="15" id="nAm-fh-5Px"/>
                                             <constraint firstItem="HRq-3M-yeb" firstAttribute="leading" secondItem="P8R-4f-zAl" secondAttribute="leading" constant="15" id="oJB-7U-UpU"/>
+                                            <constraint firstAttribute="trailing" secondItem="XLb-0a-du9" secondAttribute="trailing" constant="15" id="p7C-ox-HFw"/>
+                                            <constraint firstAttribute="trailing" secondItem="hBd-KD-Jq5" secondAttribute="trailing" constant="15" id="sKA-YA-3Uc"/>
                                             <constraint firstItem="Son-CZ-zFa" firstAttribute="leading" secondItem="P8R-4f-zAl" secondAttribute="leading" constant="15" id="vsg-gX-rNv"/>
                                             <constraint firstItem="Son-CZ-zFa" firstAttribute="top" secondItem="WXS-Lw-DkI" secondAttribute="bottom" constant="10" id="z9W-ZR-cUN"/>
                                         </constraints>
                                         <connections>
                                             <outlet property="dateLabel" destination="Son-CZ-zFa" id="0Wi-XW-0hw"/>
+                                            <outlet property="dateValue" destination="hBd-KD-Jq5" id="ple-nX-OpH"/>
                                             <outlet property="locationButton" destination="oov-9f-Oeu" id="cGg-Gb-m5S"/>
                                             <outlet property="mapHeightConstraint" destination="VRv-eR-bwo" id="jXn-vm-aJk"/>
                                             <outlet property="mapView" destination="Typ-A8-XIO" id="XCg-a6-NUq"/>
+                                            <outlet property="separator" destination="HRq-3M-yeb" id="ENP-xc-AWZ"/>
                                             <outlet property="sizeLabel" destination="WXS-Lw-DkI" id="JG0-G0-oHg"/>
+                                            <outlet property="sizeValue" destination="XLb-0a-du9" id="9jm-Ku-sgt"/>
                                         </connections>
                                     </view>
                                 </subviews>
@@ -220,11 +253,11 @@
         <image name="audioOn" width="28" height="28"/>
         <image name="downloadImageFullRes" width="283" height="283"/>
         <image name="videoFavoriteOn" width="28" height="28"/>
-        <systemColor name="opaqueSeparatorColor">
-            <color red="0.77647058823529413" green="0.77647058823529413" blue="0.78431372549019607" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-        </systemColor>
         <systemColor name="systemBackgroundColor">
             <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
         </systemColor>
+        <systemColor name="systemGrayColor">
+            <color red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
     </resources>
 </document>

+ 16 - 7
iOSClient/Viewer/NCViewerImage/NCViewerImageDetailView.swift

@@ -26,9 +26,12 @@ import MapKit
 
 class NCViewerImageDetailView: UIView {
     
-    @IBOutlet weak var mapHeightConstraint: NSLayoutConstraint!
+    @IBOutlet weak var separator: UIView!
     @IBOutlet weak var sizeLabel: UILabel!
+    @IBOutlet weak var sizeValue: UILabel!
     @IBOutlet weak var dateLabel: UILabel!
+    @IBOutlet weak var dateValue: UILabel!
+    @IBOutlet weak var mapHeightConstraint: NSLayoutConstraint!
     @IBOutlet weak var mapView: MKMapView!
     @IBOutlet weak var locationButton: UIButton!
 
@@ -47,9 +50,13 @@ class NCViewerImageDetailView: UIView {
         mapView.isZoomEnabled = false
         mapView.isScrollEnabled = false
         mapView.isUserInteractionEnabled = false
+        
+        separator.backgroundColor = NCBrandColor.sharedInstance.separator
     }
     
-    func show() {
+    func show(textColor: UIColor?) {
+        sizeValue.textColor = textColor
+        dateValue.textColor = textColor
         isHidden = false
     }
     
@@ -63,11 +70,10 @@ class NCViewerImageDetailView: UIView {
     
     //MARK: - EXIF
     
-    func update(metadata: tableMetadata, heightMap:  CGFloat, textColor: UIColor) {
+    func update(metadata: tableMetadata, heightMap:  CGFloat) {
                     
         self.heightMap = heightMap
-        dateLabel.textColor = textColor
-        
+
         self.size = metadata.size
         self.date = metadata.date
         
@@ -102,7 +108,8 @@ class NCViewerImageDetailView: UIView {
     func updateContent() {
         
         // Size
-        self.sizeLabel.text = NSLocalizedString("_size_", comment: "") + " " + CCUtility.transformedSize(self.size)
+        sizeLabel.text = NSLocalizedString("_size_", comment: "")
+        sizeValue.text = CCUtility.transformedSize(self.size)
         
         // Date
         if let date = self.date {
@@ -111,7 +118,9 @@ class NCViewerImageDetailView: UIView {
             let dateString = formatter.string(from: date as Date)
             formatter.dateFormat = "HH:mm"
             let timeString = formatter.string(from: date as Date)
-            self.dateLabel.text = NSLocalizedString("_date_", comment: "") + " " + dateString + ", " + timeString
+            
+            dateLabel.text = NSLocalizedString("_date_", comment: "")
+            dateValue.text = dateString + ", " + timeString
         }
         
         // Map

+ 3 - 4
iOSClient/Viewer/NCViewerImage/NCViewerImageZoom.swift

@@ -105,13 +105,12 @@ class NCViewerImageZoom: UIViewController {
     override func viewDidAppear(_ animated: Bool) {
         super.viewDidAppear(animated)
         
-        guard let textColor = self.viewerImage?.textColor else {return }
         var heightMap = (view.bounds.height / 3)
         if view.bounds.width < view.bounds.height {
             heightMap = (view.bounds.width / 3)
         }
-        
-        detailView.update(metadata: metadata, heightMap: heightMap, textColor: textColor)
+    
+        detailView.update(metadata: metadata, heightMap: heightMap)
         detailViewTopConstraint.constant = 0
         detailView.hide()
         
@@ -189,7 +188,7 @@ class NCViewerImageZoom: UIViewController {
             // OPEN DETAIL
             if imageView.center.y < view.center.y - 50 {
                 
-                detailView.show()
+                detailView.show(textColor: self.viewerImage?.textColor)
             }
             
             // CLOSE DETAIL