diff options
author | ByteHamster <info@bytehamster.com> | 2018-12-26 08:40:40 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2018-12-26 08:40:40 +0100 |
commit | bb4b4655d25713dfddca7a52c5088938c604114b (patch) | |
tree | 29546dd59b232b0843cd52e80d950111aefddb81 /app/src/main/java/de/danoeh/antennapod/adapter | |
parent | 20328dbd97c0ff561b815efe3cc088884f7378eb (diff) | |
parent | 9a92e66ffdcb7648ad641fa4f17ffe11d4d72298 (diff) | |
download | AntennaPod-bb4b4655d25713dfddca7a52c5088938c604114b.zip |
Merge branch 'develop' into rxjava2
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/adapter')
16 files changed, 91 insertions, 94 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java index 9739b999b..da1ce7670 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java @@ -1,6 +1,7 @@ package de.danoeh.antennapod.adapter; import android.os.Build; +import android.support.annotation.Nullable; import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.helper.ItemTouchHelper; @@ -51,7 +52,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR private final ActionButtonUtils actionButtonUtils; private final boolean showOnlyNewEpisodes; - private int position = -1; + private FeedItem selectedItem; private final int playingBackGroundColor; private final int normalBackGroundColor; @@ -76,24 +77,24 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.new_episodes_listitem, parent, false); Holder holder = new Holder(view); - holder.container = (FrameLayout) view.findViewById(R.id.container); - holder.content = (LinearLayout) view.findViewById(R.id.content); - holder.placeholder = (TextView) view.findViewById(R.id.txtvPlaceholder); - holder.title = (TextView) view.findViewById(R.id.txtvTitle); + holder.container = view.findViewById(R.id.container); + holder.content = view.findViewById(R.id.content); + holder.placeholder = view.findViewById(R.id.txtvPlaceholder); + holder.title = view.findViewById(R.id.txtvTitle); if(Build.VERSION.SDK_INT >= 23) { holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL); } - holder.pubDate = (TextView) view + holder.pubDate = view .findViewById(R.id.txtvPublished); holder.statusUnread = view.findViewById(R.id.statusUnread); - holder.butSecondary = (ImageButton) view + holder.butSecondary = view .findViewById(R.id.butSecondaryAction); - holder.queueStatus = (ImageView) view + holder.queueStatus = view .findViewById(R.id.imgvInPlaylist); - holder.progress = (ProgressBar) view + holder.progress = view .findViewById(R.id.pbar_progress); - holder.cover = (ImageView) view.findViewById(R.id.imgvCover); - holder.txtvDuration = (TextView) view.findViewById(R.id.txtvDuration); + holder.cover = view.findViewById(R.id.imgvCover); + holder.txtvDuration = view.findViewById(R.id.txtvDuration); holder.item = null; holder.mainActivityRef = mainActivityRef; // so we can grab this later @@ -107,7 +108,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR final FeedItem item = itemAccess.getItem(position); if (item == null) return; holder.itemView.setOnLongClickListener(v -> { - this.position = holder.getAdapterPosition(); + this.selectedItem = item; return false; }); holder.item = item; @@ -200,6 +201,11 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR .into(new CoverTarget(item.getFeed().getImageLocation(), holder.placeholder, holder.cover, mainActivityRef.get())); } + @Nullable + public FeedItem getSelectedItem() { + return selectedItem; + } + @Override public long getItemId(int position) { FeedItem item = itemAccess.getItem(position); @@ -211,16 +217,6 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR return itemAccess.getCount(); } - public FeedItem getItem(int position) { - return itemAccess.getItem(position); - } - - public int getPosition() { - int pos = position; - position = -1; // reset - return pos; - } - private final View.OnClickListener secondaryActionListener = new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java index cbd089d4c..c3fac7e18 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java @@ -57,12 +57,12 @@ public class ChaptersListAdapter extends ArrayAdapter<Chapter> { convertView = inflater.inflate(R.layout.simplechapter_item, parent, false); holder.view = convertView; - holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); + holder.title = convertView.findViewById(R.id.txtvTitle); defaultTextColor = holder.title.getTextColors().getDefaultColor(); - holder.start = (TextView) convertView.findViewById(R.id.txtvStart); - holder.link = (TextView) convertView.findViewById(R.id.txtvLink); - holder.duration = (TextView) convertView.findViewById(R.id.txtvDuration); - holder.butPlayChapter = (ImageButton) convertView.findViewById(R.id.butPlayChapter); + holder.start = convertView.findViewById(R.id.txtvStart); + holder.link = convertView.findViewById(R.id.txtvLink); + holder.duration = convertView.findViewById(R.id.txtvDuration); + holder.butPlayChapter = convertView.findViewById(R.id.butPlayChapter); convertView.setTag(holder); } else { holder = (Holder) convertView.getTag(); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java b/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java index 08b2908ac..1286d9dc7 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java @@ -1,13 +1,12 @@ package de.danoeh.antennapod.adapter; import android.content.Context; +import android.support.annotation.NonNull; import android.content.Intent; import android.widget.Toast; import com.afollestad.materialdialogs.MaterialDialog; -import de.danoeh.antennapod.core.util.IntentUtils; -import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter; import org.apache.commons.lang3.Validate; import de.danoeh.antennapod.R; @@ -21,8 +20,10 @@ import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.storage.DownloadRequester; +import de.danoeh.antennapod.core.util.IntentUtils; import de.danoeh.antennapod.core.util.LongList; import de.danoeh.antennapod.core.util.NetworkUtils; +import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter; /** * Default implementation of an ActionButtonCallback diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java index 163366c3c..789c01a26 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java @@ -49,15 +49,15 @@ public class DownloadLogAdapter extends BaseAdapter { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.downloadlog_item, parent, false); - holder.icon = (IconTextView) convertView.findViewById(R.id.txtvIcon); - holder.retry = (IconButton) convertView.findViewById(R.id.btnRetry); - holder.date = (TextView) convertView.findViewById(R.id.txtvDate); - holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); + holder.icon = convertView.findViewById(R.id.txtvIcon); + holder.retry = convertView.findViewById(R.id.btnRetry); + holder.date = convertView.findViewById(R.id.txtvDate); + holder.title = convertView.findViewById(R.id.txtvTitle); if(Build.VERSION.SDK_INT >= 23) { holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL); } - holder.type = (TextView) convertView.findViewById(R.id.txtvType); - holder.reason = (TextView) convertView.findViewById(R.id.txtvReason); + holder.type = convertView.findViewById(R.id.txtvType); + holder.reason = convertView.findViewById(R.id.txtvReason); convertView.setTag(holder); } else { holder = (Holder) convertView.getTag(); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java index 51e1271d9..014e43ee7 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java @@ -61,16 +61,16 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter { .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.downloaded_episodeslist_item, parent, false); - holder.imageView = (ImageView) convertView.findViewById(R.id.imgvImage); - holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); + holder.imageView = convertView.findViewById(R.id.imgvImage); + holder.title = convertView.findViewById(R.id.txtvTitle); if(Build.VERSION.SDK_INT >= 23) { holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL); } - holder.txtvSize = (TextView) convertView.findViewById(R.id.txtvSize); - holder.queueStatus = (ImageView) convertView.findViewById(R.id.imgvInPlaylist); - holder.pubDate = (TextView) convertView + holder.txtvSize = convertView.findViewById(R.id.txtvSize); + holder.queueStatus = convertView.findViewById(R.id.imgvInPlaylist); + holder.pubDate = convertView .findViewById(R.id.txtvPublished); - holder.butSecondary = (ImageButton) convertView + holder.butSecondary = convertView .findViewById(R.id.butSecondaryAction); convertView.setTag(holder); } else { diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java index a8c60c19e..b85d1d35d 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java @@ -59,14 +59,14 @@ public class DownloadlistAdapter extends BaseAdapter { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.downloadlist_item, parent, false); - holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); - holder.downloaded = (TextView) convertView + holder.title = convertView.findViewById(R.id.txtvTitle); + holder.downloaded = convertView .findViewById(R.id.txtvDownloaded); - holder.percent = (TextView) convertView + holder.percent = convertView .findViewById(R.id.txtvPercent); - holder.progbar = (ProgressBar) convertView + holder.progbar = convertView .findViewById(R.id.progProgress); - holder.butSecondary = (ImageButton) convertView + holder.butSecondary = convertView .findViewById(R.id.butSecondaryAction); convertView.setTag(holder); 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 cf3dd8b09..738a0a636 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java @@ -90,24 +90,24 @@ public class FeedItemlistAdapter extends BaseAdapter { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.feeditemlist_item, parent, false); - holder.container = (LinearLayout) convertView + holder.container = convertView .findViewById(R.id.container); - holder.title = (TextView) convertView.findViewById(R.id.txtvItemname); + holder.title = convertView.findViewById(R.id.txtvItemname); if(Build.VERSION.SDK_INT >= 23) { holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL); } - holder.lenSize = (TextView) convertView + holder.lenSize = convertView .findViewById(R.id.txtvLenSize); - holder.butAction = (ImageButton) convertView + holder.butAction = convertView .findViewById(R.id.butSecondaryAction); - holder.published = (TextView) convertView + holder.published = convertView .findViewById(R.id.txtvPublished); - holder.inPlaylist = (ImageView) convertView + holder.inPlaylist = convertView .findViewById(R.id.imgvInPlaylist); - holder.type = (ImageView) convertView.findViewById(R.id.imgvType); + holder.type = convertView.findViewById(R.id.imgvType); holder.statusUnread = convertView .findViewById(R.id.statusUnread); - holder.episodeProgress = (ProgressBar) convertView + holder.episodeProgress = convertView .findViewById(R.id.pbar_episode_progress); convertView.setTag(holder); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java index 5b205e91f..c10bb7638 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java @@ -34,9 +34,9 @@ public class FeedItemlistDescriptionAdapter extends ArrayAdapter<FeedItem> { LayoutInflater inflater = (LayoutInflater) getContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.itemdescription_listitem, parent, false); - holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); - holder.pubDate = (TextView) convertView.findViewById(R.id.txtvPubDate); - holder.description = (TextView) convertView.findViewById(R.id.txtvDescription); + holder.title = convertView.findViewById(R.id.txtvTitle); + holder.pubDate = convertView.findViewById(R.id.txtvPubDate); + holder.description = convertView.findViewById(R.id.txtvDescription); convertView.setTag(holder); } else { diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java index 2daa5e70f..5adf662b3 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -212,7 +212,7 @@ public class NavListAdapter extends BaseAdapter v = getFeedView(position, convertView, parent); } if (v != null && viewType != VIEW_TYPE_SECTION_DIVIDER) { - TextView txtvTitle = (TextView) v.findViewById(R.id.txtvTitle); + TextView txtvTitle = v.findViewById(R.id.txtvTitle); if (position == itemAccess.getSelectedItemIndex()) { txtvTitle.setTypeface(null, Typeface.BOLD); } else { @@ -235,9 +235,9 @@ public class NavListAdapter extends BaseAdapter convertView = inflater.inflate(R.layout.nav_listitem, parent, false); - holder.image = (ImageView) convertView.findViewById(R.id.imgvCover); - holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); - holder.count = (TextView) convertView.findViewById(R.id.txtvCount); + holder.image = convertView.findViewById(R.id.imgvCover); + holder.title = convertView.findViewById(R.id.txtvTitle); + holder.count = convertView.findViewById(R.id.txtvCount); convertView.setTag(holder); } else { holder = (NavHolder) convertView.getTag(); @@ -325,10 +325,10 @@ public class NavListAdapter extends BaseAdapter convertView = inflater.inflate(R.layout.nav_feedlistitem, parent, false); - holder.image = (ImageView) convertView.findViewById(R.id.imgvCover); - holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); - holder.failure = (IconTextView) convertView.findViewById(R.id.itxtvFailure); - holder.count = (TextView) convertView.findViewById(R.id.txtvCount); + holder.image = convertView.findViewById(R.id.imgvCover); + holder.title = convertView.findViewById(R.id.txtvTitle); + holder.failure = convertView.findViewById(R.id.itxtvFailure); + holder.count = convertView.findViewById(R.id.txtvCount); convertView.setTag(holder); } else { holder = (FeedHolder) convertView.getTag(); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java index ee14cb70a..3ad9dc79c 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java @@ -25,7 +25,6 @@ import android.widget.TextView; import com.bumptech.glide.Glide; import com.joanzapata.iconify.Iconify; -import de.danoeh.antennapod.core.util.ThemeUtils; import org.apache.commons.lang3.ArrayUtils; import java.lang.ref.WeakReference; @@ -41,6 +40,7 @@ import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.DateUtils; import de.danoeh.antennapod.core.util.LongList; import de.danoeh.antennapod.core.util.NetworkUtils; +import de.danoeh.antennapod.core.util.ThemeUtils; import de.danoeh.antennapod.fragment.ItemFragment; import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler; @@ -134,19 +134,19 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap public ViewHolder(View v) { super(v); - container = (FrameLayout) v.findViewById(R.id.container); - dragHandle = (ImageView) v.findViewById(R.id.drag_handle); - placeholder = (TextView) v.findViewById(R.id.txtvPlaceholder); - cover = (ImageView) v.findViewById(R.id.imgvCover); - title = (TextView) v.findViewById(R.id.txtvTitle); + container = v.findViewById(R.id.container); + dragHandle = v.findViewById(R.id.drag_handle); + placeholder = v.findViewById(R.id.txtvPlaceholder); + cover = v.findViewById(R.id.imgvCover); + title = v.findViewById(R.id.txtvTitle); if(Build.VERSION.SDK_INT >= 23) { title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL); } - pubDate = (TextView) v.findViewById(R.id.txtvPubDate); - progressLeft = (TextView) v.findViewById(R.id.txtvProgressLeft); - progressRight = (TextView) v.findViewById(R.id.txtvProgressRight); - butSecondary = (ImageButton) v.findViewById(R.id.butSecondaryAction); - progressBar = (ProgressBar) v.findViewById(R.id.progressBar); + pubDate = v.findViewById(R.id.txtvPubDate); + progressLeft = v.findViewById(R.id.txtvProgressLeft); + progressRight = v.findViewById(R.id.txtvProgressRight); + butSecondary = v.findViewById(R.id.butSecondaryAction); + progressBar = v.findViewById(R.id.progressBar); v.setTag(this); v.setOnClickListener(this); v.setOnCreateContextMenuListener(this); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java index beb62b3bb..74c0d6473 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java @@ -61,13 +61,13 @@ public class SearchlistAdapter extends BaseAdapter { .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.searchlist_item, parent, false); - holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); + holder.title = convertView.findViewById(R.id.txtvTitle); if(Build.VERSION.SDK_INT >= 23) { holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL); } - holder.cover = (ImageView) convertView + holder.cover = convertView .findViewById(R.id.imgvFeedimage); - holder.subtitle = (TextView) convertView + holder.subtitle = convertView .findViewById(R.id.txtvSubtitle); convertView.setTag(holder); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java index 50255c11f..d1f1d85bc 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java @@ -62,9 +62,9 @@ public class StatisticsListAdapter extends BaseAdapter { convertView = inflater.inflate(R.layout.statistics_listitem, parent, false); - holder.image = (ImageView) convertView.findViewById(R.id.imgvCover); - holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); - holder.time = (TextView) convertView.findViewById(R.id.txtvTime); + holder.image = convertView.findViewById(R.id.imgvCover); + holder.title = convertView.findViewById(R.id.txtvTitle); + holder.time = convertView.findViewById(R.id.txtvTime); convertView.setTag(holder); } else { holder = (StatisticsHolder) convertView.getTag(); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java index bb76ab501..9230967ab 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java @@ -89,9 +89,9 @@ public class SubscriptionsAdapter extends BaseAdapter implements AdapterView.OnI LayoutInflater layoutInflater = (LayoutInflater) mainActivityRef.get().getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = layoutInflater.inflate(R.layout.subscription_item, parent, false); - holder.feedTitle = (TextView) convertView.findViewById(R.id.txtvTitle); - holder.imageView = (ImageView) convertView.findViewById(R.id.imgvCover); - holder.count = (TriangleLabelView) convertView.findViewById(R.id.triangleCountView); + holder.feedTitle = convertView.findViewById(R.id.txtvTitle); + holder.imageView = convertView.findViewById(R.id.imgvCover); + holder.count = convertView.findViewById(R.id.triangleCountView); convertView.setTag(holder); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java index aea3d583f..9cc0e36cf 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java @@ -40,10 +40,10 @@ public class PodcastListAdapter extends ArrayAdapter<GpodnetPodcast> { .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.gpodnet_podcast_listitem, parent, false); - holder.image = (ImageView) convertView.findViewById(R.id.imgvCover); - holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); - holder.subscribers = (TextView) convertView.findViewById(R.id.txtvSubscribers); - holder.url = (TextView) convertView.findViewById(R.id.txtvUrl); + holder.image = convertView.findViewById(R.id.imgvCover); + holder.title = convertView.findViewById(R.id.txtvTitle); + holder.subscribers = convertView.findViewById(R.id.txtvSubscribers); + holder.url = convertView.findViewById(R.id.txtvUrl); convertView.setTag(holder); } else { holder = (Holder) convertView.getTag(); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/TagListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/TagListAdapter.java index b4eadefb5..52fca792e 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/TagListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/TagListAdapter.java @@ -34,8 +34,8 @@ public class TagListAdapter extends ArrayAdapter<GpodnetTag> { .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.gpodnet_tag_listitem, parent, false); - holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); - holder.usage = (TextView) convertView.findViewById(R.id.txtvUsage); + holder.title = convertView.findViewById(R.id.txtvTitle); + holder.usage = convertView.findViewById(R.id.txtvUsage); convertView.setTag(holder); } else { holder = (Holder) convertView.getTag(); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java index 4a941275d..b103026dc 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java @@ -182,9 +182,9 @@ public class ItunesAdapter extends ArrayAdapter<ItunesAdapter.Podcast> { * @param view GridView cell */ PodcastViewHolder(View view){ - coverView = (ImageView) view.findViewById(R.id.imgvCover); - titleView = (TextView) view.findViewById(R.id.txtvTitle); - urlView = (TextView) view.findViewById(R.id.txtvUrl); + coverView = view.findViewById(R.id.imgvCover); + titleView = view.findViewById(R.id.txtvTitle); + urlView = view.findViewById(R.id.txtvUrl); } } } |