allow closing active feed in tablet mode

This commit is contained in:
Andrew Dolgov 2012-01-18 12:01:02 +03:00
parent 3fd2afa44b
commit a1337b531e
2 changed files with 20 additions and 0 deletions

View File

@ -829,6 +829,15 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
closeArticle(); closeArticle();
} else if (m_activeCategory != null) { } else if (m_activeCategory != null) {
closeCategory(); closeCategory();
} else if (m_activeFeed != null) {
findViewById(R.id.headlines_fragment).setVisibility(
View.INVISIBLE);
m_activeFeed = null;
refreshFeeds();
initMainMenu();
} else if (allowQuit) { } else if (allowQuit) {
finish(); finish();
} }
@ -1405,6 +1414,8 @@ public class MainActivity extends FragmentActivity implements OnlineServices {
if (m_smallScreenMode) { if (m_smallScreenMode) {
findViewById(R.id.feeds_fragment).setVisibility(View.GONE); findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE); findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
} else {
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
} }
if (!append) { if (!append) {

View File

@ -337,6 +337,13 @@ public class OfflineActivity extends FragmentActivity implements
} else { } else {
if (m_selectedArticleId != 0) { if (m_selectedArticleId != 0) {
closeArticle(); closeArticle();
} else if (m_activeFeedId != 0) {
findViewById(R.id.headlines_fragment).setVisibility(View.INVISIBLE);
m_activeFeedId = 0;
refreshViews();
initMainMenu();
} else if (allowQuit) { } else if (allowQuit) {
finish(); finish();
} }
@ -960,6 +967,8 @@ public class OfflineActivity extends FragmentActivity implements
if (m_smallScreenMode) { if (m_smallScreenMode) {
findViewById(R.id.feeds_fragment).setVisibility(View.GONE); findViewById(R.id.feeds_fragment).setVisibility(View.GONE);
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE); findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
} else {
findViewById(R.id.headlines_fragment).setVisibility(View.VISIBLE);
} }
deselectAllArticles(); deselectAllArticles();