Merge pull request #6086 from ByteHamster/fix-loading-views

Fix loading views inconsistently showing cover
This commit is contained in:
ByteHamster 2022-09-18 19:07:11 +02:00 committed by GitHub
commit 8426e32fe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -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;
}

View File

@ -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) {