diff options
author | Andrew Dolgov <[email protected]> | 2014-11-12 22:26:27 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2014-11-12 22:26:27 +0300 |
commit | ac61881e3a01f87ed65f699c46911f5c1be41d87 (patch) | |
tree | 003277a5cc78fadd5b434ef7819e6ee9bc3ff10e /org.fox.ttrss/src/main/java | |
parent | c8e8aaf850c9caaff78ae3a4f74a905017804aa0 (diff) |
keep Special category always visible in root cat view to provide easier access to starred and other meta feeds
Diffstat (limited to 'org.fox.ttrss/src/main/java')
-rw-r--r-- | org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java index d3cffe21..4f793f5b 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedCategoriesFragment.java @@ -340,19 +340,32 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe m_cats.clear(); int apiLevel = m_activity.getApiLevel(); - + + boolean specialCatFound = false; + // virtual cats implemented in getCategories since api level 1 if (apiLevel == 0) { m_cats.add(new FeedCategory(-1, "Special", 0)); m_cats.add(new FeedCategory(-2, "Labels", 0)); m_cats.add(new FeedCategory(0, "Uncategorized", 0)); + + specialCatFound = true; } - for (FeedCategory c : cats) - m_cats.add(c); + for (FeedCategory c : cats) { + if (c.id == -1) { + specialCatFound = true; + } + + m_cats.add(c); + } sortCats(); - + + if (!specialCatFound) { + m_cats.add(0, new FeedCategory(-1, "Special", 0)); + } + /* if (m_cats.size() == 0) setLoadingStatus(R.string.no_feeds_to_display, false); else */ |