Просмотр исходного кода

iOS 7 library: drop the progress indicator and put the remaining time as text with the same rules

Felix Paul Kühne 11 лет назад
Родитель
Сommit
5d286f9859

+ 16 - 11
AspenProject/VLCPlaylistTableViewCell.m

@@ -29,13 +29,6 @@
     return cell;
 }
 
-- (void)awakeFromNib
-{
-    if (SYSTEM_RUNS_IN_THE_FUTURE) {
-        [(UILabel *)self.mediaIsUnreadView setText:[NSLocalizedString(@"NEW", @"") capitalizedStringWithLocale:[NSLocale currentLocale]]];
-    }
-}
-
 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
 {
     [self _updatedDisplayedInformationForKeyPath:keyPath];
@@ -241,10 +234,22 @@
     }
 
     CGFloat position = mediaFile.lastPosition.floatValue;
-    self.progressIndicator.progress = position;
-    self.progressIndicator.hidden = ((position < .1f) || (position > .95f)) ? YES : NO;
-    [self.progressIndicator setNeedsDisplay];
-    self.mediaIsUnreadView.hidden = !mediaFile.unread.intValue;
+
+    if (SYSTEM_RUNS_IN_THE_FUTURE) {
+        if (position > .1f && position < .95f) {
+            [(UITextView*)self.mediaIsUnreadView setText:[NSString stringWithFormat:NSLocalizedString(@"LIBRARY_MINUTES_LEFT", @""), [[VLCTime timeWithInt:(mediaFile.duration.floatValue * position)] minuteStringValue]]];
+            self.mediaIsUnreadView.hidden = NO;
+        } else if (mediaFile.unread.intValue) {
+            [(UILabel *)self.mediaIsUnreadView setText:[NSLocalizedString(@"NEW", @"") capitalizedStringWithLocale:[NSLocale currentLocale]]];
+            self.mediaIsUnreadView.hidden = NO;
+        } else
+            self.mediaIsUnreadView.hidden = YES;
+    } else {
+        self.progressIndicator.progress = position;
+        self.progressIndicator.hidden = ((position < .1f) || (position > .95f)) ? YES : NO;
+        [self.progressIndicator setNeedsDisplay];
+        self.mediaIsUnreadView.hidden = !mediaFile.unread.intValue;
+    }
 }
 
 @end

+ 1 - 1
Resources/VLCFuturePlaylistTableViewCell.xib

@@ -31,7 +31,7 @@
                         <size key="shadowOffset" width="0.0" height="0.0"/>
                     </label>
                     <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"/>
+                        <rect key="frame" x="222" y="61" width="93" height="26"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>

BIN
Resources/de.lproj/Localizable.strings


BIN
Resources/en.lproj/Localizable.strings


BIN
Resources/fr.lproj/Localizable.strings