Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with setColumnCountPortrait function #121

Open
bkhezry opened this issue Feb 11, 2016 · 0 comments
Open

problem with setColumnCountPortrait function #121

bkhezry opened this issue Feb 11, 2016 · 0 comments

Comments

@bkhezry
Copy link
Contributor

bkhezry commented 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?

 mLayoutManager = (LinearLayoutManager) mListView.getLayoutManager();
        mListView.addOnScrollListener(new RecyclerView.OnScrollListener() {
            @Override
            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                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();
                        }
                    }
                }
            }
        });
@bkhezry bkhezry changed the title problem with setColumnCountPortrait funtion problem with setColumnCountPortrait function Feb 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant