Procházet zdrojové kódy

Server browsing UI improvements: - allow only two lines of text for media items. - enable truncate end for titles - put file size into brackets instead of duration - slightly increase text labels when cell is focused

Felix Paul Kühne před 9 roky
rodič
revize
c1f8c289e9

+ 9 - 0
Apple-TV/VLCRemoteBrowsingTVCell.m

@@ -103,4 +103,13 @@ NSString *const VLCRemoteBrowsingTVCellIdentifier = @"VLCRemoteBrowsingTVCell";
     return self.subtitleLabel.text;
 }
 
+- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
+{
+    [coordinator addCoordinatedAnimations:^{
+        CGAffineTransform transform = context.nextFocusedView != self ? CGAffineTransformIdentity : CGAffineTransformMakeScale(1.1, 1.1);
+        self.titleLabel.transform = transform;
+        self.subtitleLabel.transform = transform;
+    } completion:nil];
+}
+
 @end

+ 2 - 2
Apple-TV/VLCRemoteBrowsingTVCell.xib

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder.AppleTV.XIB" version="3.0" toolsVersion="9060" systemVersion="15C40a" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder.AppleTV.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
         <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
         <capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
@@ -14,7 +14,7 @@
                 <rect key="frame" x="0.0" y="0.0" width="308" height="308"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
-                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h3U-B3-AOa">
+                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h3U-B3-AOa">
                         <rect key="frame" x="8" y="206" width="292" height="30"/>
                         <animations/>
                         <fontDescription key="fontDescription" style="UICTFontTextStyleCaption1"/>

+ 1 - 1
SharedSources/ServerBrowsing/VLCServerBrowsingController.m

@@ -88,7 +88,7 @@
 
         NSString *subtitle = nil;
         if (sizeString && duration) {
-            subtitle = [NSString stringWithFormat:@"%@ (%@)",sizeString, duration];
+            subtitle = [NSString stringWithFormat:@"%@ (%@)",duration, sizeString];
         } else if (sizeString) {
             subtitle = sizeString;
         } else if (duration) {