diff options
author | Andrew Dolgov <[email protected]> | 2017-05-31 18:23:17 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-05-31 18:23:17 +0300 |
commit | 02810f6eee11927991f2c2cb2423b83af8c62caf (patch) | |
tree | f65d1ee41226a1b7231262223d78da8ea90c1a07 | |
parent | 05dec34be271e20f7ee309b6a7173f8cd04a7b20 (diff) |
experimental: set article pager and headlines fragment to retain instance
debug: open all articles on startup
3 files changed, 22 insertions, 3 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java index 6e51722c..ac621191 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java @@ -88,7 +88,14 @@ public class ArticlePager extends Fragment { public void setSearchQuery(String searchQuery) { m_searchQuery = searchQuery; } - + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setRetainInstance(true); + } + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.article_pager, container, false); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index 880bf384..1967f5cb 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -435,7 +435,14 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, super.onCreateContextMenu(menu, v, menuInfo); } - + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setRetainInstance(true); + } + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java index 51781582..1c557df9 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java @@ -151,7 +151,12 @@ public class MasterActivity extends OnlineActivity implements HeadlinesEventList if (m_prefs.getBoolean("open_fresh_on_startup", true)) { HeadlinesFragment hf = new HeadlinesFragment(); - hf.initialize(new Feed(-3, getString(R.string.fresh_articles), false)); + + if (BuildConfig.DEBUG) { + hf.initialize(new Feed(-4, "All articles", false)); + } else { + hf.initialize(new Feed(-3, getString(R.string.fresh_articles), false)); + } ft.replace(R.id.headlines_fragment, hf, FRAG_HEADLINES); } else if (m_drawerLayout != null) { |