mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fixed reader menu quickly disappearing when first opening
This commit is contained in:
parent
0816b62721
commit
dbac0aa48d
1 changed files with 4 additions and 3 deletions
|
@ -750,7 +750,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set initial visibility
|
// Set initial visibility
|
||||||
setMenuVisibility(menuVisible)
|
setMenuVisibility(menuVisible, false)
|
||||||
binding.chaptersSheet.chaptersBottomSheet.sheetBehavior?.isHideable = !menuVisible
|
binding.chaptersSheet.chaptersBottomSheet.sheetBehavior?.isHideable = !menuVisible
|
||||||
if (!menuVisible) binding.chaptersSheet.chaptersBottomSheet.sheetBehavior?.hide()
|
if (!menuVisible) binding.chaptersSheet.chaptersBottomSheet.sheetBehavior?.hide()
|
||||||
binding.chaptersSheet.root.sheetBehavior?.isGestureInsetBottomIgnored = true
|
binding.chaptersSheet.root.sheetBehavior?.isGestureInsetBottomIgnored = true
|
||||||
|
@ -879,6 +879,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
||||||
* [animate] the views.
|
* [animate] the views.
|
||||||
*/
|
*/
|
||||||
private fun setMenuVisibility(visible: Boolean, animate: Boolean = true) {
|
private fun setMenuVisibility(visible: Boolean, animate: Boolean = true) {
|
||||||
|
val oldVisibility = menuVisible
|
||||||
menuVisible = visible
|
menuVisible = visible
|
||||||
if (visible) coroutine?.cancel()
|
if (visible) coroutine?.cancel()
|
||||||
binding.viewerContainer.requestLayout()
|
binding.viewerContainer.requestLayout()
|
||||||
|
@ -893,7 +894,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
||||||
if (!binding.chaptersSheet.chaptersBottomSheet.sheetBehavior.isExpanded() && sheetManageNavColor) {
|
if (!binding.chaptersSheet.chaptersBottomSheet.sheetBehavior.isExpanded() && sheetManageNavColor) {
|
||||||
window.navigationBarColor = Color.TRANSPARENT
|
window.navigationBarColor = Color.TRANSPARENT
|
||||||
}
|
}
|
||||||
if (animate) {
|
if (animate && oldVisibility != menuVisible) {
|
||||||
if (!menuStickyVisible) {
|
if (!menuStickyVisible) {
|
||||||
val toolbarAnimation = AnimationUtils.loadAnimation(this, R.anim.enter_from_top)
|
val toolbarAnimation = AnimationUtils.loadAnimation(this, R.anim.enter_from_top)
|
||||||
toolbarAnimation.setAnimationListener(
|
toolbarAnimation.setAnimationListener(
|
||||||
|
@ -912,7 +913,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
||||||
wic.hide(systemBars())
|
wic.hide(systemBars())
|
||||||
}
|
}
|
||||||
|
|
||||||
if (animate) {
|
if (animate && oldVisibility != menuVisible) {
|
||||||
val toolbarAnimation = AnimationUtils.loadAnimation(this, R.anim.exit_to_top)
|
val toolbarAnimation = AnimationUtils.loadAnimation(this, R.anim.exit_to_top)
|
||||||
toolbarAnimation.setAnimationListener(
|
toolbarAnimation.setAnimationListener(
|
||||||
object : SimpleAnimationListener() {
|
object : SimpleAnimationListener() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue