mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-14 03:55:06 +01:00
Fix glitchy animation when first showing reader nav bar
This commit is contained in:
parent
6edc15683e
commit
2637bcffa5
@ -71,11 +71,13 @@ import eu.kanade.tachiyomi.util.view.collapse
|
|||||||
import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets
|
import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets
|
||||||
import eu.kanade.tachiyomi.util.view.gone
|
import eu.kanade.tachiyomi.util.view.gone
|
||||||
import eu.kanade.tachiyomi.util.view.hide
|
import eu.kanade.tachiyomi.util.view.hide
|
||||||
|
import eu.kanade.tachiyomi.util.view.invisible
|
||||||
import eu.kanade.tachiyomi.util.view.isCollapsed
|
import eu.kanade.tachiyomi.util.view.isCollapsed
|
||||||
import eu.kanade.tachiyomi.util.view.isExpanded
|
import eu.kanade.tachiyomi.util.view.isExpanded
|
||||||
import eu.kanade.tachiyomi.util.view.snack
|
import eu.kanade.tachiyomi.util.view.snack
|
||||||
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
import eu.kanade.tachiyomi.util.view.updateLayoutParams
|
||||||
import eu.kanade.tachiyomi.util.view.updatePaddingRelative
|
import eu.kanade.tachiyomi.util.view.updatePaddingRelative
|
||||||
|
import eu.kanade.tachiyomi.util.view.visInvisIf
|
||||||
import eu.kanade.tachiyomi.util.view.visible
|
import eu.kanade.tachiyomi.util.view.visible
|
||||||
import eu.kanade.tachiyomi.widget.SimpleAnimationListener
|
import eu.kanade.tachiyomi.widget.SimpleAnimationListener
|
||||||
import eu.kanade.tachiyomi.widget.SimpleSeekBarListener
|
import eu.kanade.tachiyomi.widget.SimpleSeekBarListener
|
||||||
@ -234,9 +236,9 @@ class ReaderActivity :
|
|||||||
lastShiftDoubleState = savedInstanceState.get(SHIFT_DOUBLE_PAGES) as? Boolean
|
lastShiftDoubleState = savedInstanceState.get(SHIFT_DOUBLE_PAGES) as? Boolean
|
||||||
indexPageToShift = savedInstanceState.get(SHIFTED_PAGE_INDEX) as? Int
|
indexPageToShift = savedInstanceState.get(SHIFTED_PAGE_INDEX) as? Int
|
||||||
indexChapterToShift = savedInstanceState.get(SHIFTED_CHAP_INDEX) as? Long
|
indexChapterToShift = savedInstanceState.get(SHIFTED_CHAP_INDEX) as? Long
|
||||||
binding.readerNav.root.isVisible = menuVisible
|
binding.readerNav.root.visInvisIf(menuVisible)
|
||||||
} else {
|
} else {
|
||||||
binding.readerNav.root.gone()
|
binding.readerNav.root.invisible()
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.chaptersSheet.chaptersBottomSheet.setup(this)
|
binding.chaptersSheet.chaptersBottomSheet.setup(this)
|
||||||
|
@ -109,14 +109,14 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr
|
|||||||
activity.binding.readerNav.root.visible()
|
activity.binding.readerNav.root.visible()
|
||||||
}
|
}
|
||||||
if (state == BottomSheetBehavior.STATE_EXPANDED) {
|
if (state == BottomSheetBehavior.STATE_EXPANDED) {
|
||||||
activity.binding.readerNav.root.gone()
|
activity.binding.readerNav.root.invisible()
|
||||||
activity.binding.readerNav.root.alpha = 0f
|
activity.binding.readerNav.root.alpha = 0f
|
||||||
binding.chapterRecycler.alpha = 1f
|
binding.chapterRecycler.alpha = 1f
|
||||||
if (activity.sheetManageNavColor) activity.window.navigationBarColor = primary
|
if (activity.sheetManageNavColor) activity.window.navigationBarColor = primary
|
||||||
}
|
}
|
||||||
if (state == BottomSheetBehavior.STATE_HIDDEN) {
|
if (state == BottomSheetBehavior.STATE_HIDDEN) {
|
||||||
activity.binding.readerNav.root.alpha = 0f
|
activity.binding.readerNav.root.alpha = 0f
|
||||||
activity.binding.readerNav.root.gone()
|
activity.binding.readerNav.root.invisible()
|
||||||
}
|
}
|
||||||
binding.chapterRecycler.isClickable = state == BottomSheetBehavior.STATE_EXPANDED
|
binding.chapterRecycler.isClickable = state == BottomSheetBehavior.STATE_EXPANDED
|
||||||
binding.chapterRecycler.isFocusable = state == BottomSheetBehavior.STATE_EXPANDED
|
binding.chapterRecycler.isFocusable = state == BottomSheetBehavior.STATE_EXPANDED
|
||||||
|
Loading…
Reference in New Issue
Block a user