فهرست منبع

library: hack a first proper draft for the iOS 7 library design

This needs clean-up if we decide to keep the iOS 6 UI around
Felix Paul Kühne 11 سال پیش
والد
کامیت
aa04172a3d

+ 1 - 1
AspenProject/VLCPlaylistTableViewCell.h

@@ -17,7 +17,7 @@
 @property (nonatomic, strong) IBOutlet UILabel *subtitleLabel;
 @property (nonatomic, strong) IBOutlet UIImageView *thumbnailView;
 @property (nonatomic, strong) IBOutlet VLCLinearProgressIndicator *progressIndicator;
-@property (nonatomic, strong) IBOutlet UIImageView *mediaIsUnreadView;
+@property (nonatomic, strong) IBOutlet UIView *mediaIsUnreadView;
 @property (nonatomic, strong) IBOutlet UILabel *artistNameLabel;
 @property (nonatomic, strong) IBOutlet UILabel *albumNameLabel;
 

+ 37 - 15
AspenProject/VLCPlaylistTableViewCell.m

@@ -133,24 +133,32 @@
 - (void)configureForShow:(MLShow *)show
 {
     self.titleLabel.text = show.name;
-    self.artistNameLabel.text = @"";
-    self.albumNameLabel.text = show.releaseYear;
     NSUInteger count = show.episodes.count;
-    self.subtitleLabel.text = [NSString stringWithFormat:(count > 1) ? NSLocalizedString(@"LIBRARY_EPISODES", @"") : NSLocalizedString(@"LIBRARY_SINGLE_EPISODE", @""), count, show.unreadEpisodes.count];
+    if (SYSTEM_RUNS_IN_THE_FUTURE) {
+        self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %@", show.releaseYear, [NSString stringWithFormat:(count > 1) ? NSLocalizedString(@"LIBRARY_EPISODES", @"") : NSLocalizedString(@"LIBRARY_SINGLE_EPISODE", @""), count, show.unreadEpisodes.count]];
+    } else {
+        self.artistNameLabel.text = @"";
+        self.albumNameLabel.text = show.releaseYear;
+        self.subtitleLabel.text = [NSString stringWithFormat:(count > 1) ? NSLocalizedString(@"LIBRARY_EPISODES", @"") : NSLocalizedString(@"LIBRARY_SINGLE_EPISODE", @""), count, show.unreadEpisodes.count];
+    }
     self.mediaIsUnreadView.hidden = YES;
     self.progressIndicator.hidden = YES;
 }
 
 - (void)configureForAlbumTrack:(MLAlbumTrack *)albumTrack
 {
-    self.artistNameLabel.text = albumTrack.artist;
-    self.albumNameLabel.text = [NSString stringWithFormat:NSLocalizedString(@"LIBRARY_TRACK_N", @""), albumTrack.trackNumber.intValue];
+    MLFile *anyFileFromTrack = albumTrack.files.anyObject;
+
+    if (SYSTEM_RUNS_IN_THE_FUTURE)
+        self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %@ — %@", albumTrack.artist, [NSString stringWithFormat:NSLocalizedString(@"LIBRARY_TRACK_N", @""), albumTrack.trackNumber.intValue], [VLCTime timeWithNumber:[anyFileFromTrack duration]]];
+    else {
+        self.artistNameLabel.text = albumTrack.artist;
+        self.albumNameLabel.text = [NSString stringWithFormat:NSLocalizedString(@"LIBRARY_TRACK_N", @""), albumTrack.trackNumber.intValue];
+        self.subtitleLabel.text = [NSString stringWithFormat:@"%@", [VLCTime timeWithNumber:[anyFileFromTrack duration]]];
+    }
     self.titleLabel.text = albumTrack.title;
     self.thumbnailView.image = nil;
 
-    MLFile *anyFileFromTrack = albumTrack.files.anyObject;
-    self.subtitleLabel.text = [NSString stringWithFormat:@"%@", [VLCTime timeWithNumber:[anyFileFromTrack duration]]];
-
     CGFloat position = anyFileFromTrack.lastPosition.floatValue;
     self.progressIndicator.progress = position;
     self.progressIndicator.hidden = ((position < .1f) || (position > .95f)) ? YES : NO;
@@ -180,11 +188,21 @@
 {
     self.titleLabel.text = album.name;
     MLAlbumTrack *anyTrack = [album.tracks anyObject];
-    self.artistNameLabel.text = anyTrack? anyTrack.artist: @"";
-    self.albumNameLabel.text = album.releaseYear;
-    self.thumbnailView.image = nil;
     NSUInteger count = album.tracks.count;
-    self.subtitleLabel.text = [NSString stringWithFormat:(count > 1) ? NSLocalizedString(@"LIBRARY_TRACKS", @"") : NSLocalizedString(@"LIBRARY_SINGLE_TRACK", @""), count];
+    if (SYSTEM_RUNS_IN_THE_FUTURE) {
+        NSMutableString *string = [[NSMutableString alloc] init];
+        if (anyTrack) {
+            [string appendString:anyTrack.artist];
+            [string appendString:@" — "];
+        }
+        [string appendFormat:@"%@ — %@", [NSString stringWithFormat:(count > 1) ? NSLocalizedString(@"LIBRARY_TRACKS", @"") : NSLocalizedString(@"LIBRARY_SINGLE_TRACK", @""), count], album.releaseYear];
+        self.subtitleLabel.text = string;
+    } else {
+        self.artistNameLabel.text = anyTrack? anyTrack.artist: @"";
+        self.albumNameLabel.text = album.releaseYear;
+        self.subtitleLabel.text = [NSString stringWithFormat:(count > 1) ? NSLocalizedString(@"LIBRARY_TRACKS", @"") : NSLocalizedString(@"LIBRARY_SINGLE_TRACK", @""), count];
+    }
+    self.thumbnailView.image = nil;
     self.mediaIsUnreadView.hidden = YES;
     self.progressIndicator.hidden = YES;
 }
@@ -192,9 +210,13 @@
 - (void)configureForMLFile:(MLFile *)mediaFile
 {
     if (mediaFile.isAlbumTrack) {
-        self.artistNameLabel.text = mediaFile.albumTrack.artist;
-        self.albumNameLabel.text = mediaFile.albumTrack.album.name;
-        self.titleLabel.text = (mediaFile.albumTrack.title.length > 1) ? mediaFile.albumTrack.title : mediaFile.title;
+        if (SYSTEM_RUNS_IN_THE_FUTURE) {
+            self.titleLabel.text = [NSString stringWithFormat:@"%@ — %@ — %@", mediaFile.albumTrack.artist, mediaFile.albumTrack.album.name, (mediaFile.albumTrack.title.length > 1) ? mediaFile.albumTrack.title : mediaFile.title];
+        } else {
+            self.artistNameLabel.text = mediaFile.albumTrack.artist;
+            self.albumNameLabel.text = mediaFile.albumTrack.album.name;
+            self.titleLabel.text = (mediaFile.albumTrack.title.length > 1) ? mediaFile.albumTrack.title : mediaFile.title;
+        }
         self.thumbnailView.image = nil;
     } else
         self.titleLabel.text = mediaFile.title;

+ 26 - 46
Resources/VLCFuturePlaylistTableViewCell.xib

@@ -8,71 +8,51 @@
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="10" reuseIdentifier="PlaylistCell" rowHeight="191" id="3" customClass="VLCPlaylistTableViewCell">
-            <rect key="frame" x="0.0" y="0.0" width="320" height="180"/>
+            <rect key="frame" x="0.0" y="0.0" width="320" height="90"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="3" id="pEL-yt-P8r">
-                <rect key="frame" x="0.0" y="0.0" width="320" height="179"/>
+                <rect key="frame" x="0.0" y="0.0" width="320" height="89"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" id="4">
-                        <rect key="frame" x="0.0" y="0.0" width="320" height="180"/>
+                    <imageView userInteractionEnabled="NO" contentMode="center" image="thumbOverlayPhone.png" id="22">
+                        <rect key="frame" x="0.0" y="0.0" width="330" height="90"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                     </imageView>
-                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Album Name" textAlignment="center" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" minimumFontSize="10" adjustsLetterSpacingToFitWidth="YES" id="30">
-                        <rect key="frame" x="14" y="90" width="296" height="15"/>
-                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
-                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
-                        <color key="textColor" white="0.71999999999999997" alpha="1" colorSpace="calibratedWhite"/>
+                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="gradient-cell-ios7.png" id="4">
+                        <rect key="frame" x="0.0" y="0.0" width="320" height="90"/>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                    </imageView>
+                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Title" lineBreakMode="wordWrap" baselineAdjustment="none" minimumFontSize="9" adjustsLetterSpacingToFitWidth="YES" id="6">
+                        <rect key="frame" x="7" y="46" width="305" height="21"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                        <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                         <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                     </label>
-                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Artist Name" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="2" baselineAdjustment="none" minimumFontSize="9" adjustsLetterSpacingToFitWidth="YES" id="35">
-                        <rect key="frame" x="12" y="55" width="296" height="42"/>
+                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="New" textAlignment="right" lineBreakMode="wordWrap" baselineAdjustment="none" minimumFontSize="9" adjustsLetterSpacingToFitWidth="YES" id="sYw-l2-Tmv">
+                        <rect key="frame" x="265" y="61" width="50" height="26"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
-                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                         <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                     </label>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="thumbOverlayPhone.png" id="22">
-                        <rect key="frame" x="-5" y="-16" width="330" height="200"/>
-                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                    </imageView>
-                    <view alpha="0.80000001192092896" contentMode="scaleToFill" id="A7c-Nf-1lL">
-                        <rect key="frame" x="0.0" y="139" width="320" height="43"/>
-                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                        <subviews>
-                            <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Title" lineBreakMode="wordWrap" baselineAdjustment="none" minimumFontSize="9" adjustsLetterSpacingToFitWidth="YES" id="6">
-                                <rect key="frame" x="7" y="0.0" width="305" height="26"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
-                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                                <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                            </label>
-                            <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Subtitle — Subtitle" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="7">
-                                <rect key="frame" x="7" y="22" width="305" height="15"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
-                                <fontDescription key="fontDescription" type="system" pointSize="12"/>
-                                <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                                <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                            </label>
-                        </subviews>
-                        <color key="backgroundColor" red="0.74659199620000005" green="0.74659199620000005" blue="0.74659199620000005" alpha="1" colorSpace="calibratedRGB"/>
-                    </view>
-                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="badgeUnread.png" id="20">
-                        <rect key="frame" x="290" y="0.0" width="31" height="31"/>
-                        <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
-                    </imageView>
                     <view userInteractionEnabled="NO" contentMode="scaleToFill" id="27" customClass="VLCLinearProgressIndicator">
-                        <rect key="frame" x="0.0" y="125" width="320" height="10"/>
+                        <rect key="frame" x="-1" y="48" width="320" height="10"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                     </view>
+                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Subtitle — Subtitle" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="7">
+                        <rect key="frame" x="7" y="66" width="305" height="15"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+                        <fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="12"/>
+                        <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    </label>
                 </subviews>
             </tableViewCellContentView>
             <color key="backgroundColor" white="0.12" alpha="1" colorSpace="calibratedWhite"/>
             <connections>
-                <outlet property="albumNameLabel" destination="30" id="31"/>
-                <outlet property="artistNameLabel" destination="35" id="36"/>
-                <outlet property="mediaIsUnreadView" destination="20" id="21"/>
+                <outlet property="mediaIsUnreadView" destination="sYw-l2-Tmv" id="us6-sJ-NVp"/>
                 <outlet property="progressIndicator" destination="27" id="28"/>
                 <outlet property="subtitleLabel" destination="7" id="8"/>
                 <outlet property="thumbnailView" destination="4" id="9"/>
@@ -81,7 +61,7 @@
         </tableViewCell>
     </objects>
     <resources>
-        <image name="badgeUnread.png" width="35" height="35"/>
+        <image name="gradient-cell-ios7.png" width="1" height="90"/>
         <image name="thumbOverlayPhone.png" width="129" height="75"/>
     </resources>
 </document>

+ 8 - 0
VLC for iOS.xcodeproj/project.pbxproj

@@ -103,6 +103,8 @@
 		7D1AC30D17629D4600BD2EB5 /* title@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D1AC30B17629D4600BD2EB5 /* title@2x.png */; };
 		7D2339AF176DE72E008D223C /* VLCOpenNetworkStreamViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D2339AD176DE72E008D223C /* VLCOpenNetworkStreamViewController.m */; };
 		7D2339B0176DE72E008D223C /* VLCOpenNetworkStreamViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D2339AE176DE72E008D223C /* VLCOpenNetworkStreamViewController.xib */; };
