Add option to always show the bottom bar in the article reader (#368)

This commit is contained in:
2021-10-26 20:16:38 +02:00
committed by GitHub
parent ae32cbfb6f
commit 1994fa2f7d
3 changed files with 23 additions and 1 deletions
@@ -77,6 +77,7 @@ class ArticleFragment : Fragment() {
private var typeface: Typeface? = null
private var resId: Int = 0
private var font = ""
private var staticBar = false
override fun onStop() {
super.onStop()
@@ -118,6 +119,7 @@ class ArticleFragment : Fragment() {
prefs = PreferenceManager.getDefaultSharedPreferences(activity)
editor = prefs.edit()
fontSize = prefs.getString("reader_font_size", "16")!!.toInt()
staticBar = prefs.getBoolean("reader_static_bar", false)
font = prefs.getString("reader_font", "")!!
if (font.isNotEmpty()) {
@@ -211,6 +213,11 @@ class ArticleFragment : Fragment() {
}
)
if (staticBar) {
fab.hide()
floatingToolbar.show()
}
binding.source.text = contentSource
if (typeface != null) {
binding.source.typeface = typeface
@@ -242,9 +249,14 @@ class ArticleFragment : Fragment() {
binding.nestedScrollView.setOnScrollChangeListener(
NestedScrollView.OnScrollChangeListener { _, _, scrollY, _, oldScrollY ->
if (scrollY > oldScrollY) {
floatingToolbar.hide()
fab.hide()
} else {
if (floatingToolbar.isShowing) floatingToolbar.hide() else fab.show()
if (staticBar) {
floatingToolbar.show()
} else {
if (floatingToolbar.isShowing) floatingToolbar.hide() else fab.show()
}
}
}
)
Internal Server Error - Amine's git
500 Internal Server Error

Gitea Version: 1.28.0+dev-210-gd87d26d735