diff options
Diffstat (limited to 'org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java')
-rw-r--r-- | org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleFragment.java | 28 |
1 files changed, 27 insertions, 1 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 e4205f24..6a371c19 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 @@ -23,6 +23,8 @@ import android.webkit.WebView; import android.webkit.WebView.HitTestResult; import android.widget.TextView; +import com.shamanland.fab.ShowHideOnScroll; + import org.fox.ttrss.types.Article; import org.fox.ttrss.types.Attachment; import org.fox.ttrss.util.TypefaceCache; @@ -93,7 +95,31 @@ public class ArticleFragment extends Fragment { View view = inflater.inflate(useTitleWebView ? R.layout.article_fragment_compat : R.layout.article_fragment, container, false); if (m_article != null) { - + + View scrollView = view.findViewById(R.id.article_scrollview); + 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 (!useTitleWebView) { View scroll = view.findViewById(R.id.article_scrollview); |