offline: properly restore views after rotation

add workaround against viewpager weirdness after rotation
bump version
This commit is contained in:
Andrew Dolgov 2012-06-26 09:28:30 +04:00
parent 6099fbb7e2
commit 71064b4edc
3 changed files with 18 additions and 3 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
android:versionCode="81"
android:versionName="0.6.5" >
android:versionCode="82"
android:versionName="0.6.6" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11" />

View File

@ -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) {

View File

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