fragment navigation tweaks

This commit is contained in:
Andrew Dolgov 2012-06-25 14:40:23 +04:00
parent 6262231fe1
commit f2457b4f7c
2 changed files with 7 additions and 4 deletions

View File

@ -200,7 +200,9 @@ public class MainActivity extends CommonActivity implements OnlineServices {
findViewById(R.id.article_fragment).setVisibility(View.GONE); findViewById(R.id.article_fragment).setVisibility(View.GONE);
findViewById(R.id.feeds_fragment).setVisibility(View.VISIBLE); findViewById(R.id.feeds_fragment).setVisibility(View.VISIBLE);
ft.replace(R.id.headlines_fragment, new DummyFragment(), ""); updateHeadlines();
//ft.replace(R.id.headlines_fragment, new DummyFragment(), "");
} }
ft.commit(); ft.commit();
@ -1768,7 +1770,7 @@ public class MainActivity extends CommonActivity implements OnlineServices {
m_activeFeed = feed; m_activeFeed = feed;
if (!append) { if (!append) {
m_selectedArticle = null; //m_selectedArticle = null;
if (m_menu != null) { if (m_menu != null) {
MenuItem search = m_menu.findItem(R.id.search); MenuItem search = m_menu.findItem(R.id.search);
@ -1793,7 +1795,7 @@ public class MainActivity extends CommonActivity implements OnlineServices {
ft.add(R.id.fragment_container, hf, FRAG_HEADLINES); ft.add(R.id.fragment_container, hf, FRAG_HEADLINES);
} else { } else {
findViewById(R.id.article_fragment).setVisibility(View.GONE); //findViewById(R.id.article_fragment).setVisibility(View.GONE);
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE); findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
ft.replace(R.id.headlines_fragment, hf, FRAG_HEADLINES); ft.replace(R.id.headlines_fragment, hf, FRAG_HEADLINES);
} }

View File

@ -125,6 +125,7 @@ public class OfflineActivity extends CommonActivity implements
@Override @Override
public void onItemSelected() { public void onItemSelected() {
m_selectedArticleId = 0; m_selectedArticleId = 0;
m_activeFeedId = 0;
FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
@ -148,7 +149,7 @@ public class OfflineActivity extends CommonActivity implements
findViewById(R.id.feeds_fragment).setVisibility(View.VISIBLE); findViewById(R.id.feeds_fragment).setVisibility(View.VISIBLE);
//findViewById(R.id.article_fragment).setVisibility(View.GONE); //findViewById(R.id.article_fragment).setVisibility(View.GONE);
ft.replace(R.id.headlines_fragment, new DummyFragment(), ""); //ft.replace(R.id.headlines_fragment, new DummyFragment(), "");
} }
ft.commit(); ft.commit();