mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
extra fixes to opening reading menu
This commit is contained in:
parent
7fe8baae8c
commit
4b26cf7c2b
1 changed files with 6 additions and 3 deletions
|
@ -755,12 +755,15 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
|||
if (!menuVisible) binding.chaptersSheet.chaptersBottomSheet.sheetBehavior?.hide()
|
||||
binding.chaptersSheet.root.sheetBehavior?.isGestureInsetBottomIgnored = true
|
||||
val peek = 50.dpToPx
|
||||
lastVis = window.decorView.rootWindowInsetsCompat?.isVisible(statusBars()) ?: false
|
||||
var firstPass = true
|
||||
binding.readerLayout.doOnApplyWindowInsetsCompat { _, insets, _ ->
|
||||
setNavColor(insets)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
if (lastVis != insets.isVisible(statusBars()) && preferences.fullscreen().get()) {
|
||||
if (!firstPass && lastVis != insets.isVisible(statusBars()) && preferences.fullscreen().get()) {
|
||||
onVisibilityChange(insets.isVisible(statusBars()))
|
||||
}
|
||||
firstPass = false
|
||||
lastVis = insets.isVisible(statusBars())
|
||||
}
|
||||
|
||||
|
@ -913,7 +916,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
|||
wic.hide(systemBars())
|
||||
}
|
||||
|
||||
if (animate && oldVisibility != menuVisible) {
|
||||
if (animate && binding.readerMenu.isVisible) {
|
||||
val toolbarAnimation = AnimationUtils.loadAnimation(this, R.anim.exit_to_top)
|
||||
toolbarAnimation.setAnimationListener(
|
||||
object : SimpleAnimationListener() {
|
||||
|
@ -925,7 +928,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
|||
binding.appBar.startAnimation(toolbarAnimation)
|
||||
BottomSheetBehavior.from(binding.chaptersSheet.chaptersBottomSheet).isHideable = true
|
||||
binding.chaptersSheet.chaptersBottomSheet.sheetBehavior?.hide()
|
||||
} else {
|
||||
} else if (!animate) {
|
||||
binding.readerMenu.isVisible = false
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue