You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use this code to implement loading more data with MaterialList.
it's work when mListView.setColumnCountPortrait(1); but when I set it 2 for example, function findFirstVisibleItemPosition return -1 all the time. any suggestion?
mLayoutManager = (LinearLayoutManager) mListView.getLayoutManager();
mListView.addOnScrollListener(newRecyclerView.OnScrollListener() {
@OverridepublicvoidonScrolled(RecyclerViewrecyclerView, intdx, intdy) {
if (dy > 0) //check for scroll down
{
visibleItemCount = mLayoutManager.getChildCount();
totalItemCount = mLayoutManager.getItemCount();
pastVisiblesItems = mLayoutManager.findFirstVisibleItemPosition();
if (loading) {
if ((visibleItemCount + pastVisiblesItems) >= totalItemCount) {
loading = false;
Log.v("...", "Last Item!");
LoadMoreData();
}
}
}
}
});
The text was updated successfully, but these errors were encountered:
bkhezry
changed the title
problem with setColumnCountPortrait funtion
problem with setColumnCountPortrait function
Feb 11, 2016
I use this code to implement loading more data with MaterialList.
it's work when mListView.setColumnCountPortrait(1); but when I set it 2 for example, function findFirstVisibleItemPosition return -1 all the time. any suggestion?
The text was updated successfully, but these errors were encountered: