This commit is contained in:
David Development 2016-03-15 18:21:45 +01:00
parent 7f3e026315
commit 0bae571974

View file

@ -168,8 +168,12 @@ public class NewsReaderDetailFragment extends Fragment {
adapter.ChangeReadStateOfItem(vh, true); adapter.ChangeReadStateOfItem(vh, true);
} }
//Check if Listview is scrolled to bottom //Check if Listview is scrolled to bottom
if (lastVisibleItem == (totalItemCount-1) && recyclerView.getChildAt(visibleItemCount).getBottom() <= recyclerView.getHeight()) { if (lastVisibleItem == (totalItemCount-1) &&
visibleItemCount != 0 && //Check if list is empty
recyclerView.getChildAt(visibleItemCount).getBottom() <= recyclerView.getHeight()) {
for (int i = firstVisibleItem; i <= lastVisibleItem; i++) { for (int i = firstVisibleItem; i <= lastVisibleItem; i++) {
RecyclerView.ViewHolder vhTemp = recyclerView.findViewHolderForLayoutPosition(i); RecyclerView.ViewHolder vhTemp = recyclerView.findViewHolderForLayoutPosition(i);
if(vhTemp instanceof ViewHolder) { //Check for ViewHolder instance because of ProgressViewHolder if(vhTemp instanceof ViewHolder) { //Check for ViewHolder instance because of ProgressViewHolder