Refresh home sections when resuming

This commit is contained in:
ByteHamster 2022-11-27 12:28:24 +01:00
parent 3973f450be
commit 6c1bf9db05
5 changed files with 30 additions and 7 deletions

View File

@ -63,11 +63,15 @@ public class DownloadsSection extends HomeSection {
SwipeActions swipeActions = new SwipeActions(this, CompletedDownloadsFragment.TAG);
swipeActions.attachTo(viewBinding.recyclerView);
swipeActions.setFilter(new FeedItemFilter(FeedItemFilter.DOWNLOADED));
loadItems();
return view;
}
@Override
public void onStart() {
super.onStart();
loadItems();
}
@Override
protected void handleMoreClick() {
((MainActivity) requireActivity()).loadChildFragment(new CompletedDownloadsFragment());

View File

@ -68,10 +68,15 @@ public class EpisodesSurpriseSection extends HomeSection {
if (seed == 0) {
seed = new Random().nextInt();
}
loadItems();
return view;
}
@Override
public void onStart() {
super.onStart();
loadItems();
}
@Override
protected void handleMoreClick() {
((MainActivity) requireActivity()).loadChildFragment(new AllEpisodesFragment());

View File

@ -65,11 +65,15 @@ public class InboxSection extends HomeSection {
SwipeActions swipeActions = new SwipeActions(this, InboxFragment.TAG);
swipeActions.attachTo(viewBinding.recyclerView);
swipeActions.setFilter(new FeedItemFilter(FeedItemFilter.NEW));
loadItems();
return view;
}
@Override
public void onStart() {
super.onStart();
loadItems();
}
@Override
protected void handleMoreClick() {
((MainActivity) requireActivity()).loadChildFragment(new InboxFragment());

View File

@ -58,10 +58,15 @@ public class QueueSection extends HomeSection {
viewBinding.recyclerView.setLayoutManager(
new LinearLayoutManager(getContext(), RecyclerView.HORIZONTAL, false));
viewBinding.recyclerView.setAdapter(listAdapter);
loadItems();
return view;
}
@Override
public void onStart() {
super.onStart();
loadItems();
}
@Override
protected void handleMoreClick() {
((MainActivity) requireActivity()).loadChildFragment(new QueueFragment());

View File

@ -44,10 +44,15 @@ public class SubscriptionsSection extends HomeSection {
listAdapter = new HorizontalFeedListAdapter((MainActivity) getActivity());
listAdapter.setDummyViews(NUM_FEEDS);
viewBinding.recyclerView.setAdapter(listAdapter);
loadItems();
return view;
}
@Override
public void onStart() {
super.onStart();
loadItems();
}
@Override
protected void handleMoreClick() {
((MainActivity) requireActivity()).loadChildFragment(new SubscriptionFragment());