Commit 26ce09e7 authored by Varun Patil's avatar Varun Patil

Fix broken infinite scrolling

Check if the item being displayed is the progress bar in getItemId
parent 0901d28c
......@@ -111,8 +111,11 @@ public class NewsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> i
@Override
public long getItemId(int position) {
if (position < newsArticles.size()) {
return newsArticles.get(position).getArticleID().hashCode();
}
return -1;
}
@Override
public int getItemCount() {
......
......@@ -103,8 +103,11 @@ public class PlacementBlogAdapter extends RecyclerView.Adapter<RecyclerView.View
@Override
public long getItemId(int position) {
if (position < posts.size()) {
return posts.get(position).getPostID().hashCode();
}
return -1;
}
public static class ProgressViewHolder extends RecyclerView.ViewHolder {
public ProgressBar progressBar;
......
......@@ -99,8 +99,11 @@ public class TrainingBlogAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
@Override
public long getItemId(int position) {
if (position < posts.size()) {
return posts.get(position).getPostID().hashCode();
}
return -1;
}
@Override
public int getItemCount() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment