From 2637bcffa521717a6c2cb3231e9e36e24929d3dc Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Mon, 5 Apr 2021 21:55:24 -0400 Subject: [PATCH] Fix glitchy animation when first showing reader nav bar --- .../java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 6 ++++-- .../tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index 8faae2f80b..ccfc9c9ac0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -71,11 +71,13 @@ import eu.kanade.tachiyomi.util.view.collapse import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets import eu.kanade.tachiyomi.util.view.gone 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.isExpanded import eu.kanade.tachiyomi.util.view.snack import eu.kanade.tachiyomi.util.view.updateLayoutParams 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.widget.SimpleAnimationListener import eu.kanade.tachiyomi.widget.SimpleSeekBarListener @@ -234,9 +236,9 @@ class ReaderActivity : lastShiftDoubleState = savedInstanceState.get(SHIFT_DOUBLE_PAGES) as? Boolean indexPageToShift = savedInstanceState.get(SHIFTED_PAGE_INDEX) as? Int indexChapterToShift = savedInstanceState.get(SHIFTED_CHAP_INDEX) as? Long - binding.readerNav.root.isVisible = menuVisible + binding.readerNav.root.visInvisIf(menuVisible) } else { - binding.readerNav.root.gone() + binding.readerNav.root.invisible() } binding.chaptersSheet.chaptersBottomSheet.setup(this) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt index 86e907a966..d8ed9185c6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/chapter/ReaderChapterSheet.kt @@ -109,14 +109,14 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr activity.binding.readerNav.root.visible() } if (state == BottomSheetBehavior.STATE_EXPANDED) { - activity.binding.readerNav.root.gone() + activity.binding.readerNav.root.invisible() activity.binding.readerNav.root.alpha = 0f binding.chapterRecycler.alpha = 1f if (activity.sheetManageNavColor) activity.window.navigationBarColor = primary } if (state == BottomSheetBehavior.STATE_HIDDEN) { 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.isFocusable = state == BottomSheetBehavior.STATE_EXPANDED