Reader no longer hides menu when double page spreads zoom in for certain conditions

For example, while scrubbing through chapters and when scrolling through pages while the current page is zooming in
This commit is contained in:
Jays2Kings 2023-02-16 17:06:39 -05:00
parent 480567419f
commit a70a05c99b
3 changed files with 10 additions and 3 deletions

View file

@ -227,7 +227,7 @@ class ReaderActivity : BaseActivity<ReaderActivityBinding>() {
field = value
(viewer as? PagerViewer)?.config?.hingeGapSize = value
}
val decimalFormat by lazy {
private val decimalFormat by lazy {
DecimalFormat(
"#.###",
DecimalFormatSymbols()
@ -1080,7 +1080,7 @@ class ReaderActivity : BaseActivity<ReaderActivityBinding>() {
}
fun hideMenu() {
if (menuVisible) {
if (menuVisible && !isScrollingThroughPagesOrChapters) {
setMenuVisibility(false)
}
}

View file

@ -181,7 +181,7 @@ class PagerPageHolder(
override fun onScaleChanged(newScale: Float) {
super.onScaleChanged(newScale)
viewer.activity.hideMenu()
viewer.hideMenuIfVisible(item)
}
override fun onImageLoadError() {

View file

@ -487,4 +487,11 @@ abstract class PagerViewer(val activity: ReaderActivity) : BaseViewer {
}
return false
}
fun hideMenuIfVisible(item: Any) {
val currentItem = adapter.joinedItems.getOrNull(pager.currentItem)
if (item == currentItem && isIdle) {
activity.hideMenu()
}
}
}