MarkoMilos / Paginate

Library for creating simple pagination functionality upon RecyclerView and AbsListView

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LoadingListItemSpanLookup vs GridLayoutManager.SpanSizeLookup

j2emanue opened this issue · comments

I want to create different sizes of rows. when i use GridLayoutManager.SpanSizeLookup i can like this:

 mGridLayout.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
            @Override
            public int getSpanSize(int position) {

                switch (adapter.getItemViewType(position)) {
                    case TYPE_PAGE_VIEWER:
                        return 1;
                    default:
                        return 2;
                }

            }
        });

but with the one in your library it does not return position so i cant have different row sizes.

the one in your library looks like this:

setLoadingListItemSpanSizeLookup(new LoadingListItemSpanLookup() {
                    @Override
                    public int getSpanSize() {
                        return 2; //i want to change this dynamically but no position is passed in  like googles
                    }
                })

my goal is to have a gridlayout that uses your library but that i can have different size rows . for example first row had 3 items but 5th row can have 5 items. etc.

i checked the source code, it looks like your wrapping around the gridlayoutmanager one. so it should be ok. lets close this.