mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
fix: limited the number of items to load
This commit is contained in:
parent
5a2d74a2f4
commit
ff1fb78d4a
5 changed files with 25 additions and 8 deletions
|
|
@ -62,6 +62,16 @@ public class PodcastEpisodeAdapter extends RecyclerView.Adapter<PodcastEpisodeAd
|
|||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
ItemHomePodcastEpisodeBinding item;
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@ import com.cappielloantonio.play.util.UIUtil;
|
|||
import com.cappielloantonio.play.viewmodel.PodcastViewModel;
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@UnstableApi
|
||||
public class HomeTabPodcastFragment extends Fragment implements ClickCallback {
|
||||
private static final String TAG = "HomeTabPodcastFragment";
|
||||
|
|
@ -125,7 +128,7 @@ public class HomeTabPodcastFragment extends Fragment implements ClickCallback {
|
|||
if (bind != null)
|
||||
bind.homeNewestPodcastsSector.setVisibility(!podcastEpisodes.isEmpty() ? View.VISIBLE : View.GONE);
|
||||
|
||||
podcastEpisodeAdapter.setItems(podcastEpisodes);
|
||||
podcastEpisodeAdapter.setItems(podcastEpisodes.stream().filter(podcastEpisode -> Objects.equals(podcastEpisode.getStatus(), "completed")).collect(Collectors.toList()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ import com.cappielloantonio.play.util.UIUtil;
|
|||
import com.cappielloantonio.play.viewmodel.PodcastChannelPageViewModel;
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@UnstableApi
|
||||
public class PodcastChannelPageFragment extends Fragment implements ClickCallback {
|
||||
private FragmentPodcastChannelPageBinding bind;
|
||||
|
|
@ -121,9 +124,8 @@ public class PodcastChannelPageFragment extends Fragment implements ClickCallbac
|
|||
bind.podcastChannelPageEpisodesPlaceholder.placeholder.setVisibility(View.GONE);
|
||||
|
||||
if (channels.get(0) != null && channels.get(0).getEpisodes() != null) {
|
||||
if (bind != null)
|
||||
bind.podcastChannelPageEpisodesSector.setVisibility(!channels.get(0).getEpisodes().isEmpty() ? View.VISIBLE : View.GONE);
|
||||
podcastEpisodeAdapter.setItems(channels.get(0).getEpisodes());
|
||||
if (bind != null) bind.podcastChannelPageEpisodesSector.setVisibility(!channels.get(0).getEpisodes().isEmpty() ? View.VISIBLE : View.GONE);
|
||||
podcastEpisodeAdapter.setItems(channels.get(0).getEpisodes().stream().filter(podcastEpisode -> Objects.equals(podcastEpisode.getStatus(), "completed")).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue