mirror of
https://github.com/NiciDieNase/chaosflix
synced 2024-11-23 12:53:08 +00:00
Touch: fix loading-overlay #33
This commit is contained in:
parent
113e0eb397
commit
288c11481a
1 changed files with 7 additions and 6 deletions
|
@ -102,27 +102,28 @@ public class EventsListFragment extends BrowseFragment implements SearchView.OnQ
|
|||
binding.list.setAdapter(eventAdapter);
|
||||
|
||||
Observer<List<Event>> listObserver = persistentEvents -> {
|
||||
setLoadingOverlayVisibility(false);
|
||||
if (persistentEvents != null) {
|
||||
setEvents(persistentEvents);
|
||||
if (persistentEvents.size() > 0) {
|
||||
setLoadingOverlayVisibility(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (type == TYPE_BOOKMARKS) {
|
||||
setupToolbar(binding.incToolbar.toolbar, R.string.bookmarks);
|
||||
getViewModel().getBookmarkedEvents().observe(this, listObserver);
|
||||
setLoadingOverlayVisibility(false);
|
||||
} else if (type == TYPE_IN_PROGRESS) {
|
||||
setupToolbar(binding.incToolbar.toolbar, R.string.continue_watching);
|
||||
getViewModel().getInProgressEvents().observe(this, listObserver);
|
||||
setLoadingOverlayVisibility(false);
|
||||
} else if (type == TYPE_EVENTS) {
|
||||
{
|
||||
setupToolbar(binding.incToolbar.toolbar, conference.getTitle(), false);
|
||||
eventAdapter.setShowTags(conference.getTagsUsefull());
|
||||
getViewModel().getEventsforConference(conference).observe(this, listObserver);
|
||||
getViewModel().getEventsforConference(conference).observe(this, events -> {
|
||||
if(events != null){
|
||||
setEvents(events);
|
||||
setLoadingOverlayVisibility(false);
|
||||
}
|
||||
});
|
||||
getViewModel().updateEventsForConference(conference).observe(this, state -> {
|
||||
Downloader.DownloaderState downloaderState = state.getState();
|
||||
switch (downloaderState) {
|
||||
|
|
Loading…
Reference in a new issue