+		7D2A34A41805CDBA004078AA /* gradient-cell-ios7.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D2A34A21805CDBA004078AA /* gradient-cell-ios7.png */; };
+		7D2A34A51805CDBA004078AA /* gradient-cell-ios7@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D2A34A31805CDBA004078AA /* gradient-cell-ios7@2x.png */; };
 		7D31001D17B64AE100E6516D /* GHRevealViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D31001C17B64AE100E6516D /* GHRevealViewController.m */; };
 		7D31002017B6768B00E6516D /* libupnpx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D31001F17B6768B00E6516D /* libupnpx.a */; };
 		7D31CF091746AF09005997E0 /* VLCStatusLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D31CF081746AF09005997E0 /* VLCStatusLabel.m */; };
@@ -474,6 +476,8 @@
 		7D2339AC176DE72E008D223C /* VLCOpenNetworkStreamViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCOpenNetworkStreamViewController.h; sourceTree = "<group>"; };
 		7D2339AD176DE72E008D223C /* VLCOpenNetworkStreamViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCOpenNetworkStreamViewController.m; sourceTree = "<group>"; };
 		7D2339AE176DE72E008D223C /* VLCOpenNetworkStreamViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = VLCOpenNetworkStreamViewController.xib; path = ../Resources/VLCOpenNetworkStreamViewController.xib; sourceTree = "<group>"; };
+		7D2A34A21805CDBA004078AA /* gradient-cell-ios7.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "gradient-cell-ios7.png"; sourceTree = "<group>"; };
+		7D2A34A31805CDBA004078AA /* gradient-cell-ios7@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "gradient-cell-ios7@2x.png"; sourceTree = "<group>"; };
 		7D2AEDE017FB775900B5281E /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = "<group>"; };
 		7D2AEDE117FB775900B5281E /* sv */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = sv; path = "sv.lproj/badgeUnread@2x~ipad.png"; sourceTree = "<group>"; };
 		7D2AEDE217FB775900B5281E /* sv */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = sv; path = "sv.lproj/badgeUnread@2x~iphone.png"; sourceTree = "<group>"; };
