diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java index f2fbe0770..87bd3aa5e 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java @@ -16,18 +16,19 @@ public class FeedItemlistAdapter extends BaseAdapter { private final ItemAccess itemAccess; private final MainActivity activity; - /** true if played items should be made partially transparent */ private final boolean makePlayedItemsTransparent; + private final boolean showIcons; private int currentlyPlayingItem = -1; public FeedItemlistAdapter(MainActivity activity, ItemAccess itemAccess, - boolean showFeedtitle, + boolean showIcons, boolean makePlayedItemsTransparent) { super(); this.activity = activity; this.itemAccess = itemAccess; + this.showIcons = showIcons; this.makePlayedItemsTransparent = makePlayedItemsTransparent; } @@ -56,6 +57,10 @@ public class FeedItemlistAdapter extends BaseAdapter { holder = (EpisodeItemViewHolder) convertView.getTag(); } + if (!showIcons) { + holder.coverHolder.setVisibility(View.GONE); + } + final FeedItem item = getItem(position); holder.bind(item); holder.dragHandle.setVisibility(View.GONE); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java index 123b0d1a2..5d3c811f5 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java @@ -89,25 +89,18 @@ public class FeedItemlistFragment extends ListFragment { private static final String ARGUMENT_FEED_ID = "argument.de.danoeh.antennapod.feed_id"; private FeedItemlistAdapter adapter; - private ContextMenu contextMenu; private AdapterView.AdapterContextMenuInfo lastMenuInfo = null; + private MoreContentListFooterUtil listFooter; private long feedID; private Feed feed; - private boolean headerCreated = false; - - private List downloaderList; - - private MoreContentListFooterUtil listFooter; - private boolean isUpdatingFeed; private TextView txtvTitle; private IconTextView txtvFailure; private ImageView imgvBackground; private ImageView imgvCover; - private TextView txtvInformation; private Disposable disposable; @@ -305,7 +298,6 @@ public class FeedItemlistFragment extends ListFragment { menu.setHeaderTitle(item.getTitle()); } - contextMenu = menu; lastMenuInfo = (AdapterView.AdapterContextMenuInfo) menuInfo; FeedItemMenuHandler.onPrepareMenu(menu, item); } @@ -366,7 +358,6 @@ public class FeedItemlistFragment extends ListFragment { public void onEventMainThread(DownloadEvent event) { Log.d(TAG, "onEventMainThread() called with: " + "event = [" + event + "]"); DownloaderUpdate update = event.update; - downloaderList = update.downloaders; if (event.hasChangedFeedUpdateStatus(isUpdatingFeed)) { updateProgressBarVisibility(); } diff --git a/app/src/main/java/de/danoeh/antennapod/view/EpisodeItemViewHolder.java b/app/src/main/java/de/danoeh/antennapod/view/EpisodeItemViewHolder.java index d9aa92717..968bd71a9 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/EpisodeItemViewHolder.java +++ b/app/src/main/java/de/danoeh/antennapod/view/EpisodeItemViewHolder.java @@ -10,6 +10,7 @@ import android.view.ViewGroup; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ProgressBar; +import android.widget.RelativeLayout; import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView; import com.joanzapata.iconify.Iconify; @@ -54,9 +55,10 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder public final View secondaryActionButton; public final ImageView secondaryActionIcon; private final CircularProgressBar secondaryActionProgress; - private final MainActivity activity; private final TextView separatorIcons; + public final RelativeLayout coverHolder; + private final MainActivity activity; private FeedItem item; public EpisodeItemViewHolder(MainActivity activity, ViewGroup parent) { @@ -83,6 +85,7 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder secondaryActionProgress = itemView.findViewById(R.id.secondaryActionProgress); secondaryActionButton = itemView.findViewById(R.id.secondaryActionButton); secondaryActionIcon = itemView.findViewById(R.id.secondaryActionIcon); + coverHolder = itemView.findViewById(R.id.coverHolder); itemView.setTag(this); } @@ -117,12 +120,14 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder secondaryActionProgress.setPercentage(0, item); } - new CoverLoader(activity) - .withUri(ImageResourceUtils.getImageLocation(item)) - .withFallbackUri(item.getFeed().getImageLocation()) - .withPlaceholderView(placeholder) - .withCoverView(cover) - .load(); + if (coverHolder.getVisibility() == View.VISIBLE) { + new CoverLoader(activity) + .withUri(ImageResourceUtils.getImageLocation(item)) + .withFallbackUri(item.getFeed().getImageLocation()) + .withPlaceholderView(placeholder) + .withCoverView(cover) + .load(); + } } private void bind(FeedMedia media) { diff --git a/app/src/main/res/layout/feeditemlist_item.xml b/app/src/main/res/layout/feeditemlist_item.xml index cd983ffca..af8323567 100644 --- a/app/src/main/res/layout/feeditemlist_item.xml +++ b/app/src/main/res/layout/feeditemlist_item.xml @@ -30,7 +30,10 @@ android:layout_width="@dimen/thumbnail_length_queue_item" android:layout_height="@dimen/thumbnail_length_queue_item" android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding" - android:layout_marginTop="@dimen/listitem_threeline_verticalpadding"> + android:layout_marginTop="@dimen/listitem_threeline_verticalpadding" + android:layout_marginRight="@dimen/listitem_threeline_textleftpadding" + android:layout_marginEnd="@dimen/listitem_threeline_textleftpadding" + android:id="@+id/coverHolder">