浏览代码

library: add a visual indicator for folders and TV shows (iOS 7 only for now)

Felix Paul Kühne 11 年之前
父节点
当前提交
bf82348f5b

+ 9 - 3
Resources/VLCFuturePlaylistCollectionViewCell.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="4514" systemVersion="12F45" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="5053" systemVersion="12F45" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
     <dependencies>
         <deployment version="1792" defaultVersion="1552" identifier="iOS"/>
         <development version="5000" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
     </dependencies>
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
@@ -20,6 +20,10 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                     </imageView>
+                    <imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" image="folderIcon.png" id="0uT-W6-UMC">
+                        <rect key="frame" x="0.0" y="85" width="341" height="190"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                    </imageView>
                     <imageView opaque="NO" clearsContextBeforeDrawing="NO" userInteractionEnabled="NO" contentMode="scaleToFill" image="gradient-cell-ios7-ipad.png" id="Gzk-gj-0jk">
                         <rect key="frame" x="0.0" y="0.0" width="341" height="190"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -57,6 +61,7 @@
             </view>
             <size key="customSize" width="298" height="167"/>
             <connections>
+                <outlet property="folderIconView" destination="0uT-W6-UMC" id="coZ-4M-nCp"/>
                 <outlet property="isSelectedView" destination="pl6-iw-2ZI" id="1sX-gh-yiU"/>
                 <outlet property="mediaIsUnreadView" destination="ftR-Og-FOs" id="5aH-vE-E37"/>
                 <outlet property="subtitleLabel" destination="jdp-lJ-hIF" id="YUa-G7-CMl"/>
@@ -67,6 +72,7 @@
     </objects>
     <resources>
         <image name="checkboxEmpty.png" width="25" height="25"/>
+        <image name="folderIcon.png" width="221" height="205"/>
         <image name="gradient-cell-ios7-ipad.png" width="2" height="190"/>
     </resources>
-</document>
+</document>

+ 7 - 1
Resources/VLCFuturePlaylistTableViewCell.xib

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5037.3" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5053" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
     <dependencies>
         <deployment version="1792" defaultVersion="1552" identifier="iOS"/>
         <development version="5000" identifier="xcode"/>
@@ -20,6 +20,10 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                     </imageView>
+                    <imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="top" image="folderIcon.png" id="5iA-hI-rrr">
+                        <rect key="frame" x="0.0" y="35" width="320" height="55"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                    </imageView>
                     <imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="gradient-cell-ios7.png" id="22">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="90"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -52,6 +56,7 @@
             </tableViewCellContentView>
             <color key="backgroundColor" white="0.12" alpha="1" colorSpace="calibratedWhite"/>
             <connections>
+                <outlet property="folderIconView" destination="5iA-hI-rrr" id="K2w-2u-dEl"/>
                 <outlet property="mediaIsUnreadView" destination="sYw-l2-Tmv" id="us6-sJ-NVp"/>
                 <outlet property="subtitleLabel" destination="7" id="8"/>
                 <outlet property="thumbnailView" destination="4" id="9"/>
@@ -60,6 +65,7 @@
         </tableViewCell>
     </objects>
     <resources>
+        <image name="folderIcon.png" width="120" height="112"/>
         <image name="gradient-cell-ios7.png" width="2" height="92"/>
     </resources>
 </document>

+ 1 - 0
Sources/VLCPlaylistCollectionViewCell.h

@@ -23,6 +23,7 @@
 @property (nonatomic, strong) IBOutlet VLCLinearProgressIndicator *progressView;
 @property (nonatomic, strong) IBOutlet UIView *mediaIsUnreadView;
 @property (nonatomic, strong) IBOutlet UIImageView *isSelectedView;
+@property (nonatomic, strong) IBOutlet UIImageView *folderIconView;
 
 @property (nonatomic, retain) MLFile *mediaObject;
 

+ 8 - 0
Sources/VLCPlaylistCollectionViewCell.m

@@ -224,6 +224,8 @@
     self.subtitleLabel.text = [string stringByAppendingString:[NSString stringWithFormat:(count > 1) ? NSLocalizedString(@"LIBRARY_EPISODES", @"") : NSLocalizedString(@"LIBRARY_SINGLE_EPISODE", @""), count, show.unreadEpisodes.count]];
     self.mediaIsUnreadView.hidden = YES;
     self.progressView.hidden = YES;
+    self.folderIconView.image = [UIImage imageNamed:@"PlayingExternally"];
+    self.folderIconView.hidden = NO;
 }
 
 - (void)_configureForAlbumTrack:(MLAlbumTrack *)albumTrack
@@ -234,6 +236,7 @@
     self.titleLabel.text = albumTrack.title;
 
     [self _showPositionOfItem:anyFileFromTrack];
+    self.folderIconView.hidden = YES;
 }
 
 - (void)_configureForShowEpisode:(MLShowEpisode *)showEpisode
