Ver código fonte

add icon local

Marino Faggiana 7 anos atrás
pai
commit
f9c9ca9d25

+ 7 - 2
iOSClient/Favorites/CCFavorites.m

@@ -643,6 +643,7 @@
     // Initialize
     cell.status.image = nil;
     cell.favorite.image = nil;
+    cell.local.image = nil;
         
     // change color selection
     UIView *selectionColor = [[UIView alloc] init];
@@ -707,9 +708,13 @@
             BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/%@", app.directoryUser, metadata.fileID]];
             
             if (fileExists)
-                cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ • %@", date, length];
+                cell.local.image = [UIImage imageNamed:@"local"];
             else
-                cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ ◦ %@", date, length];
+                cell.local.image = nil;
+            
+            cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ %@", date, length];
+            //cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ • %@", date, length];
+            //cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ ◦ %@", date, length];
         }
         
         cell.accessoryType = UITableViewCellAccessoryNone;

+ 1 - 0
iOSClient/Favorites/CCFavoritesCell.h

@@ -28,6 +28,7 @@
 @property(nonatomic, weak) IBOutlet UIImageView *file;
 @property(nonatomic, weak) IBOutlet UIImageView *status;
 @property(nonatomic, weak) IBOutlet UIImageView *favorite;
+@property(nonatomic, weak) IBOutlet UIImageView *local;
 
 @property(nonatomic, weak) IBOutlet UILabel *labelTitle;
 @property(nonatomic, weak) IBOutlet UILabel *labelInfoFile;

+ 10 - 0
iOSClient/Favorites/CCFavoritesCell.xib

@@ -32,6 +32,13 @@
                             <constraint firstAttribute="height" constant="40" id="cGI-9B-eWe"/>
                         </constraints>
                     </imageView>
+                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="8I8-C4-IpX" userLabel="Local">
+                        <rect key="frame" x="39" y="4" width="15" height="15"/>
+                        <constraints>
+                            <constraint firstAttribute="width" constant="15" id="Zqv-l0-LGD"/>
+                            <constraint firstAttribute="height" constant="15" id="gLU-er-iu6"/>
+                        </constraints>
+                    </imageView>
                     <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="DQR-yN-JaH">
                         <rect key="frame" x="40" y="40" width="15" height="15"/>
                         <constraints>
@@ -62,7 +69,9 @@
                     <constraint firstAttribute="centerY" secondItem="5" secondAttribute="centerY" id="FQP-wg-vPF"/>
                     <constraint firstItem="DQR-yN-JaH" firstAttribute="top" secondItem="p7I-KN-FVZ" secondAttribute="top" constant="6.5" id="K6B-gJ-8Fp"/>
                     <constraint firstItem="p7I-KN-FVZ" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="K7G-0u-f8E"/>
+                    <constraint firstItem="8I8-C4-IpX" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="-11" id="MeU-6N-LsY"/>
                     <constraint firstItem="QNC-8X-DAC" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="UYc-Al-a4h"/>
+                    <constraint firstItem="5" firstAttribute="top" secondItem="8I8-C4-IpX" secondAttribute="bottom" constant="-9" id="c7V-hW-ut8"/>
                     <constraint firstItem="p7I-KN-FVZ" firstAttribute="top" secondItem="QNC-8X-DAC" secondAttribute="bottom" id="cJT-LE-kot"/>
                     <constraint firstItem="dhG-hb-z3n" firstAttribute="leading" secondItem="sQq-jC-UEV" secondAttribute="leadingMargin" constant="-4" id="dNM-6x-zkx"/>
                     <constraint firstItem="p7I-KN-FVZ" firstAttribute="trailing" secondItem="sQq-jC-UEV" secondAttribute="trailingMargin" constant="-59" id="kaB-WS-bDl"/>
@@ -73,6 +82,7 @@
                 <outlet property="file" destination="5" id="whc-SL-Hxm"/>
                 <outlet property="labelInfoFile" destination="p7I-KN-FVZ" id="5Yb-hH-k73"/>
                 <outlet property="labelTitle" destination="QNC-8X-DAC" id="dFX-Cb-8IE"/>
+                <outlet property="local" destination="8I8-C4-IpX" id="zk7-DD-WJB"/>
                 <outlet property="status" destination="DQR-yN-JaH" id="xh2-y1-GlP"/>
             </connections>
             <point key="canvasLocation" x="256" y="19"/>

+ 23 - 0
iOSClient/Images.xcassets/local.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "local.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "local@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "local@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/local.imageset/local.png


BIN
iOSClient/Images.xcassets/local.imageset/local@2x.png


BIN
iOSClient/Images.xcassets/local.imageset/local@3x.png


+ 6 - 2
iOSClient/Main/CCMain.m

@@ -5037,9 +5037,13 @@
         
         if ([metadata.type isEqualToString: k_metadataType_file] && [dataFile isEqualToString:@" "] == NO && [lunghezzaFile isEqualToString:@" "] == NO) {
             if (localFile && [[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/%@", app.directoryUser, metadata.fileID]])
-                cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ • %@", dataFile, lunghezzaFile];
+                cell.local.image = [UIImage imageNamed:@"local"];
             else
-                cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ ◦ %@", dataFile, lunghezzaFile];
+                cell.local.image = nil;
+            
+            //cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ • %@", dataFile, lunghezzaFile];
+            //cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ ◦ %@", dataFile, lunghezzaFile];
+            cell.labelInfoFile.text = [NSString stringWithFormat:@"%@ %@", dataFile, lunghezzaFile];
         }
 
         // Plist ancora da scaricare