Show covers on podcast page (#7094)

This commit is contained in:
ByteHamster 2024-04-15 19:28:10 +02:00 committed by GitHub
parent 2043e71299
commit 5e7858ef7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 3 deletions

View File

@ -43,8 +43,8 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder {
private final View container; private final View container;
public final ImageView dragHandle; public final ImageView dragHandle;
private final TextView placeholder; public final TextView placeholder;
private final ImageView cover; public final ImageView cover;
private final TextView title; private final TextView title;
private final TextView pubDate; private final TextView pubDate;
private final TextView position; private final TextView position;

View File

@ -27,6 +27,7 @@ import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
import com.leinardi.android.speeddial.SpeedDialView; import com.leinardi.android.speeddial.SpeedDialView;
import de.danoeh.antennapod.ui.CoverLoader;
import de.danoeh.antennapod.ui.screen.episode.ItemPagerFragment; import de.danoeh.antennapod.ui.screen.episode.ItemPagerFragment;
import de.danoeh.antennapod.ui.screen.SearchFragment; import de.danoeh.antennapod.ui.screen.SearchFragment;
import de.danoeh.antennapod.ui.TransitionEffect; import de.danoeh.antennapod.ui.TransitionEffect;
@ -639,7 +640,18 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
@Override @Override
protected void beforeBindViewHolder(EpisodeItemViewHolder holder, int pos) { protected void beforeBindViewHolder(EpisodeItemViewHolder holder, int pos) {
holder.coverHolder.setVisibility(View.GONE); holder.coverHolder.setVisibility(View.GONE); // Load it ourselves
}
@Override
protected void afterBindViewHolder(EpisodeItemViewHolder holder, int pos) {
holder.coverHolder.setVisibility(View.VISIBLE);
new CoverLoader()
.withUri(holder.getFeedItem().getImageLocation()) // Ignore "Show episode cover" setting
.withFallbackUri(holder.getFeedItem().getFeed().getImageUrl())
.withPlaceholderView(holder.placeholder)
.withCoverView(holder.cover)
.load();
} }
@Override @Override