@@ -247,6 +250,7 @@
     } else
         self.subtitleLabel.text = [NSString stringWithFormat:@"S%02dE%02d — %@", showEpisode.seasonNumber.intValue, showEpisode.episodeNumber.intValue, [VLCTime timeWithNumber:[anyFileFromEpisode duration]]];
     [self _showPositionOfItem:anyFileFromEpisode];
+    self.folderIconView.hidden = YES;
 }
 
 - (void)_configureForAlbum:(MLAlbum *)album
@@ -265,6 +269,7 @@
     self.subtitleLabel.text = string;
     self.mediaIsUnreadView.hidden = YES;
     self.progressView.hidden = YES;
+    self.folderIconView.hidden = YES;
 }
 
 - (void)_configureForFolder:(MLLabel *)label
@@ -274,6 +279,8 @@
     self.subtitleLabel.text = [NSString stringWithFormat:(count == 1) ? NSLocalizedString(@"LIBRARY_SINGLE_TRACK", @"") : NSLocalizedString(@"LIBRARY_TRACKS", @""), count];
     self.mediaIsUnreadView.hidden = YES;
     self.progressView.hidden = YES;
+    self.folderIconView.image = [UIImage imageNamed:@"folderIcon"];
+    self.folderIconView.hidden = NO;
 }
 
 - (void)_configureForMLFile:(MLFile *)mediaFile
@@ -302,6 +309,7 @@
         }
     }
     [self _showPositionOfItem:mediaFile];
+    self.folderIconView.hidden = YES;
 }
 
 - (void)_showPositionOfItem:(MLFile *)mediaItem

+ 1 - 0
Sources/VLCPlaylistTableViewCell.h

@@ -21,6 +21,7 @@
 @property (nonatomic, strong) IBOutlet UIImageView *thumbnailView;
 @property (nonatomic, strong) IBOutlet VLCLinearProgressIndicator *progressIndicator;
 @property (nonatomic, strong) IBOutlet UIView *mediaIsUnreadView;
+@property (nonatomic, strong) IBOutlet UIImageView *folderIconView;
 
 @property (nonatomic, strong) NSManagedObject *mediaObject;
 

+ 8 - 0
Sources/VLCPlaylistTableViewCell.m

@@ -209,6 +209,8 @@
     self.subtitleLabel.text = [string stringByAppendingString:[NSString stringWithFormat:(count > 1) ? NSLocalizedString(@"LIBRARY_EPISODES", @"") : NSLocalizedString(@"LIBRARY_SINGLE_EPISODE", @""), count, show.unreadEpisodes.count]];
     self.mediaIsUnreadView.hidden = YES;
     self.progressIndicator.hidden = YES;
+    self.folderIconView.image = [UIImage imageNamed:@"PlayingExternally"];
+    self.folderIconView.hidden = NO;
 }
 
 - (void)_configureForAlbumTrack:(MLAlbumTrack *)albumTrack
@@ -217,6 +219,7 @@
     self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %@ — %@", albumTrack.artist, [NSString stringWithFormat:NSLocalizedString(@"LIBRARY_TRACK_N", @""), albumTrack.trackNumber.intValue], [VLCTime timeWithNumber:[anyFileFromTrack duration]]];
     self.titleLabel.text = albumTrack.title;
     [self _showPositionOfItem:anyFileFromTrack];
+    self.folderIconView.hidden = YES;
 }
 
 - (void)_configureForShowEpisode:(MLShowEpisode *)showEpisode
@@ -231,6 +234,7 @@
         self.subtitleLabel.text = [NSString stringWithFormat:@"S%02dE%02d — %@", showEpisode.seasonNumber.intValue, showEpisode.episodeNumber.intValue, [VLCTime timeWithNumber:[anyFileFromEpisode duration]]];
 
     [self _showPositionOfItem:anyFileFromEpisode];
+    self.folderIconView.hidden = YES;
 }
 
 - (void)_configureForAlbum:(MLAlbum *)album
@@ -249,6 +253,7 @@
     self.subtitleLabel.text = string;
     self.mediaIsUnreadView.hidden = YES;
     self.progressIndicator.hidden = YES;
+    self.folderIconView.hidden = YES;
 }
 
 - (void)_configureForFolder:(MLLabel *)label
@@ -258,6 +263,8 @@
     self.subtitleLabel.text = [NSString stringWithFormat:(count == 1) ? NSLocalizedString(@"LIBRARY_SINGLE_TRACK", @"") : NSLocalizedString(@"LIBRARY_TRACKS", @""), count];
     self.mediaIsUnreadView.hidden = YES;
     self.progressIndicator.hidden = YES;
+    self.folderIconView.image = [UIImage imageNamed:@"folderIcon"];
+    self.folderIconView.hidden = NO;
 }
 
 - (void)_configureForMLFile:(MLFile *)mediaFile
@@ -284,6 +291,7 @@
         }
     }
     [self _showPositionOfItem:mediaFile];
+    self.folderIconView.hidden = YES;
 }
 
 - (void)_showPositionOfItem:(MLFile *)mediaItem