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
Geoffrey Métais
VLC-Android
Commits
1c88c622
Commit
1c88c622
authored
Apr 20, 2018
by
Geoffrey Métais
Browse files
Network: Fix lists title visibility
parent
0d3958d5
Changes
1
Show whitespace changes
Inline
Side-by-side
vlc-android/src/org/videolan/vlc/gui/browser/NetworkBrowserFragment.java
View file @
1c88c622
...
...
@@ -77,7 +77,7 @@ public class NetworkBrowserFragment extends BaseBrowserFragment implements Simpl
if
(
mRoot
)
((
NetworkProvider
)
mProvider
).
getFavorites
().
observe
(
this
,
new
Observer
<
List
<
MediaLibraryItem
>>()
{
@Override
public
void
onChanged
(
@Nullable
List
<
MediaLibraryItem
>
mediaLibraryItems
)
{
mBinding
.
favoritesTitle
.
setVisibility
(
Util
.
isListEmpty
(
mediaLibraryItems
)
?
View
.
GONE
:
View
.
VISIBLE
);
mBinding
.
setShowFavorites
(!
Util
.
isListEmpty
(
mediaLibraryItems
));
favoritesAdapter
.
submitList
(
mediaLibraryItems
);
}
});
...
...
@@ -210,30 +210,29 @@ public class NetworkBrowserFragment extends BaseBrowserFragment implements Simpl
* Update views visibility and emptiness info
*/
protected
void
updateEmptyView
()
{
if
(
m
EmptyView
==
null
)
return
;
if
(
m
Binding
==
null
)
return
;
if
(
ExternalMonitor
.
connected
.
getValue
())
{
if
(
Util
.
isListEmpty
(
getProvider
().
getDataset
().
getValue
()))
{
if
(
mSwipeRefreshLayout
==
null
||
mSwipeRefreshLayout
.
isRefreshing
())
{
m
EmptyView
.
setText
(
R
.
string
.
loading
);
m
EmptyView
.
setVisibility
(
View
.
VISIBLE
);
m
RecyclerView
.
setVisibility
(
View
.
GONE
);
m
Binding
.
empty
.
setText
(
R
.
string
.
loading
);
m
Binding
.
empty
.
setVisibility
(
View
.
VISIBLE
);
m
Binding
.
networkList
.
setVisibility
(
View
.
GONE
);
}
else
{
if
(
mRoot
)
mEmptyView
.
setText
(
allowLAN
()
?
R
.
string
.
network_shares_discovery
:
R
.
string
.
network_connection_needed
);
else
mEmptyView
.
setText
(
R
.
string
.
network_empty
);
mEmptyView
.
setVisibility
(
View
.
VISIBLE
);
mRecyclerView
.
setVisibility
(
View
.
GONE
);
if
(
mRoot
)
mBinding
.
empty
.
setText
(
allowLAN
()
?
R
.
string
.
network_shares_discovery
:
R
.
string
.
network_connection_needed
);
else
mBinding
.
empty
.
setText
(
R
.
string
.
network_empty
);
mBinding
.
empty
.
setVisibility
(
View
.
VISIBLE
);
mBinding
.
networkList
.
setVisibility
(
View
.
GONE
);
mHandler
.
sendEmptyMessage
(
BrowserFragmentHandler
.
MSG_HIDE_LOADING
);
}
}
else
if
(
m
EmptyView
.
getVisibility
()
==
View
.
VISIBLE
)
{
m
EmptyView
.
setVisibility
(
View
.
GONE
);
m
RecyclerView
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
m
Binding
.
empty
.
getVisibility
()
==
View
.
VISIBLE
)
{
m
Binding
.
empty
.
setVisibility
(
View
.
GONE
);
m
Binding
.
networkList
.
setVisibility
(
View
.
VISIBLE
);
}
}
else
{
mEmptyView
.
setText
(
R
.
string
.
network_connection_needed
);
mEmptyView
.
setVisibility
(
View
.
VISIBLE
);
mRecyclerView
.
setVisibility
(
View
.
GONE
);
mBinding
.
empty
.
setText
(
R
.
string
.
network_connection_needed
);
mBinding
.
empty
.
setVisibility
(
View
.
VISIBLE
);
mBinding
.
networkList
.
setVisibility
(
View
.
GONE
);
mBinding
.
setShowFavorites
(
false
);
}
}
...
...
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