From c8a5161d4f0d8922a3d3ec13802c0d1bbab98f5f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 24 Jan 2012 14:04:45 +0300 Subject: [PATCH] properly unmark categories when going back --- src/org/fox/ttrss/FeedCategoriesFragment.java | 4 ++++ src/org/fox/ttrss/MainActivity.java | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/org/fox/ttrss/FeedCategoriesFragment.java b/src/org/fox/ttrss/FeedCategoriesFragment.java index a9449e8b..4b7873d7 100644 --- a/src/org/fox/ttrss/FeedCategoriesFragment.java +++ b/src/org/fox/ttrss/FeedCategoriesFragment.java @@ -337,4 +337,8 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe m_selectedCatId = cat.id; m_adapter.notifyDataSetChanged(); } + + public void setSelectedCategoryId(int id) { + m_selectedCatId = id; + } } diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index 00d0ebf6..648e98bf 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -764,6 +764,13 @@ public class MainActivity extends FragmentActivity implements OnlineServices { findViewById(R.id.feeds_fragment).setVisibility(View.GONE); m_activeCategory = null; + + FeedCategoriesFragment cf = (FeedCategoriesFragment) getSupportFragmentManager() + .findFragmentById(R.id.cats_fragment); + + if (cf != null) { + cf.setSelectedCategoryId(0); + } initMainMenu(); refreshCategories(); @@ -794,12 +801,19 @@ public class MainActivity extends FragmentActivity implements OnlineServices { R.anim.slide_right)); } - if (m_activeFeed != null && m_activeFeed.is_cat) { + if (m_activeFeed.is_cat) { findViewById(R.id.cats_fragment) .setVisibility(View.VISIBLE); findViewById(R.id.headlines_fragment).setVisibility( View.GONE); + FeedCategoriesFragment cf = (FeedCategoriesFragment) getSupportFragmentManager() + .findFragmentById(R.id.cats_fragment); + + if (cf != null) { + cf.setSelectedCategoryId(0); + } + refreshCategories(); } else { findViewById(R.id.feeds_fragment).setVisibility(