Skip to content

Commit 4d52ee8

Browse files
committed
Directly use noFoundLabel instead of a view
Instead of placing the UILabel within a UIView and setting alpha for the view, we can directly use the UILabel for this.
1 parent 1b14c97 commit 4d52ee8

File tree

6 files changed

+31
-45
lines changed

6 files changed

+31
-45
lines changed

XBMC Remote/DetailViewController.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
NSString *defaultThumb;
4545
int cellHeight;
4646
int thumbWidth;
47-
IBOutlet UIView *noFoundView;
47+
IBOutlet UILabel *noFoundLabel;
4848
int viewWidth;
4949
IBOutlet UIView *maskView;
5050
MoreItemsViewController *moreItemsViewController;
@@ -96,7 +96,6 @@
9696
NSDateFormatter *xbmcDateFormatter;
9797
NSDateFormatter *localHourMinuteFormatter;
9898
NSIndexPath *autoScrollTable;
99-
__weak IBOutlet UILabel *noItemsLabel;
10099
BOOL stackscrollFullscreen;
101100
BOOL forceCollection;
102101
NSMutableDictionary *storeSections;

XBMC Remote/DetailViewController.m

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ - (void)showMore {
10271027
self.indexView.hidden = YES;
10281028
button6.hidden = YES;
10291029
button7.hidden = YES;
1030-
[Utilities alphaView:noFoundView AnimDuration:0.2 Alpha:0.0];
1030+
[Utilities alphaView:noFoundLabel AnimDuration:0.2 Alpha:0.0];
10311031
[activityIndicatorView startAnimating];
10321032
NSArray *buttonsIB = @[button1, button2, button3, button4, button5];
10331033
if (chosenTab < buttonsIB.count) {
@@ -4738,7 +4738,7 @@ - (void)retrieveData:(NSString*)methodToCall parameters:(NSDictionary*)parameter
47384738
return;
47394739
}
47404740

4741-
[Utilities alphaView:noFoundView AnimDuration:0.2 Alpha:0.0];
4741+
[Utilities alphaView:noFoundLabel AnimDuration:0.2 Alpha:0.0];
47424742
elapsedTime = 0;
47434743
startTime = [NSDate timeIntervalSinceReferenceDate];
47444744
countExecutionTime = [NSTimer scheduledTimerWithTimeInterval:WARNING_TIMEOUT target:self selector:@selector(checkExecutionTime) userInfo:nil repeats:YES];
@@ -4962,7 +4962,7 @@ - (void)saveAndShowResultsRefresh:(BOOL)forceRefresh params:(NSMutableDictionary
49624962
}
49634963

49644964
- (void)animateNoResultsFound {
4965-
[Utilities alphaView:noFoundView AnimDuration:0.2 Alpha:1.0];
4965+
[Utilities alphaView:noFoundLabel AnimDuration:0.2 Alpha:1.0];
49664966
[activityIndicatorView stopAnimating];
49674967
[activeLayoutView.pullToRefreshView stopAnimating];
49684968
[self setGridListButtonImage:enableCollectionView];
@@ -5298,10 +5298,10 @@ - (void)displayData {
52985298
[self setFilternameLabel:labelText];
52995299

53005300
if (!self.richResults.count) {
5301-
[Utilities alphaView:noFoundView AnimDuration:0.2 Alpha:1.0];
5301+
[Utilities alphaView:noFoundLabel AnimDuration:0.2 Alpha:1.0];
53025302
}
53035303
else {
5304-
[Utilities alphaView:noFoundView AnimDuration:0.2 Alpha:0.0];
5304+
[Utilities alphaView:noFoundLabel AnimDuration:0.2 Alpha:0.0];
53055305
}
53065306
NSDictionary *itemSizes = parameters[@"itemSizes"];
53075307
if (IS_IPHONE) {
@@ -5794,7 +5794,9 @@ - (void)viewDidLoad {
57945794
epgCachePath = AppDelegate.instance.epgCachePath;
57955795
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
57965796
hiddenLabel = [userDefaults boolForKey:@"hidden_label_preference"];
5797-
noItemsLabel.text = LOCALIZED_STR(@"No items found.");
5797+
noFoundLabel.text = LOCALIZED_STR(@"No items found.");
5798+
noFoundLabel.adjustsFontSizeToFitWidth = YES;
5799+
noFoundLabel.minimumScaleFactor = FONT_SCALING_MIN;
57985800
loadAndPresentDataOnViewDidAppear = YES;
57995801
sectionHeight = LIST_SECTION_HEADER_HEIGHT;
58005802
epglockqueue = dispatch_queue_create("com.epg.arrayupdate", DISPATCH_QUEUE_SERIAL);

XBMC Remote/DetailViewController.xib

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
<outlet property="buttonsViewEffect" destination="nls-7E-rmj" id="bzY-fZ-idY"/>
2323
<outlet property="dataList" destination="37" id="93"/>
2424
<outlet property="maskView" destination="siR-Fa-xLM" id="cez-Ud-wvD"/>
25-
<outlet property="noFoundView" destination="135" id="140"/>
26-
<outlet property="noItemsLabel" destination="136" id="4WA-ed-7Pa"/>
25+
<outlet property="noFoundLabel" destination="136" id="d2d-uY-3DK"/>
2726
<outlet property="view" destination="156" id="157"/>
2827
</connections>
2928
</placeholder>
@@ -40,20 +39,13 @@
4039
<rect key="frame" x="0.0" y="0.0" width="320" height="416"/>
4140
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
4241
</imageView>
43-
<view alpha="0.0" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="135" userLabel="NoFound View">
44-
<rect key="frame" x="35" y="105" width="250" height="42"/>
42+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" fixedFrame="YES" text="No items found." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="136">
43+
<rect key="frame" x="85" y="106" width="150" height="42"/>
4544
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
46-
<subviews>
47-
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" fixedFrame="YES" text="No items found." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="136">
48-
<rect key="frame" x="50" y="1" width="150" height="40"/>
49-
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
50-
<fontDescription key="fontDescription" type="system" pointSize="17"/>
51-
<color key="textColor" red="0.84919595718383789" green="0.84919595718383789" blue="0.84919595718383789" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
52-
<nil key="highlightedColor"/>
53-
</label>
54-
</subviews>
55-
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
56-
</view>
45+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
46+
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
47+
<nil key="highlightedColor"/>
48+
</label>
5749
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" indicatorStyle="black" style="plain" separatorStyle="default" rowHeight="76" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="37">
5850
<rect key="frame" x="0.0" y="0.0" width="320" height="416"/>
5951
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>

XBMC Remote/NowPlaying.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
IBOutlet UIButton *editTableButton;
5353
IBOutlet UIButton *PartyModeButton;
5454
IBOutlet UIImageView *backgroundImageView;
55-
IBOutlet UIView *noFoundView;
55+
IBOutlet UILabel *noFoundLabel;
5656
NSIndexPath *storeSelection;
5757
IBOutlet UIView *playlistToolbarView;
5858
IBOutlet UIView *playlistActionView;
@@ -79,7 +79,6 @@
7979
__weak IBOutlet UILabel *scrabbingRate;
8080
UIView *toolbarBackground;
8181
UISegmentedControl *playlistSegmentedControl;
82-
__weak IBOutlet UILabel *noItemsLabel;
8382
NSString *storeLiveTVTitle;
8483
NSString *storeClearlogo;
8584
NSString *storeClearart;

XBMC Remote/NowPlaying.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ - (void)createPlaylistAnimated:(BOOL)animTable {
11521152
[Utilities AnimView:PartyModeButton AnimDuration:0.3 Alpha:0.0 XPos:-PartyModeButton.frame.size.width];
11531153
}
11541154
editTableButton.hidden = currentPlaylistID == PLAYERID_PICTURES;
1155-
[Utilities alphaView:noFoundView AnimDuration:0.2 Alpha:0.0];
1155+
[Utilities alphaView:noFoundLabel AnimDuration:0.2 Alpha:0.0];
11561156
[[Utilities getJsonRPC] callMethod:@"Playlist.GetItems"
11571157
withParameters:@{@"properties": @[@"thumbnail",
11581158
@"duration",
@@ -1176,12 +1176,12 @@ - (void)createPlaylistAnimated:(BOOL)animTable {
11761176
if ([methodResult isKindOfClass:[NSDictionary class]]) {
11771177
NSArray *playlistItems = methodResult[@"items"];
11781178
if (playlistItems.count == 0) {
1179-
[Utilities alphaView:noFoundView AnimDuration:0.2 Alpha:1.0];
1179+
[Utilities alphaView:noFoundLabel AnimDuration:0.2 Alpha:1.0];
11801180
editTableButton.enabled = NO;
11811181
editTableButton.selected = NO;
11821182
}
11831183
else {
1184-
[Utilities alphaView:noFoundView AnimDuration:0.2 Alpha:0.0];
1184+
[Utilities alphaView:noFoundLabel AnimDuration:0.2 Alpha:0.0];
11851185
editTableButton.enabled = YES;
11861186
}
11871187
NSString *serverURL = [Utilities getImageServerURL];
@@ -1264,7 +1264,7 @@ - (void)deselectPlaylistItem {
12641264

12651265
- (void)showPlaylistTableAnimated:(BOOL)animated {
12661266
if (playlistData.count == 0) {
1267-
[Utilities alphaView:noFoundView AnimDuration:0.2 Alpha:1.0];
1267+
[Utilities alphaView:noFoundLabel AnimDuration:0.2 Alpha:1.0];
12681268
[playlistTableView reloadData];
12691269
}
12701270
else {
@@ -2755,7 +2755,9 @@ - (void)viewDidLoad {
27552755
[editTableButton setTitle:LOCALIZED_STR(@"Done") forState:UIControlStateSelected];
27562756
editTableButton.titleLabel.numberOfLines = 1;
27572757
editTableButton.titleLabel.adjustsFontSizeToFitWidth = YES;
2758-
noItemsLabel.text = LOCALIZED_STR(@"No items found.");
2758+
noFoundLabel.text = LOCALIZED_STR(@"No items found.");
2759+
noFoundLabel.adjustsFontSizeToFitWidth = YES;
2760+
noFoundLabel.minimumScaleFactor = FONT_SCALING_MIN;
27592761
[self addSegmentControl];
27602762
bottomPadding = [Utilities getBottomPadding];
27612763
[self setToolbar];

XBMC Remote/NowPlaying.xib

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
<outlet property="itemDescription" destination="HhJ-Ci-xP8" id="t3u-u4-cjL"/>
2626
<outlet property="itemLogoImage" destination="gWQ-ZF-P81" id="JWW-p8-1uX"/>
2727
<outlet property="jewelView" destination="4" id="57"/>
28-
<outlet property="noFoundView" destination="132" id="135"/>
29-
<outlet property="noItemsLabel" destination="134" id="POg-db-XEJ"/>
28+
<outlet property="noFoundLabel" destination="134" id="cWH-OB-YZ6"/>
3029
<outlet property="nowPlayingView" destination="92" id="95"/>
3130
<outlet property="playlistActionView" destination="128" id="149"/>
3231
<outlet property="playlistButton" destination="Z3l-yA-EDD" id="k08-dq-wTJ"/>
@@ -72,20 +71,13 @@
7271
<rect key="frame" x="0.0" y="0.0" width="320" height="372"/>
7372
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
7473
<subviews>
75-
<view alpha="0.0" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="132" userLabel="NoFound View">
76-
<rect key="frame" x="35" y="7" width="250" height="42"/>
74+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" fixedFrame="YES" text="No items found." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="134">
75+
<rect key="frame" x="85" y="8" width="150" height="42"/>
7776
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
78-
<subviews>
79-
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" fixedFrame="YES" text="No items found." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" minimumScaleFactor="0.80000000000000004" translatesAutoresizingMaskIntoConstraints="NO" id="134">
80-
<rect key="frame" x="50" y="1" width="150" height="40"/>
81-
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
82-
<fontDescription key="fontDescription" type="system" pointSize="17"/>
83-
<color key="textColor" red="0.84919595718383789" green="0.84919595718383789" blue="0.84919595718383789" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
84-
<nil key="highlightedColor"/>
85-
</label>
86-
</subviews>
87-
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
88-
</view>
77+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
78+
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
79+
<nil key="highlightedColor"/>
80+
</label>
8981
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="53" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="100">
9082
<rect key="frame" x="0.0" y="0.0" width="320" height="372"/>
9183
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>

0 commit comments

Comments
 (0)