mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 15:03:37 +00:00
fix: limited the number of items to load
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user