diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java index e8935f5f..41f06453 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -11,6 +11,7 @@ import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.os.Handler; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -449,6 +450,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter= 0) { + int position = ((PostBaseViewHolder) holder).currentPosition; + if (position < getItemCount() && position >= 0) { Post post = getItem(position); ((PostBaseViewHolder) holder).markPostRead(post, false); } @@ -1838,8 +1842,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter= 0) { + int position = ((PostCompactBaseViewHolder) holder).currentPosition; + if (position < getItemCount() && position >= 0) { Post post = getItem(position); ((PostCompactBaseViewHolder) holder).markPostRead(post, false); } @@ -1869,7 +1873,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter= 0) { Post post = getItem(position); ((PostGalleryViewHolder) holder).markPostRead(post, false); @@ -2035,6 +2039,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter