summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorMartin Fietz <martin.fietz@gmail.com>2018-01-10 23:21:53 +0100
committerMartin Fietz <martin.fietz@gmail.com>2018-01-10 23:21:53 +0100
commit249bf9bc184b453eb962cdfa592f5ae15c8f612d (patch)
tree108a723004d5baa595f4a054203bc35dc0de8315 /app/src/main
parent33f8ead4a03aaccd9f880a37cadde64683f8d434 (diff)
downloadAntennaPod-249bf9bc184b453eb962cdfa592f5ae15c8f612d.zip
Do not treat position as fixed
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java7
1 files changed, 2 insertions, 5 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 6611cd35a..172646211 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java
@@ -100,7 +100,6 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
holder.txtvDuration = (TextView) view.findViewById(R.id.txtvDuration);
holder.item = null;
holder.mainActivityRef = mainActivityRef;
- holder.position = -1;
// so we can grab this later
view.setTag(holder);
@@ -112,11 +111,10 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
final FeedItem item = itemAccess.getItem(position);
if (item == null) return;
holder.itemView.setOnLongClickListener(v -> {
- this.position = position;
+ this.position = holder.getAdapterPosition();
return false;
});
holder.item = item;
- holder.position = position;
holder.placeholder.setVisibility(View.VISIBLE);
holder.placeholder.setText(item.getFeed().getTitle());
holder.title.setText(item.getTitle());
@@ -252,7 +250,6 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
ImageButton butSecondary;
FeedItem item;
WeakReference<MainActivity> mainActivityRef;
- int position;
public Holder(View itemView) {
super(itemView);
@@ -265,7 +262,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
MainActivity mainActivity = mainActivityRef.get();
if (mainActivity != null) {
long[] ids = itemAccess.getItemsIds().toArray();
- mainActivity.loadChildFragment(ItemFragment.newInstance(ids, position));
+ mainActivity.loadChildFragment(ItemFragment.newInstance(ids, getAdapterPosition()));
}
}