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

Not getting gridlayout as expected #11

Open
santhoshrao519 opened this issue Jun 11, 2018 · 3 comments
Open

Not getting gridlayout as expected #11

santhoshrao519 opened this issue Jun 11, 2018 · 3 comments

Comments

@santhoshrao519
Copy link

I have used this library well with linear layout manager, but gridlayout manager is not working well for span

Please give a solution

@franklingarciaGL
Copy link

The easy change to allow us use this library wit GridLayoutManager is just to set "ViewType" public, currently they are private.
With this we can just add to the GridLayoutManager a SpanSizeLookup and set the correct span for header views.

@Jaldee-Sravan
Copy link

Hi @franklingarciaGL Can you share an example code to adjust parent span..

Thanks & Regards

@franklingarciaGL
Copy link

I'm using 1 as section type based on the code, but would be nicce to have it "exposed" as a public constant. So we can use it something like this

            layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
                @Override
                public int getSpanSize(int position) {
                    switch (adapter.getItemViewType(position)) {
                        case 1: // Section type, harcoded number because is not exposed by the api
                            return 2; //current span count
                        default:
                            return 1;
                    }
                }
            });

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