Hide images on podcast details screen

This commit is contained in:
ByteHamster 2020-02-05 16:17:51 +01:00
parent 5a26207fdb
commit df99d684b7
4 changed files with 24 additions and 22 deletions

View File

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

View File

@ -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<Downloader> 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();
}

View File

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

View File

@ -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">
<TextView
android:id="@+id/txtvPlaceholder"
@ -55,8 +58,6 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding"
android:layout_marginLeft="@dimen/listitem_threeline_textleftpadding"
android:layout_marginStart="@dimen/listitem_threeline_textleftpadding"
android:layout_marginRight="@dimen/listitem_threeline_textrightpadding"
android:layout_marginEnd="@dimen/listitem_threeline_textrightpadding"
android:layout_marginTop="@dimen/listitem_threeline_verticalpadding"