do not send headines as parcelable because ughhhh

This commit is contained in:
Andrew Dolgov 2015-02-16 14:52:12 +03:00
parent 7a4dc9de3d
commit 947c8dd6a3
4 changed files with 11 additions and 12 deletions

View File

@ -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="314" android:versionCode="315"
android:versionName="1.90" > android:versionName="1.91" >
<uses-sdk <uses-sdk
android:minSdkVersion="15" android:minSdkVersion="15"

View File

@ -8,7 +8,6 @@ import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.os.Parcelable;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction; import android.support.v4.app.FragmentTransaction;
@ -444,8 +443,8 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
intent.putExtra("feed", hf.getFeed()); intent.putExtra("feed", hf.getFeed());
intent.putExtra("article", article); intent.putExtra("article", article);
intent.putExtra("searchQuery", hf.getSearchQuery()); intent.putExtra("searchQuery", hf.getSearchQuery());
//intent.putParcelableArrayListExtra("articles", hf.getArticles()); //intent.putExtra("articles", (Parcelable)hf.getAllArticles());
intent.putExtra("articles", (Parcelable)hf.getAllArticles()); GlobalState.getInstance().tmpArticleList = hf.getAllArticles();
/* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { /* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
startActivityForResult(intent, HEADLINES_REQUEST, ActivityOptions.makeSceneTransitionAnimation(this).toBundle()); startActivityForResult(intent, HEADLINES_REQUEST, ActivityOptions.makeSceneTransitionAnimation(this).toBundle());
@ -498,7 +497,7 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
//ArrayList<Article> tmp = data.getParcelableArrayListExtra("articles"); //ArrayList<Article> tmp = data.getParcelableArrayListExtra("articles");
Article article = data.getParcelableExtra("activeArticle"); Article article = data.getParcelableExtra("activeArticle");
ArticleList articles = data.getParcelableExtra("articles"); ArticleList articles = GlobalState.getInstance().tmpArticleList;
if (articles != null) { if (articles != null) {
HeadlinesFragment hf = (HeadlinesFragment)getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES); HeadlinesFragment hf = (HeadlinesFragment)getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);

View File

@ -3,9 +3,10 @@ package org.fox.ttrss;
import android.app.Application; import android.app.Application;
import android.os.Bundle; import android.os.Bundle;
import org.acra.ACRA;
import org.acra.ReportingInteractionMode; import org.acra.ReportingInteractionMode;
import org.acra.annotation.ReportsCrashes; import org.acra.annotation.ReportsCrashes;
import org.fox.ttrss.types.ArticleList;
@ReportsCrashes(formKey = "", mode = ReportingInteractionMode.DIALOG, @ReportsCrashes(formKey = "", mode = ReportingInteractionMode.DIALOG,
excludeMatchingSharedPreferencesKeys = {"password"}, excludeMatchingSharedPreferencesKeys = {"password"},
resDialogText = R.string.crash_dialog_text, resDialogText = R.string.crash_dialog_text,
@ -13,7 +14,7 @@ import org.acra.annotation.ReportsCrashes;
public class GlobalState extends Application { public class GlobalState extends Application {
private static GlobalState m_singleton; private static GlobalState m_singleton;
//public ArticleList m_loadedArticles = new ArticleList(); public ArticleList tmpArticleList;
//public Feed m_activeFeed; //public Feed m_activeFeed;
//public Article m_activeArticle; //public Article m_activeArticle;
public int m_selectedArticleId; public int m_selectedArticleId;
@ -28,7 +29,7 @@ public class GlobalState extends Application {
@Override @Override
public final void onCreate() { public final void onCreate() {
super.onCreate(); super.onCreate();
ACRA.init(this); //ACRA.init(this);
m_singleton = this; m_singleton = this;
} }

View File

@ -7,7 +7,6 @@ import android.content.SharedPreferences;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Parcelable;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v4.app.FragmentTransaction; import android.support.v4.app.FragmentTransaction;
import android.util.Log; import android.util.Log;
@ -79,7 +78,7 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL
final Article article = i.getParcelableExtra("article"); final Article article = i.getParcelableExtra("article");
final String searchQuery = i.getStringExtra("searchQuery"); final String searchQuery = i.getStringExtra("searchQuery");
ArticleList tmp = i.getParcelableExtra("articles"); ArticleList tmp = GlobalState.getInstance().tmpArticleList;
if (tmp != null) { if (tmp != null) {
m_articles.addAll(tmp); m_articles.addAll(tmp);
@ -309,7 +308,7 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL
public void onBackPressed() { public void onBackPressed() {
Intent resultIntent = new Intent(); Intent resultIntent = new Intent();
resultIntent.putExtra("articles", (Parcelable) m_articles); GlobalState.getInstance().tmpArticleList = m_articles;
resultIntent.putExtra("activeArticle", m_activeArticle); resultIntent.putExtra("activeArticle", m_activeArticle);
setResult(Activity.RESULT_OK, resultIntent); setResult(Activity.RESULT_OK, resultIntent);