keep Special category always visible in root cat view to provide easier access to starred and other meta feeds
This commit is contained in:
parent
c8e8aaf850
commit
ac61881e3a
@ -340,19 +340,32 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
|
|||||||
m_cats.clear();
|
m_cats.clear();
|
||||||
|
|
||||||
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)
|
for (FeedCategory c : cats) {
|
||||||
m_cats.add(c);
|
if (c.id == -1) {
|
||||||
|
specialCatFound = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 */
|
||||||
|
Loading…
Reference in New Issue
Block a user