public abstract class InfiniteLoadingHelper
extends java.lang.Object
Constructor and Description |
---|
InfiniteLoadingHelper(RecyclerView recyclerView,
int layoutId) |
InfiniteLoadingHelper(RecyclerView recyclerView,
int layoutId,
int totalPageCount) |
Modifier and Type | Method and Description |
---|---|
ItemBinder<java.lang.String,ItemViewHolder<java.lang.String>> |
getItemBinder()
Internal method.
|
void |
markAllPagesLoaded()
To stop the infinite loading.
|
void |
markCurrentPageLoaded()
To set the current page as loaded.
|
abstract void |
onLoadNextPage(int page)
Abstract callback when the
RecyclerView is scrolled and the next page has to be loaded |
void |
setFooterSection(ItemSection<java.lang.String> footerSection) |
void |
setPageCount(int totalPageCount)
Set the page count for infinite loading progress.
|
public InfiniteLoadingHelper(RecyclerView recyclerView, int layoutId)
layoutId
- Layout resource id - The layout which needs to be shown when the page is
loading.public InfiniteLoadingHelper(RecyclerView recyclerView, int layoutId, int totalPageCount)
layoutId
- Layout resource id - The layout which needs to be shown when the page is
loading.totalPageCount
- - Total pages that needs to be loaded. By default it will be taken as
Integer.MAX_VALUE
public void markAllPagesLoaded()
public void markCurrentPageLoaded()
To set the current page as loaded. The helper class will not call loadNextPage(int)
,
unless the current page is marked as loaded.
public void setPageCount(int totalPageCount)
totalPageCount
- Page count for the infinite loading progresspublic abstract void onLoadNextPage(int page)
RecyclerView
is scrolled and the next page has to be loadedpage
- Page numberpublic final ItemBinder<java.lang.String,ItemViewHolder<java.lang.String>> getItemBinder()
public final void setFooterSection(ItemSection<java.lang.String> footerSection)