From 59523d6a088566a89315309d1a63cbdf791efe06 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 7 Jun 2016 11:32:31 -0300 Subject: [PATCH] Fix for #308 --- .../java/org/schabi/newpipe/VideoItemListFragment.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java index 10d4997f4..c51ce1c13 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java @@ -141,7 +141,8 @@ public class VideoItemListFragment extends ListFragment { } catch(ExtractionException e) { ErrorActivity.reportError(h, getActivity(), e, null, null, ErrorActivity.ErrorInfo.make(ErrorActivity.SEARCHED, - /* todo: this shoudl not be assigned static */ "Youtube", query, R.string.parsing_error)); + /* todo: this shoudl not be assigned static */ + "Youtube", query, R.string.parsing_error)); //postNewErrorToast(h, R.string.parsing_error); e.printStackTrace(); @@ -288,8 +289,8 @@ public class VideoItemListFragment extends ListFragment { int visibleItemCount, int totalItemCount) { if (mode != PRESENT_VIDEOS_MODE && list.getChildAt(0) != null - && list.getLastVisiblePosition() == list.getAdapter().getCount() - 1 - && list.getChildAt(list.getChildCount() - 1).getBottom() <= list.getHeight()) { + && list.getLastVisiblePosition() == list.getAdapter().getCount() - 2 + && list.getChildAt(list.getChildCount() - 1).getBottom() >= list.getHeight()) { long time = System.currentTimeMillis(); if ((time - lastScrollDate) > 200 && !loadingNextPage) {