experimental: set article pager and headlines fragment to retain instance
debug: open all articles on startup
This commit is contained in:
parent
05dec34be2
commit
02810f6eee
@ -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);
|
||||
|
@ -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) {
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user