diff --git a/app/src/main/java/me/toptas/rssconvertersample/RssItemsAdapter.java b/app/src/main/java/me/toptas/rssconvertersample/RssItemsAdapter.java index 744b8cf..f27438d 100644 --- a/app/src/main/java/me/toptas/rssconvertersample/RssItemsAdapter.java +++ b/app/src/main/java/me/toptas/rssconvertersample/RssItemsAdapter.java @@ -65,6 +65,11 @@ public void onBindViewHolder(RssItemsAdapter.ViewHolder holder, int position) { final RssItem item = mItems.get(position); holder.textTitle.setText(item.getTitle()); holder.textPubDate.setText(item.getPublishDate()); + if (item.getEnclosures().size() > 0) { + holder.textEnclosure.setText(item.getEnclosures().get(0).getLink()); + } else { + holder.textEnclosure.setVisibility(View.GONE); + } if (item.getImage() != null) { Picasso.with(mContext).load(item.getImage()). @@ -101,6 +106,9 @@ static class ViewHolder extends RecyclerView.ViewHolder { @BindView(R.id.tvPubDate) TextView textPubDate; + @BindView(R.id.tvEnclosure) + TextView textEnclosure; + @BindView(R.id.ivThumb) ImageView imageThumb; diff --git a/app/src/main/res/layout/row_rss_item.xml b/app/src/main/res/layout/row_rss_item.xml index c69af12..c0a060c 100644 --- a/app/src/main/res/layout/row_rss_item.xml +++ b/app/src/main/res/layout/row_rss_item.xml @@ -1,7 +1,5 @@ + +