Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
79ac9325
Commit
79ac9325
authored
Nov 25, 2015
by
Felix Paul Kühne
Browse files
Add a 'nothing found' label for folders we believe that are empty
parent
1a745c4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Apple-TV/VLCServerBrowsingTVViewController.m
View file @
79ac9325
...
...
@@ -17,6 +17,9 @@
#import "VLCMaskView.h"
@interface
VLCServerBrowsingTVViewController
()
{
UILabel
*
_nothingFoundLabel
;
}
@property
(
nonatomic
,
readonly
)
id
<
VLCNetworkServerBrowser
>
serverBrowser
;
@property
(
nonatomic
)
VLCServerBrowsingController
*
browsingController
;
@end
...
...
@@ -33,6 +36,32 @@
_browsingController
=
[[
VLCServerBrowsingController
alloc
]
initWithViewController
:
self
serverBrowser
:
serverBrowser
];
self
.
title
=
serverBrowser
.
title
;
_nothingFoundLabel
=
[[
UILabel
alloc
]
init
];
_nothingFoundLabel
.
text
=
NSLocalizedString
(
@"FOLDER_EMPTY"
,
nil
);
_nothingFoundLabel
.
textAlignment
=
NSTextAlignmentCenter
;
_nothingFoundLabel
.
textColor
=
[
UIColor
VLCLightTextColor
];
_nothingFoundLabel
.
font
=
[
UIFont
preferredFontForTextStyle
:
UIFontTextStyleTitle3
];
[
_nothingFoundLabel
sizeToFit
];
[
_nothingFoundLabel
setTranslatesAutoresizingMaskIntoConstraints
:
NO
];
[
self
.
view
addSubview
:
_nothingFoundLabel
];
NSLayoutConstraint
*
yConstraint
=
[
NSLayoutConstraint
constraintWithItem
:
_nothingFoundLabel
attribute:
NSLayoutAttributeCenterY
relatedBy:
NSLayoutRelationEqual
toItem:
self
.
view
attribute:
NSLayoutAttributeCenterY
multiplier:
1
.
0
constant:
0
.
0
];
[
self
.
view
addConstraint
:
yConstraint
];
NSLayoutConstraint
*
xConstraint
=
[
NSLayoutConstraint
constraintWithItem
:
_nothingFoundLabel
attribute:
NSLayoutAttributeCenterX
relatedBy:
NSLayoutRelationEqual
toItem:
self
.
view
attribute:
NSLayoutAttributeCenterX
multiplier:
1
.
0
constant:
0
.
0
];
[
self
.
view
addConstraint
:
xConstraint
];
}
return
self
;
}
...
...
@@ -56,6 +85,7 @@
{
self
.
title
=
networkBrowser
.
title
;
[
self
.
collectionView
reloadData
];
_nothingFoundLabel
.
hidden
=
[
self
.
serverBrowser
items
].
count
>
0
;
}
-
(
void
)
networkServerBrowser
:(
id
<
VLCNetworkServerBrowser
>
)
networkBrowser
requestDidFailWithError
:(
NSError
*
)
error
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment