From 2f62378980fe821a62728a1a92d9e8b2bcba49e2 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 19 Jan 2012 13:54:14 +0300 Subject: [PATCH] properly unmark previously active feed in feedlist when closing feed --- src/org/fox/ttrss/FeedsFragment.java | 5 +++++ src/org/fox/ttrss/MainActivity.java | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/org/fox/ttrss/FeedsFragment.java b/src/org/fox/ttrss/FeedsFragment.java index 797df018..07682586 100644 --- a/src/org/fox/ttrss/FeedsFragment.java +++ b/src/org/fox/ttrss/FeedsFragment.java @@ -550,4 +550,9 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh return null; } } + + public void setSelectedFeedId(int feedId) { + m_selectedFeedId = feedId; + } + } diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index 0b475946..84ade258 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -799,6 +799,7 @@ public class MainActivity extends FragmentActivity implements OnlineServices { .setVisibility(View.VISIBLE); findViewById(R.id.headlines_fragment).setVisibility( View.GONE); + refreshCategories(); } else { findViewById(R.id.feeds_fragment).setVisibility( @@ -808,6 +809,14 @@ public class MainActivity extends FragmentActivity implements OnlineServices { refreshFeeds(); } + + FeedsFragment ff = (FeedsFragment) getSupportFragmentManager() + .findFragmentById(R.id.feeds_fragment); + + if (ff != null) { + ff.setSelectedFeedId(0); + } + m_activeFeed = null; initMainMenu(); @@ -833,6 +842,13 @@ public class MainActivity extends FragmentActivity implements OnlineServices { findViewById(R.id.headlines_fragment).setVisibility( View.INVISIBLE); + FeedsFragment ff = (FeedsFragment) getSupportFragmentManager() + .findFragmentById(R.id.feeds_fragment); + + if (ff != null) { + ff.setSelectedFeedId(0); + } + m_activeFeed = null; refreshFeeds();