What is this blue shadow that appears when the gaze is extended after it ends? is there a listener when it appears or goes?
I have implemented https://github.com/maurycyw/StaggeredGridView and I want to load more items when this view group is reprogrammed.
It is called Overscroller. Listview has built-in support for super- Listview . Check the setOverscrollMode and its associated setOverscrollHeader and setOverscrollFooter . ListView uses overscroll header / footer, overriding AbsListView.onOverscrolled; if you need a different behavior, you can implement it by overriding it yourself.
Listview
setOverscrollMode
setOverscrollHeader
setOverscrollFooter
AbsListView.onOverscrolled;
Unfortunately, there is no library or functionality for this. But there is a good open library that you can adapt.
My suggestion is to check out SwipeRefreshLayout , this is in the Android support library.
SwipeRefreshLayout
This ViewGroup supports top-scrolling to give a callback, perhaps you can adapt it to implement bottom-scrolling.
docs: https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html
source code: https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/v4/java/android/support/v4/widget/SwipeRefreshLayout.java
change alternatively, to implement the load more function by scrolling the listener is relatively simple, it's just a simple OnScrollListener with the following code:
load more
OnScrollListener
private long lastRequestTime = 0; public void onScroll (AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount){ if (((firstVisibleItem+visibleItemCount) > totalItemCount - 4) && (lastRequestTime + 1000 < System.currentTimeMillis())) { lastRequestTime = System.currentTimeMillis(); // load more ... } }