From b69e0ae6bc49c7b47f2d266e9896ffe4472540ea Mon Sep 17 00:00:00 2001 From: davidoskky Date: Thu, 26 Jan 2023 16:22:42 +0100 Subject: [PATCH] Handle public access in the article fragment Remove the button to read/unread articles --- .../android/fragments/ArticleFragment.kt | 3 +++ .../src/main/res/layout/fragment_article.xml | 5 ++--- .../src/main/res/menu/reader_toolbar_no_read.xml | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 androidApp/src/main/res/menu/reader_toolbar_no_read.xml diff --git a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt index 3fb842c..4dd0221 100644 --- a/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt +++ b/androidApp/src/main/java/bou/amine/apps/readerforselfossv2/android/fragments/ArticleFragment.kt @@ -195,6 +195,9 @@ class ArticleFragment : Fragment(), DIAware { private fun handleFloatingToolbar(): FloatingToolbar { val floatingToolbar: FloatingToolbar = binding.floatingToolbar + if (appSettingsService.getPublicAccess()) { + floatingToolbar.setMenu(R.menu.reader_toolbar_no_read) + } floatingToolbar.attachFab(fab) floatingToolbar.background = ColorDrawable(resources.getColor(R.color.colorAccent)) diff --git a/androidApp/src/main/res/layout/fragment_article.xml b/androidApp/src/main/res/layout/fragment_article.xml index 8e6db28..664015d 100644 --- a/androidApp/src/main/res/layout/fragment_article.xml +++ b/androidApp/src/main/res/layout/fragment_article.xml @@ -83,7 +83,7 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintLeft_toLeftOf="parent" - android:layout_gravity="end|bottom|right"> + android:layout_gravity="end|bottom|end"> + + + + + + \ No newline at end of file