private void setFilterInTitle() { Filter filter = list.getFilter(); ArticleType type = filter.getType(); String tagOrSource; if (filter.getTag() != null) { tagOrSource = filter.getTag().getName(this); } else { tagOrSource = filter.getSource().getTitle(); } setTitle(String.format("%s (%s)", tagOrSource, type.getName(this))); }
@AfterViews protected void initViews() { drawerToggle = new ActionBarDrawerToggle( this, drawer, R.drawable.ic_drawer, R.string.app_name, R.string.app_name); drawer.setDrawerListener(this); getActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setHomeButtonEnabled(true); ArticleType type = ArticleType.values()[prefs.articleTypeIndex().get()]; list.setArticleType(type); list.setListener(this); menu.setArticleType(type); menu.setListener(this); setFilterInTitle(); }