Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. public enum TabItem {
  2. HOME(HomeFragment.class, R.string.tab_home_title, getIcons().getHomeIcon()),
  3. PHOTOS(PhotosFragment.class, R.string.tab_photos_title, getIcons().getPhotosIcon()),
  4. SPECIAL(SpecialFragment.class, R.string.tab_special_title, getIcons().getSpecialIcon()),
  5. NEWS(NewsFragment.class, R.string.tab_news_title, getIcons().getNewsIcon()),
  6. EMPTY_MORE(NewsFragment.class, R.string.tab_more_title, R.drawable.tab_empty_more_selector);
  7.  
  8. private Class actionClass;
  9. public static String TAB_PREFIX = "TAB";
  10. private int tabTitle;
  11. private int selector;
  12.  
  13. static IconModel getIcons(){
  14. SettingsAll settingsAll = NetworkDataSingleton.getInstance().getMenuSettings();
  15. IconModel model = new IconModel();
  16. IconPack iconPack = settingsAll.getIconPack();
  17.  
  18. if (iconPack != null && iconPack.getUseCustom()){
  19. model.setEmpty(false);
  20. if (iconPack.getIconType().equalsIgnoreCase(ScreenBaseActivity.ICON_TYPE_COLORED)){
  21. model.setColoredIcon(true);
  22. model.setHomeIcon(R.drawable.ic_home_colored);
  23. model.setPhotosIcon(R.drawable.ic_photo_colored);
  24. model.setSpecialIcon(R.drawable.ic_special_colored);
  25. model.setNewsIcon(R.drawable.ic_news_colored);
  26. }
  27. if (iconPack.getIconType().equalsIgnoreCase(ScreenBaseActivity.ICON_TYPE_OUTLINE)){
  28. model.setColoredIcon(false);
  29. model.setHomeIcon(R.drawable.ic_home_outline);
  30. model.setPhotosIcon(R.drawable.ic_photo_outline);
  31. model.setSpecialIcon(R.drawable.ic_special_outline);
  32. model.setNewsIcon(R.drawable.ic_news_outline);
  33. }
  34. if (iconPack.getIconType().equalsIgnoreCase(ScreenBaseActivity.ICON_TYPE_SOLID)){
  35. model.setColoredIcon(false);
  36. model.setHomeIcon(R.drawable.ic_home_solid);
  37. model.setPhotosIcon(R.drawable.ic_photo_solid);
  38. model.setSpecialIcon(R.drawable.ic_special_solid);
  39. model.setNewsIcon(R.drawable.ic_news_solid);
  40. }
  41. } else {
  42. model.setEmpty(true);
  43. model.setColoredIcon(false);
  44. model.setHomeIcon(R.drawable.menu_icon_home_pre);
  45. model.setPhotosIcon(R.drawable.menu_icon_photos_pre);
  46. model.setSpecialIcon(R.drawable.menu_icon_special_pre);
  47. model.setNewsIcon(R.drawable.menu_icon_news_pre);
  48. }
  49.  
  50. return model;
  51. }
  52.  
  53. private TabItem(Class actionClass, int tabTitle, int selector) {
  54. this.actionClass = actionClass;
  55. this.tabTitle = tabTitle;
  56. this.selector = selector;
  57. }
  58.  
  59. public Class getActionClass() {
  60. return this.actionClass;
  61. }
  62.  
  63. public String getTabTitle(Context context) {
  64. SettingsDTO settings = Singleton.get_instance(context).getmSettings();
  65. switch (this) {
  66. case HOME:
  67. return settings.getmHomeTitle();
  68. case NEWS:
  69. return settings.getmNewsTitle();
  70. case PHOTOS:
  71. return settings.getmPhotoTitle();
  72. case SPECIAL:
  73. return settings.getmSpecialTitle();
  74. default:
  75. return settings.getmHomeTitle();
  76. }
  77. }
  78.  
  79. public int getSelector() {
  80. return this.selector;
  81. }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement