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

throw error #51

Open
wuxiangpeng opened this issue Jan 8, 2020 · 1 comment
Open

throw error #51

wuxiangpeng opened this issue Jan 8, 2020 · 1 comment

Comments

@wuxiangpeng
Copy link

@OverRide
public int getItemViewType(int position) {
if (position == 0) {
return REFRESH_HEADER;
} else if (position == 1) {
return HEADER;
} else if (1 < position && position < mAdapter.getItemCount() + 2) {
return mAdapter.getItemViewType(position - 2);
} else if (position == mAdapter.getItemCount() + 2) {
return FOOTER;
} else if (position == mAdapter.getItemCount() + 3) {
return LOAD_MORE_FOOTER;
}

    throw new IllegalArgumentException("Wrong type! Position = " + position);
}
@Aspsine
Copy link
Owner

Aspsine commented Jan 8, 2020

Don't extends WrapperAdapter.
WrapperAdapter is inner class which wrapper your real adapter to do some hack thing like add header/footer etc...

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

2 participants