offline: properly deselect current category when closing headlines

This commit is contained in:
Andrew Dolgov 2012-06-22 18:14:49 +04:00
parent 714efd1ed0
commit 8af33e3d7c

View File

@ -333,12 +333,19 @@ public class OfflineActivity extends FragmentActivity implements
OfflineFeedsFragment ff = (OfflineFeedsFragment) getSupportFragmentManager() OfflineFeedsFragment ff = (OfflineFeedsFragment) getSupportFragmentManager()
.findFragmentByTag(FRAG_FEEDS); .findFragmentByTag(FRAG_FEEDS);
OfflineFeedCategoriesFragment cf = (OfflineFeedCategoriesFragment) getSupportFragmentManager()
.findFragmentByTag(FRAG_CATS);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.headlines_fragment, new DummyFragment(), ""); ft.replace(R.id.headlines_fragment, new DummyFragment(), "");
ft.commit(); ft.commit();
if (ff != null) { if (ff != null) {
ff.setSelectedFeedId(-1); ff.setSelectedFeedId(0);
}
if (cf != null) {
cf.setSelectedFeedId(-1);
} }
refreshViews(); refreshViews();
@ -814,7 +821,7 @@ public class OfflineActivity extends FragmentActivity implements
if (!m_smallScreenMode) { if (!m_smallScreenMode) {
getActionBar().setDisplayHomeAsUpEnabled(m_selectedArticleId != 0); getActionBar().setDisplayHomeAsUpEnabled(m_selectedArticleId != 0);
} else { } else {
getActionBar().setDisplayHomeAsUpEnabled(m_selectedArticleId != 0 || m_activeFeedId != 0); getActionBar().setDisplayHomeAsUpEnabled(m_selectedArticleId != 0 || m_activeFeedId != 0 || m_activeCatId != -1);
} }
} }
} }