add preference to disable fab

This commit is contained in:
Andrew Dolgov 2014-11-12 10:32:21 +04:00
parent fba3486928
commit 487d05e6c0
5 changed files with 47 additions and 32 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
android:versionCode="278"
android:versionName="1.70" >
android:versionCode="279"
android:versionName="1.71" >
<uses-sdk
android:minSdkVersion="9"

View File

@ -100,6 +100,7 @@ public class ArticleFragment extends Fragment {
View fab = view.findViewById(R.id.article_fab);
if (scrollView != null && fab != null) {
if (m_prefs.getBoolean("enable_article_fab", true)) {
scrollView.setOnTouchListener(new ShowHideOnScroll(fab));
fab.setOnClickListener(new OnClickListener() {
@ -117,6 +118,9 @@ public class ArticleFragment extends Fragment {
}
}
});
} else {
fab.setVisibility(View.GONE);
}
}

View File

@ -142,6 +142,7 @@ public class OfflineArticleFragment extends Fragment {
View fab = view.findViewById(R.id.article_fab);
if (scrollView != null && fab != null) {
if (m_prefs.getBoolean("enable_article_fab", true)) {
scrollView.setOnTouchListener(new ShowHideOnScroll(fab));
fab.setOnClickListener(new OnClickListener() {
@ -159,6 +160,9 @@ public class OfflineArticleFragment extends Fragment {
}
}
});
} else {
fab.setVisibility(View.GONE);
}
}
/* View scroll = view.findViewById(R.id.article_scrollview);

View File

@ -250,5 +250,7 @@
<string name="headlines_sort_articles_title">Sort articles</string>
<string name="fresh_articles">Fresh articles</string>
<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 while reading</string>
</resources>

View File

@ -143,6 +143,11 @@
android:defaultValue="true"
android:key="confirm_headlines_catchup"
android:title="@string/prefs_confirm_headlines_catchup" />
<CheckBoxPreference
android:defaultValue="true"
android:key="enable_article_fab"
android:summary="@string/prefs_enable_fab_long"
android:title="@string/prefs_enable_fab" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/offline_mode" >
<ListPreference