Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public enum TabItem {
- HOME(HomeFragment.class, R.string.tab_home_title, getIcons().getHomeIcon()),
- PHOTOS(PhotosFragment.class, R.string.tab_photos_title, getIcons().getPhotosIcon()),
- SPECIAL(SpecialFragment.class, R.string.tab_special_title, getIcons().getSpecialIcon()),
- NEWS(NewsFragment.class, R.string.tab_news_title, getIcons().getNewsIcon()),
- EMPTY_MORE(NewsFragment.class, R.string.tab_more_title, R.drawable.tab_empty_more_selector);
- private Class actionClass;
- public static String TAB_PREFIX = "TAB";
- private int tabTitle;
- private int selector;
- static IconModel getIcons(){
- SettingsAll settingsAll = NetworkDataSingleton.getInstance().getMenuSettings();
- IconModel model = new IconModel();
- IconPack iconPack = settingsAll.getIconPack();
- if (iconPack != null && iconPack.getUseCustom()){
- model.setEmpty(false);
- if (iconPack.getIconType().equalsIgnoreCase(ScreenBaseActivity.ICON_TYPE_COLORED)){
- model.setColoredIcon(true);
- model.setHomeIcon(R.drawable.ic_home_colored);
- model.setPhotosIcon(R.drawable.ic_photo_colored);
- model.setSpecialIcon(R.drawable.ic_special_colored);
- model.setNewsIcon(R.drawable.ic_news_colored);
- }
- if (iconPack.getIconType().equalsIgnoreCase(ScreenBaseActivity.ICON_TYPE_OUTLINE)){
- model.setColoredIcon(false);
- model.setHomeIcon(R.drawable.ic_home_outline);
- model.setPhotosIcon(R.drawable.ic_photo_outline);
- model.setSpecialIcon(R.drawable.ic_special_outline);
- model.setNewsIcon(R.drawable.ic_news_outline);
- }
- if (iconPack.getIconType().equalsIgnoreCase(ScreenBaseActivity.ICON_TYPE_SOLID)){
- model.setColoredIcon(false);
- model.setHomeIcon(R.drawable.ic_home_solid);
- model.setPhotosIcon(R.drawable.ic_photo_solid);
- model.setSpecialIcon(R.drawable.ic_special_solid);
- model.setNewsIcon(R.drawable.ic_news_solid);
- }
- } else {
- model.setEmpty(true);
- model.setColoredIcon(false);
- model.setHomeIcon(R.drawable.menu_icon_home_pre);
- model.setPhotosIcon(R.drawable.menu_icon_photos_pre);
- model.setSpecialIcon(R.drawable.menu_icon_special_pre);
- model.setNewsIcon(R.drawable.menu_icon_news_pre);
- }
- return model;
- }
- private TabItem(Class actionClass, int tabTitle, int selector) {
- this.actionClass = actionClass;
- this.tabTitle = tabTitle;
- this.selector = selector;
- }
- public Class getActionClass() {
- return this.actionClass;
- }
- public String getTabTitle(Context context) {
- SettingsDTO settings = Singleton.get_instance(context).getmSettings();
- switch (this) {
- case HOME:
- return settings.getmHomeTitle();
- case NEWS:
- return settings.getmNewsTitle();
- case PHOTOS:
- return settings.getmPhotoTitle();
- case SPECIAL:
- return settings.getmSpecialTitle();
- default:
- return settings.getmHomeTitle();
- }
- }
- public int getSelector() {
- return this.selector;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement