浏览代码

cloud / open network: appearance fixes

Felix Paul Kühne 9 年之前
父节点
当前提交
de89163bda

二进制
Resources/en.lproj/Localizable.strings


+ 0 - 1
VLC for Apple TV/VLCCloudServicesTVViewController.xib

@@ -44,7 +44,6 @@
                     </connections>
                 </button>
             </subviews>
-            <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
             <constraints>
                 <constraint firstItem="uaI-5Z-SJq" firstAttribute="top" secondItem="hdP-Dp-Mn0" secondAttribute="bottom" constant="30" id="0Pp-jT-hyL"/>
                 <constraint firstItem="gFm-4V-QFs" firstAttribute="top" secondItem="HPy-k8-PTt" secondAttribute="bottom" constant="30" id="6Ds-Dz-j0d"/>

+ 0 - 1
VLC for Apple TV/VLCOpenNetworkStreamTVViewController.h

@@ -14,7 +14,6 @@
 @interface VLCOpenNetworkStreamTVViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
 
 @property (readwrite, nonatomic, weak) IBOutlet UILabel *titleLabel;
-@property (readwrite, nonatomic, weak) IBOutlet UILabel *noURLsToShowLabel;
 @property (readwrite, nonatomic, weak) IBOutlet UITextField *playURLField;
 @property (readwrite, nonatomic, weak) IBOutlet UITableView *previouslyPlayedStreamsTableView;
 

+ 31 - 2
VLC for Apple TV/VLCOpenNetworkStreamTVViewController.m

@@ -17,6 +17,7 @@
 @interface VLCOpenNetworkStreamTVViewController ()
 {
     NSMutableArray *_recentURLs;
+    UILabel *_noURLsToShowLabel;
 }
 @end
 
@@ -30,6 +31,32 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
 
+    _noURLsToShowLabel = [[UILabel alloc] init];
+    _noURLsToShowLabel.text = NSLocalizedString(@"NO_RECENT_STREAMS", nil);
+    _noURLsToShowLabel.textAlignment = NSTextAlignmentCenter;
+    _noURLsToShowLabel.textColor = [UIColor VLCLightTextColor];
+    _noURLsToShowLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleTitle3];
+    [_noURLsToShowLabel sizeToFit];
+    [_noURLsToShowLabel setTranslatesAutoresizingMaskIntoConstraints:NO];
+    [self.view addSubview:_noURLsToShowLabel];
+
+    NSLayoutConstraint *yConstraint = [NSLayoutConstraint constraintWithItem:_noURLsToShowLabel
+                                                                   attribute:NSLayoutAttributeCenterY
+                                                                   relatedBy:NSLayoutRelationEqual
+                                                                      toItem:self.view
+                                                                   attribute:NSLayoutAttributeCenterY
+                                                                  multiplier:1.0
+                                                                    constant:0.0];
+    [self.view addConstraint:yConstraint];
+    NSLayoutConstraint *xConstraint = [NSLayoutConstraint constraintWithItem:_noURLsToShowLabel
+                                                                   attribute:NSLayoutAttributeCenterX
+                                                                   relatedBy:NSLayoutRelationEqual
+                                                                      toItem:self.view
+                                                                   attribute:NSLayoutAttributeCenterX
+                                                                  multiplier:1.0
+                                                                    constant:0.0];
+    [self.view addConstraint:xConstraint];
+
     NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
     [notificationCenter addObserver:self
                            selector:@selector(ubiquitousKeyValueStoreDidChange:)
@@ -42,12 +69,14 @@
 
     /* fetch data from cloud */
     _recentURLs = [NSMutableArray arrayWithArray:[[NSUbiquitousKeyValueStore defaultStore] arrayForKey:kVLCRecentURLs]];
+#ifndef NDEBUG
     if (_recentURLs.count == 0) {
         [_recentURLs addObject:@"http://streams.videolan.org/streams/mp4/Mr_MrsSmith-h264_aac.mp4"];
         [_recentURLs addObject:@"http://streams.videolan.org/streams/mp4/Mr&MrsSmith.txt"];
     }
+#endif
     [self.previouslyPlayedStreamsTableView reloadData];
-    self.noURLsToShowLabel.hidden = _recentURLs.count != 0;
+    _noURLsToShowLabel.hidden = _recentURLs.count != 0;
     self.playURLField.placeholder = NSLocalizedString(@"ENTER_URL", nil);
 }
 
@@ -56,7 +85,7 @@
     /* TODO: don't blindly trust that the Cloud knows best */
     _recentURLs = [NSMutableArray arrayWithArray:[[NSUbiquitousKeyValueStore defaultStore] arrayForKey:kVLCRecentURLs]];
     [self.previouslyPlayedStreamsTableView reloadData];
-    self.noURLsToShowLabel.hidden = _recentURLs.count != 0;
+    _noURLsToShowLabel.hidden = _recentURLs.count != 0;
 }
 
 - (void)viewWillDisappear:(BOOL)animated

+ 0 - 10
VLC for Apple TV/VLCOpenNetworkStreamTVViewController.xib

@@ -6,7 +6,6 @@
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCOpenNetworkStreamTVViewController">
             <connections>
-                <outlet property="noURLsToShowLabel" destination="9hs-BK-cVI" id="jpj-cD-PRW"/>
                 <outlet property="playURLField" destination="dWa-3n-YCa" id="Eoe-vT-AuM"/>
                 <outlet property="preferredFocusedView" destination="dWa-3n-YCa" id="0Ez-4Z-KFF"/>
                 <outlet property="previouslyPlayedStreamsTableView" destination="v0o-s0-Xaz" id="I1r-ie-lFf"/>
@@ -42,19 +41,10 @@
                         <outlet property="delegate" destination="-1" id="osW-Kv-1VK"/>
                     </connections>
                 </tableView>
-                <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No recently played streams" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9hs-BK-cVI">
-                    <rect key="frame" x="662" y="510" width="596" height="60"/>
-                    <fontDescription key="fontDescription" type="system" pointSize="50"/>
-                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
-                    <nil key="highlightedColor"/>
-                </label>
             </subviews>
-            <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
             <constraints>
-                <constraint firstItem="9hs-BK-cVI" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="WOA-cL-SLX"/>
                 <constraint firstItem="v0o-s0-Xaz" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="elq-bO-Tb3"/>
                 <constraint firstItem="v0o-s0-Xaz" firstAttribute="top" secondItem="dWa-3n-YCa" secondAttribute="bottom" constant="70" id="jCe-Gz-82c"/>
-                <constraint firstItem="9hs-BK-cVI" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="n8b-cY-wQE"/>
                 <constraint firstItem="dWa-3n-YCa" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="oFS-xp-QJo"/>
                 <constraint firstAttribute="bottom" secondItem="v0o-s0-Xaz" secondAttribute="bottom" constant="70" id="ydf-eT-5UK"/>
             </constraints>