diff options
Diffstat (limited to 'org.fox.ttrss/src/main/java/org')
-rw-r--r-- | org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java | 36 | ||||
-rw-r--r-- | org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java | 34 |
2 files changed, 39 insertions, 31 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java index 6a371c19..873935d8 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java @@ -100,23 +100,27 @@ public class ArticleFragment extends Fragment { View fab = view.findViewById(R.id.article_fab); if (scrollView != null && fab != null) { - scrollView.setOnTouchListener(new ShowHideOnScroll(fab)); - - fab.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - try { - URL url = new URL(m_article.link.trim()); - String uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), - url.getPort(), url.getPath(), url.getQuery(), url.getRef()).toString(); - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); - startActivity(intent); - } catch (Exception e) { - e.printStackTrace(); - m_activity.toast(R.string.error_other_error); + if (m_prefs.getBoolean("enable_article_fab", true)) { + scrollView.setOnTouchListener(new ShowHideOnScroll(fab)); + + fab.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + try { + URL url = new URL(m_article.link.trim()); + String uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), + url.getPort(), url.getPath(), url.getQuery(), url.getRef()).toString(); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + m_activity.toast(R.string.error_other_error); + } } - } - }); + }); + } else { + fab.setVisibility(View.GONE); + } } diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java index b20c23f0..64e6c652 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineArticleFragment.java @@ -142,23 +142,27 @@ public class OfflineArticleFragment extends Fragment { View fab = view.findViewById(R.id.article_fab); if (scrollView != null && fab != null) { - scrollView.setOnTouchListener(new ShowHideOnScroll(fab)); + if (m_prefs.getBoolean("enable_article_fab", true)) { + scrollView.setOnTouchListener(new ShowHideOnScroll(fab)); - fab.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - try { - URL url = new URL(link.trim()); - String uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), - url.getPort(), url.getPath(), url.getQuery(), url.getRef()).toString(); - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); - startActivity(intent); - } catch (Exception e) { - e.printStackTrace(); - m_activity.toast(R.string.error_other_error); + fab.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + try { + URL url = new URL(link.trim()); + String uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), + url.getPort(), url.getPath(), url.getQuery(), url.getRef()).toString(); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); + startActivity(intent); + } catch (Exception e) { + e.printStackTrace(); + m_activity.toast(R.string.error_other_error); + } } - } - }); + }); + } else { + fab.setVisibility(View.GONE); + } } /* View scroll = view.findViewById(R.id.article_scrollview); |