Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. private void setupTabIcons() {
  2.  
  3. TextView tabOne = (TextView) LayoutInflater.from(mContext).inflate(R.layout.custome_tab_with_icon, null);
  4. tabOne.setText("Home");
  5. tabOne.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.selector_home, 0, 0);
  6. tabLayout.getTabAt(0).setCustomView(tabOne);
  7.  
  8. TextView tabTwo = (TextView) LayoutInflater.from(mContext).inflate(R.layout.custome_tab_with_icon, null);
  9. tabTwo.setText("Search");
  10. tabTwo.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.selector_search, 0, 0);
  11. tabLayout.getTabAt(1).setCustomView(tabTwo);
  12.  
  13. TextView tabThree = (TextView) LayoutInflater.from(mContext).inflate(R.layout.custome_tab_with_icon, null);
  14. tabThree.setText("WishList");
  15. tabThree.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.selector_wishlist, 0, 0);
  16. tabLayout.getTabAt(2).setCustomView(tabThree);
  17.  
  18. TextView tabFour = (TextView) LayoutInflater.from(mContext).inflate(R.layout.custome_tab_with_icon, null);
  19. tabFour.setText("Cart");
  20. tabFour.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.selector_cart, 0, 0);
  21. tabLayout.getTabAt(3).setCustomView(tabFour);
  22.  
  23. TextView tabFive = (TextView) LayoutInflater.from(mContext).inflate(R.layout.custome_tab_with_icon, null);
  24. tabFive.setText("Account");
  25. tabFive.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.selector_accounts, 0, 0);
  26. tabLayout.getTabAt(4).setCustomView(tabFive);
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement