浏览代码

images coding

marinofaggiana 4 年之前
父节点
当前提交
24cea92037

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

@@ -145,6 +145,7 @@
 "_delete_folder_"           = "Delete folder";
 "_automatic_Download_Image_" = "Use images in full resolution";
 "_automatic_Download_Image_footer_" = "When viewing images always download, if not available locally, the images in full resolution";
+"_size_"                    = "Size";
 
 // App
 

+ 25 - 22
iOSClient/Viewer/NCViewerImage/NCViewerImage.storyboard

@@ -110,51 +110,51 @@
                                         <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="318"/>
+                                        <rect key="frame" x="0.0" y="462" width="414" height="317"/>
                                         <subviews>
+                                            <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"/>
+                                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                                <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"/>
+                                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                                <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"/>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" id="X4S-cr-F2P"/>
+                                                </constraints>
+                                            </view>
                                             <mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="Typ-A8-XIO">
-                                                <rect key="frame" x="15" y="115" width="384" height="174"/>
+                                                <rect key="frame" x="15" y="114" 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="289" width="384" height="29"/>
+                                                <rect key="frame" x="15" y="288" width="384" height="29"/>
                                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                                 <state key="normal" title="location"/>
                                                 <connections>
                                                     <action selector="touchLocation:" destination="P8R-4f-zAl" eventType="touchUpInside" id="Z9s-pM-WsS"/>
                                                 </connections>
                                             </button>
-                                            <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="88" width="384" height="17"/>
-                                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
-                                                <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="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="date" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WXS-Lw-DkI">
-                                                <rect key="frame" x="15" y="61" width="384" height="17"/>
-                                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
-                                                <nil key="highlightedColor"/>
-                                            </label>
                                         </subviews>
                                         <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="8Jj-fx-eQP"/>
+                                            <constraint firstAttribute="trailing" secondItem="Son-CZ-zFa" secondAttribute="trailing" constant="15" id="7sl-TV-ydt"/>
                                             <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="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="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="WXS-Lw-DkI" firstAttribute="leading" secondItem="P8R-4f-zAl" secondAttribute="leading" constant="15" id="bRd-bi-Imh"/>
-                                            <constraint firstAttribute="trailing" secondItem="WXS-Lw-DkI" secondAttribute="trailing" constant="15" id="eOp-0N-ja8"/>
                                             <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"/>
@@ -220,6 +220,9 @@
         <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>

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

@@ -61,13 +61,6 @@ class NCViewerImageDetailView: UIView {
         return !isHidden
     }
     
-    func hasData() -> Bool {
-        if localFile != nil {
-            return true
-        }
-        return false
-    }
-    
     //MARK: - EXIF
     
     func update(metadata: tableMetadata, heightMap:  CGFloat, textColor: UIColor) {
@@ -75,6 +68,9 @@ class NCViewerImageDetailView: UIView {
         self.heightMap = heightMap
         dateLabel.textColor = textColor
         
+        self.size = metadata.size
+        self.date = metadata.date
+        
         if metadata.typeFile == k_metadataTypeFile_image {
             CCUtility.setExif(metadata) { (latitude, longitude, location, date) in
                 self.latitude = latitude
@@ -92,7 +88,6 @@ class NCViewerImageDetailView: UIView {
             self.latitude = Double(localFile.exifLatitude) ?? 0
             self.longitude = Double(localFile.exifLongitude) ?? 0
             self.date = localFile.exifDate
-            self.size = localFile.size
             
             if let locationDB = NCManageDatabase.sharedInstance.getLocationFromGeoLatitude(latitudeString, longitude: longitudeString) {
                 location = locationDB
@@ -106,6 +101,9 @@ class NCViewerImageDetailView: UIView {
     
     func updateContent() {
         
+        // Size
+        self.sizeLabel.text = NSLocalizedString("_size_", comment: "") + " " + CCUtility.transformedSize(self.size)
+        
         // Date
         if let date = self.date {
             let formatter = DateFormatter()
@@ -113,12 +111,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 = dateString + ", " + timeString
+            self.dateLabel.text = NSLocalizedString("_date_", comment: "") + " " + dateString + ", " + timeString
         }
         
-        // Size
-        self.sizeLabel.text = CCUtility.transformedSize(self.size)
-        
         // Map
         if latitude > 0 && longitude > 0 {
             

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

@@ -189,9 +189,7 @@ class NCViewerImageZoom: UIViewController {
             // OPEN DETAIL
             if imageView.center.y < view.center.y - 50 {
                 
-                if detailView.hasData() {
-                    detailView.show()
-                }
+                detailView.show()
             }
             
             // CLOSE DETAIL