diff --git a/README.md b/README.md index e24c686ca..0a2e2e55c 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ Project status: [](screenshots/screenshot_5.png) [](screenshots/screenshot_6.png) +[![Screenshot 1](assets/screenshot_1.png)](assets/screenshot_1.png) +[![Screenshot 2](assets/screenshot_2.png)](assets/screenshot_2.png) + ## Description NewPipe does not use any Google framework libraries, or the YouTube API. It only parses the website in order to gain the information it needs. Therefore this app can be used on devices without Google Services installed. Also, you don't need a YouTube account to use NewPipe, and it's FLOSS. diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java index fb2ba14a7..e3840468a 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java @@ -9,6 +9,7 @@ import android.os.Handler; import android.preference.PreferenceManager; import android.support.v4.app.ListFragment; import android.util.Log; +import android.view.LayoutInflater; import android.view.View; import android.widget.AbsListView; import android.widget.ListView; @@ -63,6 +64,8 @@ public class VideoItemListFragment extends ListFragment { private int currentRequestId = -1; private ListView list; + private View footer; + private class ResultRunnable implements Runnable { private final SearchEngine.Result result; private final int requestId; @@ -112,6 +115,16 @@ public class VideoItemListFragment extends ListFragment { } }); } + getActivity().runOnUiThread(new Runnable() { + @Override + + public void run() { + getListView().removeFooterView(footer); + } + } + + ); + } } @@ -283,6 +296,9 @@ public class VideoItemListFragment extends ListFragment { super.onViewCreated(view, savedInstanceState); list = getListView(); videoListAdapter = new VideoListAdapter(getActivity(), this); + footer = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.paginate_footer, null, false); + + setListAdapter(videoListAdapter); // Restore the previously serialized activated item position. @@ -292,6 +308,7 @@ public class VideoItemListFragment extends ListFragment { setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION)); } + getListView().setOnScrollListener(new AbsListView.OnScrollListener() { long lastScrollDate = 0; @@ -308,6 +325,7 @@ public class VideoItemListFragment extends ListFragment { long time = System.currentTimeMillis(); if ((time - lastScrollDate) > 200) { lastScrollDate = time; + getListView().addFooterView(footer); nextPage(); } } diff --git a/app/src/main/res/layout/paginate_footer.xml b/app/src/main/res/layout/paginate_footer.xml new file mode 100644 index 000000000..8e5d7571d --- /dev/null +++ b/app/src/main/res/layout/paginate_footer.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file