Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. @Override
  2. public int getItemViewType(int position) {
  3. // if there is both footerResource and header
  4. switch (STATE) {
  5. case BOTH:
  6. if (position == 0) {
  7. return HEADER;
  8. } else if (position == list.length + 1) {
  9. return FOOTER;
  10. }
  11. return ITEM;
  12. case HEADER:
  13. return position == 0 ? HEADER : ITEM;
  14. case FOOTER:
  15. return position == list.length ? FOOTER : ITEM;
  16. default:
  17. return ITEM;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement