properly unmark previously active feed in feedlist when closing feed

This commit is contained in:
Andrew Dolgov 2012-01-19 13:54:14 +03:00
parent 288997831c
commit 2f62378980
2 changed files with 21 additions and 0 deletions

View File

@ -550,4 +550,9 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
return null;
}
}
public void setSelectedFeedId(int feedId) {
m_selectedFeedId = feedId;
}
}

View File

@ -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();