keep Special category always visible in root cat view to provide easier access to starred and other meta feeds

This commit is contained in:
Andrew Dolgov 2014-11-12 22:26:27 +03:00
parent c8e8aaf850
commit ac61881e3a

View File

@ -341,18 +341,31 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
int apiLevel = m_activity.getApiLevel(); int apiLevel = m_activity.getApiLevel();
boolean specialCatFound = false;
// virtual cats implemented in getCategories since api level 1 // virtual cats implemented in getCategories since api level 1
if (apiLevel == 0) { if (apiLevel == 0) {
m_cats.add(new FeedCategory(-1, "Special", 0)); m_cats.add(new FeedCategory(-1, "Special", 0));
m_cats.add(new FeedCategory(-2, "Labels", 0)); m_cats.add(new FeedCategory(-2, "Labels", 0));
m_cats.add(new FeedCategory(0, "Uncategorized", 0)); m_cats.add(new FeedCategory(0, "Uncategorized", 0));
specialCatFound = true;
}
for (FeedCategory c : cats) {
if (c.id == -1) {
specialCatFound = true;
} }
for (FeedCategory c : cats)
m_cats.add(c); m_cats.add(c);
}
sortCats(); sortCats();
if (!specialCatFound) {
m_cats.add(0, new FeedCategory(-1, "Special", 0));
}
/* if (m_cats.size() == 0) /* if (m_cats.size() == 0)
setLoadingStatus(R.string.no_feeds_to_display, false); setLoadingStatus(R.string.no_feeds_to_display, false);
else */ else */