save more GlobalState stuff
This commit is contained in:
parent
98c4325d8b
commit
89ee4a84be
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.fox.ttrss"
|
package="org.fox.ttrss"
|
||||||
android:versionCode="114"
|
android:versionCode="115"
|
||||||
android:versionName="0.8.13" >
|
android:versionName="0.8.14" >
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="8"
|
android:minSdkVersion="8"
|
||||||
|
@ -46,9 +46,7 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
|||||||
|
|
||||||
setSmallScreen(findViewById(R.id.headlines_fragment) == null);
|
setSmallScreen(findViewById(R.id.headlines_fragment) == null);
|
||||||
|
|
||||||
if (isSmallScreen()) {
|
|
||||||
GlobalState.getInstance().load(savedInstanceState);
|
GlobalState.getInstance().load(savedInstanceState);
|
||||||
}
|
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
|
|
||||||
@ -250,10 +248,8 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
|||||||
public void onSaveInstanceState(Bundle out) {
|
public void onSaveInstanceState(Bundle out) {
|
||||||
super.onSaveInstanceState(out);
|
super.onSaveInstanceState(out);
|
||||||
|
|
||||||
if (isSmallScreen()) {
|
|
||||||
GlobalState.getInstance().save(out);
|
GlobalState.getInstance().save(out);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
|
@ -38,6 +38,9 @@ public class GlobalState extends Application {
|
|||||||
out.putParcelable("gs:activeFeed", m_activeFeed);
|
out.putParcelable("gs:activeFeed", m_activeFeed);
|
||||||
out.putParcelable("gs:activeArticle", m_activeArticle);
|
out.putParcelable("gs:activeArticle", m_activeArticle);
|
||||||
out.putString("gs:sessionId", m_sessionId);
|
out.putString("gs:sessionId", m_sessionId);
|
||||||
|
out.putInt("gs:apiLevel", m_apiLevel);
|
||||||
|
out.putBoolean("gs:canUseProgress", m_canUseProgress);
|
||||||
|
out.putInt("gs:selectedArticleId", m_selectedArticleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load(Bundle in) {
|
public void load(Bundle in) {
|
||||||
@ -51,6 +54,9 @@ public class GlobalState extends Application {
|
|||||||
m_activeFeed = (Feed) in.getParcelable("gs:activeFeed");
|
m_activeFeed = (Feed) in.getParcelable("gs:activeFeed");
|
||||||
m_activeArticle = (Article) in.getParcelable("gs:activeArticle");
|
m_activeArticle = (Article) in.getParcelable("gs:activeArticle");
|
||||||
m_sessionId = in.getString("gs:sessionId");
|
m_sessionId = in.getString("gs:sessionId");
|
||||||
|
m_apiLevel = in.getInt("gs:apiLevel");
|
||||||
|
m_canUseProgress = in.getBoolean("gs:canUseProgress");
|
||||||
|
m_selectedArticleId = in.getInt("gs:selectedArticleId");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,8 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL
|
|||||||
|
|
||||||
setSmallScreen(findViewById(R.id.headlines_fragment) == null);
|
setSmallScreen(findViewById(R.id.headlines_fragment) == null);
|
||||||
|
|
||||||
|
GlobalState.getInstance().load(savedInstanceState);
|
||||||
|
|
||||||
if (isPortrait()) {
|
if (isPortrait()) {
|
||||||
findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
|
findViewById(R.id.headlines_fragment).setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
@ -115,6 +117,8 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL
|
|||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(Bundle out) {
|
public void onSaveInstanceState(Bundle out) {
|
||||||
super.onSaveInstanceState(out);
|
super.onSaveInstanceState(out);
|
||||||
|
|
||||||
|
GlobalState.getInstance().save(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user