diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2022-09-18 19:07:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-18 19:07:11 +0200 |
commit | 8426e32fe8c485b14fc33081313c0909e54bd618 (patch) | |
tree | d5fa9526192d14796939ed9b3300196b28b6f259 | |
parent | a528e8adfd09271e4cc33a5cddbfe6acc36fd15e (diff) | |
parent | 5baa13b53dbe0d8777b4a2537b9c232b0f397e4b (diff) | |
download | AntennaPod-8426e32fe8c485b14fc33081313c0909e54bd618.zip |
Merge pull request #6086 from ByteHamster/fix-loading-views
Fix loading views inconsistently showing cover
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java | 3 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java | 14 |
2 files changed, 11 insertions, 6 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java index 9c2ff2586..644d99e0e 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java @@ -70,7 +70,10 @@ public class EpisodeItemListAdapter extends SelectableAdapter<EpisodeItemViewHol @Override public final void onBindViewHolder(EpisodeItemViewHolder holder, int pos) { if (pos >= episodes.size()) { + beforeBindViewHolder(holder, pos); holder.bindDummy(); + afterBindViewHolder(holder, pos); + holder.hideSeparatorIfNecessary(); return; } diff --git a/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java b/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java index b4a01ed5a..bb57e4bc0 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java +++ b/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java @@ -199,6 +199,7 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder { } public void bindDummy() { + item = new FeedItem(); container.setAlpha(0.1f); secondaryActionIcon.setImageDrawable(null); isInbox.setVisibility(View.VISIBLE); @@ -215,12 +216,13 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder { size.setText(""); itemView.setBackgroundResource(ThemeUtils.getDrawableFromAttr(activity, R.attr.selectableItemBackground)); placeholder.setText(""); - new CoverLoader(activity) - .withResource(ThemeUtils.getDrawableFromAttr(activity, android.R.attr.textColorSecondary)) - .withPlaceholderView(placeholder) - .withCoverView(cover) - .load(); - hideSeparatorIfNecessary(); + if (coverHolder.getVisibility() == View.VISIBLE) { + new CoverLoader(activity) + .withResource(ThemeUtils.getDrawableFromAttr(activity, android.R.attr.textColorSecondary)) + .withPlaceholderView(placeholder) + .withCoverView(cover) + .load(); + } } private void updateDuration(PlaybackPositionEvent event) { |