Ver código fonte

browsing cell layout fixes

Tobias Conradi 9 anos atrás
pai
commit
82c0e28c3a

+ 1 - 1
SharedSources/ServerBrowsing/VLCServerBrowsingController.m

@@ -87,7 +87,7 @@
         } else if (duration) {
             subtitle = duration;
         }
-        cell.subtitle = sizeString;
+        cell.subtitle = subtitle;
 #if DOWNLOAD_SUPPORTED
         cell.isDownloadable = self.allowsFileDownload;
 #endif

+ 2 - 2
VLC for Apple TV/VLCLocalNetworkServerTVCell.xib

@@ -6,7 +6,7 @@
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" textLabel="KKl-d9-ruX" rowHeight="150" style="IBUITableViewCellStyleDefault" id="K9f-aR-apf" customClass="VLCLocalNetworkServerTVCell">
+        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationLevel="1" indentationWidth="10" textLabel="KKl-d9-ruX" rowHeight="150" style="IBUITableViewCellStyleDefault" id="K9f-aR-apf" customClass="VLCLocalNetworkServerTVCell">
             <rect key="frame" x="0.0" y="0.0" width="1920" height="150"/>
             <autoresizingMask key="autoresizingMask"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="K9f-aR-apf" id="EZR-E1-3S2">
@@ -14,7 +14,7 @@
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="KKl-d9-ruX">
-                        <rect key="frame" x="20" y="0.0" width="1864" height="150"/>
+                        <rect key="frame" x="30" y="0.0" width="1854" height="150"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                         <animations/>
                         <fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>

+ 12 - 0
VLC for Apple TV/VLCServerBrowsingTVCell.m

@@ -42,6 +42,18 @@ NSString *const VLCServerBrowsingTVCellIdentifier = @"VLCServerBrowsingTVCell";
     return self.subtitleLabel.text;
 }
 
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    [self prepareForReuse];
+}
+
+- (void)prepareForReuse {
+    [super prepareForReuse];
+    [self.thumbnailImageView cancelLoading];
+    self.title = nil;
+    self.subtitle = nil;
+}
+
 @end
 
 

+ 3 - 2
VLC for Apple TV/VLCServerBrowsingTVCell.xib

@@ -23,7 +23,7 @@
                         </constraints>
                     </imageView>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TIO-jK-60o" userLabel="TitleLabel">
-                        <rect key="frame" x="254" y="8" width="1658" height="46"/>
+                        <rect key="frame" x="254" y="52" width="1658" height="46"/>
                         <animations/>
                         <fontDescription key="fontDescription" style="UICTFontTextStyleHeadline"/>
                         <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@@ -41,8 +41,9 @@
                 <constraints>
                     <constraint firstItem="4q6-BG-uo0" firstAttribute="top" relation="greaterThanOrEqual" secondItem="TIO-jK-60o" secondAttribute="bottom" id="0Cw-Zg-YdT"/>
                     <constraint firstItem="4q6-BG-uo0" firstAttribute="leading" secondItem="Diw-kq-1Zk" secondAttribute="trailing" constant="8" symbolic="YES" id="4JT-bL-xgJ"/>
+                    <constraint firstItem="TIO-jK-60o" firstAttribute="centerY" secondItem="Ygk-DT-1Ta" secondAttribute="centerY" priority="250" id="6mH-XN-FhD"/>
                     <constraint firstAttribute="trailingMargin" secondItem="4q6-BG-uo0" secondAttribute="trailing" id="D8M-Ob-ojk"/>
-                    <constraint firstItem="TIO-jK-60o" firstAttribute="top" secondItem="Ygk-DT-1Ta" secondAttribute="topMargin" id="PdB-cs-3vU"/>
+                    <constraint firstItem="TIO-jK-60o" firstAttribute="top" relation="greaterThanOrEqual" secondItem="Ygk-DT-1Ta" secondAttribute="topMargin" id="PdB-cs-3vU"/>
                     <constraint firstItem="TIO-jK-60o" firstAttribute="leading" secondItem="Diw-kq-1Zk" secondAttribute="trailing" constant="8" symbolic="YES" id="Tbh-RC-OQm"/>
                     <constraint firstAttribute="bottomMargin" secondItem="Diw-kq-1Zk" secondAttribute="bottom" id="VIf-rD-KS8"/>
                     <constraint firstItem="Diw-kq-1Zk" firstAttribute="leading" secondItem="Ygk-DT-1Ta" secondAttribute="leadingMargin" id="Z1h-4m-nw8"/>