summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-06-26 09:28:30 +0400
committerAndrew Dolgov <[email protected]>2012-06-26 09:28:30 +0400
commit71064b4edcf600ee354ceb6ce62b0608c3df0644 (patch)
tree832e87db85cd8ecf9c486dc4a130e9d800a96b3a /src
parent6099fbb7e2bf4b035f579e8c211bcb13c88432f2 (diff)
offline: properly restore views after rotation
add workaround against viewpager weirdness after rotation bump version
Diffstat (limited to 'src')
-rw-r--r--src/org/fox/ttrss/MainActivity.java4
-rw-r--r--src/org/fox/ttrss/offline/OfflineActivity.java13
2 files changed, 16 insertions, 1 deletions
diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java
index 3596b0dc..82d905b8 100644
--- a/src/org/fox/ttrss/MainActivity.java
+++ b/src/org/fox/ttrss/MainActivity.java
@@ -680,8 +680,10 @@ public class MainActivity extends CommonActivity implements OnlineServices {
if (isSmallScreen()) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
+ // temporary workaround against viewpager going a bit crazy when restoring after rotation
if (m_selectedArticle != null) {
- ft.hide(getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES));
+ ft.remove(getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE));
+ m_selectedArticle = null;
}
if (m_activeFeed != null) {
diff --git a/src/org/fox/ttrss/offline/OfflineActivity.java b/src/org/fox/ttrss/offline/OfflineActivity.java
index acc05852..50c8971f 100644
--- a/src/org/fox/ttrss/offline/OfflineActivity.java
+++ b/src/org/fox/ttrss/offline/OfflineActivity.java
@@ -311,6 +311,17 @@ public class OfflineActivity extends CommonActivity implements
findViewById(R.id.loading_container).setVisibility(View.GONE);
+ if (isSmallScreen()) {
+ FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
+
+ // temporary workaround against viewpager going a bit crazy when restoring after rotation
+ if (m_selectedArticleId != 0) {
+ ft.remove(getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE));
+ m_selectedArticleId = 0;
+ }
+ ft.commit();
+ }
+
if (m_activeFeedId == 0 && !m_activeFeedIsCat) {
FragmentTransaction ft = getSupportFragmentManager()
.beginTransaction();
@@ -334,6 +345,8 @@ public class OfflineActivity extends CommonActivity implements
ft.commit();
}
+
+
}
private void switchOnline() {