Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public int getItemViewType(int position) {
- // if there is both footerResource and header
- switch (STATE) {
- case BOTH:
- if (position == 0) {
- return HEADER;
- } else if (position == list.length + 1) {
- return FOOTER;
- }
- return ITEM;
- case HEADER:
- return position == 0 ? HEADER : ITEM;
- case FOOTER:
- return position == list.length ? FOOTER : ITEM;
- default:
- return ITEM;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement