TellH / RecyclerStickyHeaderView

Sticky header view or suspending view for RecyclerView.
Apache License 2.0
345 stars 57 forks source link

StickyHeaderView empty list on Scroll error #3

Open ghost opened 7 years ago

ghost commented 7 years ago

Process: uz.iutlab.jiznstudenta, PID: 28326 java.lang.IllegalArgumentException: maxSize <= 0 at android.util.LruCache.(LruCache.java:82) at tellh.com.stickyheaderview_rv.StickyHeaderView$1.onScrollStateChanged(StickyHeaderView.java:72) at android.support.v7.widget.RecyclerView.dispatchOnScrollStateChanged(RecyclerView.java:4609) at android.support.v7.widget.RecyclerView.setScrollState(RecyclerView.java:1371) at android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:2829) at android.view.View.dispatchTouchEvent(View.java:10013)

When StickyHeaderView is empty it gives exception

aaronr0207 commented 7 years ago

I'm gettin the same error. It's reproducible adding one item and touching the empty zone too

TellH commented 7 years ago

@BeMyHeart @aaronr0207 Can you show me your code? Sorry for delay.

aaronr0207 commented 7 years ago

Yes, tell me if it is enought. Didn't include the view cause isn't relevant I though.

My recycler items model https://gist.github.com/aaronr0207/a0d7eb1de98f653abd1f36ab4b50b654

Recycler list item (non header) https://gist.github.com/aaronr0207/fd3d0b895215c839e560902356297e1e

Recycler header item https://gist.github.com/aaronr0207/0d058402f959822862afdcef8f7fd844

Initialization + Populate list https://gist.github.com/aaronr0207/8522357a97b15954bf5380ec6c9ee07b

TellH commented 7 years ago
        List<DataBean> userList = new ArrayList<>();
        userList = ListafincasDatabean();
        adapter_sticky = new StickyHeaderViewAdapter(userList)
                .RegisterItemType(new FincaRecyclerItemViewBinder(this.getBaseContext()))
                .RegisterItemType(new HeaderRecyclerItemViewBinder(this.getBaseContext()));
        rv_sticky.setAdapter(adapter_sticky);

@aaronr0207 What the userList contains here.

ghost commented 7 years ago

UserList contains my models sticky view and subTexts

aaronr0207 commented 7 years ago

@TellH Header items and regular items, as DataBean models:

https://gist.github.com/aaronr0207/a0d7eb1de98f653abd1f36ab4b50b654 https://gist.github.com/aaronr0207/0d058402f959822862afdcef8f7fd844

Didn't see the notification, sorry