@@ -1067,6 +1071,8 @@
 		7D10BC661743F9AC00DA7059 /* Library View */ = {
 			isa = PBXGroup;
 			children = (
+				7D2A34A21805CDBA004078AA /* gradient-cell-ios7.png */,
+				7D2A34A31805CDBA004078AA /* gradient-cell-ios7@2x.png */,
 				A7990063176E9352009E8267 /* libraryBackground.png */,
 				7D1AC30A17629D4600BD2EB5 /* title.png */,
 				7D1AC30B17629D4600BD2EB5 /* title@2x.png */,
@@ -1830,6 +1836,7 @@
 				A79246A8170F0ED20036AAF2 /* Default.png in Resources */,
 				A79246A9170F0ED20036AAF2 /* Default@2x.png in Resources */,
 				A79246C1170F114E0036AAF2 /* VLCEmptyLibraryView~ipad.xib in Resources */,
+				7D2A34A51805CDBA004078AA /* gradient-cell-ios7@2x.png in Resources */,
 				A79246C2170F114E0036AAF2 /* VLCMovieViewController~iphone.xib in Resources */,
 				A79246C3170F114E0036AAF2 /* VLCPlaylistTableViewCell.xib in Resources */,
 				A79246C5170F114E0036AAF2 /* VLCEmptyLibraryView~iphone.xib in Resources */,
@@ -1969,6 +1976,7 @@
 				7DB43836176E20CC00F460EE /* VLCDownloadViewController.xib in Resources */,
 				A7990064176E9352009E8267 /* libraryBackground.png in Resources */,
 				7DD2A3A9179C04A7003EB537 /* OpenSans-Regular.ttf in Resources */,
+				7D2A34A41805CDBA004078AA /* gradient-cell-ios7.png in Resources */,
 				7D93044817B687C90054EAC6 /* VLCLocalNetworkListCell~ipad.xib in Resources */,
 				7D93044917B687C90054EAC6 /* VLCLocalNetworkListCell~iphone.xib in Resources */,
 				7D93045B17B6ACCF0054EAC6 /* VLCWiFiUploadTableViewCell.xib in Resources */,