add option to not load fresh feed on start

This commit is contained in:
Andrew Dolgov 2014-11-13 19:46:36 +03:00
parent 3e4222f595
commit c4d979c1bf
3 changed files with 13 additions and 3 deletions

View File

@ -144,10 +144,14 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
ft.replace(R.id.feeds_fragment, new FeedsFragment(), FRAG_FEEDS);
}
if (m_prefs.getBoolean("open_fresh_on_startup", true)) {
HeadlinesFragment hf = new HeadlinesFragment();
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) {
m_drawerLayout.openDrawer(Gravity.START);
}
ft.commit();

View File

@ -253,5 +253,6 @@
<string name="feed_all_articles">All articles</string>
<string name="prefs_enable_fab">Enable FAB</string>
<string name="prefs_enable_fab_long">Show floating action button when reading</string>
<string name="prefs_open_fresh_on_startup">Open Fresh feed on startup</string>
</resources>

View File

@ -114,6 +114,11 @@
android:dialogMessage="@string/pref_headline_font_size"
android:title="@string/pref_headline_font_size" />
<CheckBoxPreference
android:defaultValue="true"
android:key="open_fresh_on_startup"
android:title="@string/prefs_open_fresh_on_startup" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/reading" >
<org.fox.ttrss.util.FontSizeDialogPreference