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

Custom layout managers #52

Open
salvonos opened this issue Oct 27, 2017 · 3 comments
Open

Custom layout managers #52

salvonos opened this issue Oct 27, 2017 · 3 comments

Comments

@salvonos
Copy link

I am trying to use your library on my recycler view. I use a default GridLayoutManager however, I get the error

Recycler views with custom layout managers are not supported by this adapter out of the box

How can I solve this error?

OverScrollDecoratorHelper.setUpOverScroll(recyclerView, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);

    layoutManager = new GridLayoutManager(this, spanCount, GridLayoutManager.VERTICAL, false);
    layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
        @Override
        public int getSpanSize(int position) {
            //stagger rows custom
            //return (position == 0 ? 2 : 1);
            return (position % 3 == 0 ? 1 : 1);
        }
    });


    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(layoutManager);
@salvonos
Copy link
Author

Solved it.

I have put

> OverScrollDecoratorHelper.setUpOverScroll(recyclerView, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);

At the end of the code

@naive17
Copy link

naive17 commented Dec 14, 2017

Can you explain better?

@ola-wale
Copy link

doing this OverScrollDecoratorHelper.setUpOverScroll(recyclerView, OverScrollDecoratorHelper.ORIENTATION_VERTICAL); before setting a layout manager on your recycler view will trigger this error.

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

3 participants