diff options
author | Andrew Dolgov <[email protected]> | 2020-10-03 09:01:59 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-10-03 09:01:59 +0300 |
commit | 839f09b06e9175397b8f241fed8f5005eb064dd8 (patch) | |
tree | 0e6ebccc444c6e86abe97a371587aa3f84f31b53 /org.fox.ttrss/src/main/java/org/fox/ttrss/DetailActivity.java | |
parent | 4dcb992ce68f5ca050749cc9dfacd857a2f5c282 (diff) |
move fab to activity view out of specific fragments
Diffstat (limited to 'org.fox.ttrss/src/main/java/org/fox/ttrss/DetailActivity.java')
-rwxr-xr-x | org.fox.ttrss/src/main/java/org/fox/ttrss/DetailActivity.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/DetailActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/DetailActivity.java index 3452ffa8..3144fc74 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/DetailActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/DetailActivity.java @@ -13,6 +13,8 @@ import android.util.Log; import android.view.MenuItem; import android.view.View; +import com.google.android.material.floatingactionbutton.FloatingActionButton; + import org.fox.ttrss.types.Article; import org.fox.ttrss.types.ArticleList; import org.fox.ttrss.types.Feed; @@ -60,6 +62,21 @@ public class DetailActivity extends OnlineActivity implements HeadlinesEventList findViewById(R.id.headlines_fragment).setVisibility(View.GONE); } + FloatingActionButton fab = findViewById(R.id.detail_fab); + + if (fab != null && m_prefs.getBoolean("enable_article_fab", true)) { + fab.show(); + + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + if (m_activeArticle != null) { + openUri(Uri.parse(m_activeArticle.link)); + } + } + }); + } + if (savedInstanceState == null) { Intent i = getIntent(); |