From f2a45e5b536415e444a1ca64d9e3caf4741a3b03 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 11 Mar 2020 00:46:55 -0700 Subject: [PATCH] Fix crash on theme switching, reworded settings for catalouges --- .../main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt | 3 ++- app/src/main/res/menu/catalogue_main.xml | 2 +- app/src/main/res/values/strings.xml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt index 340e1751d4..c105a187ec 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/view/ViewExtensions.kt @@ -339,6 +339,7 @@ fun Controller.scrollViewWith(recycler: RecyclerView, super.onScrolled(recyclerView, dx, dy) if (router?.backstack?.lastOrNull()?.controller() == this@scrollViewWith && statusBarHeight > -1 && + activity != null && activity!!.appbar.height > 0) { activity!!.appbar.y -= dy activity!!.appbar.y = clamp( @@ -353,7 +354,7 @@ fun Controller.scrollViewWith(recycler: RecyclerView, super.onScrollStateChanged(recyclerView, newState) if (newState == RecyclerView.SCROLL_STATE_IDLE) { if (router?.backstack?.lastOrNull()?.controller() == this@scrollViewWith && - statusBarHeight > -1 && + statusBarHeight > -1 && activity != null && activity!!.appbar.height > 0) { val halfWay = abs((-activity!!.appbar.height.toFloat()) / 2) val shortAnimationDuration = resources?.getInteger( diff --git a/app/src/main/res/menu/catalogue_main.xml b/app/src/main/res/menu/catalogue_main.xml index 5a8f9c28e4..2b29f01aee 100644 --- a/app/src/main/res/menu/catalogue_main.xml +++ b/app/src/main/res/menu/catalogue_main.xml @@ -11,7 +11,7 @@ app:actionViewClass="androidx.appcompat.widget.SearchView"/> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index be02f8c9d6..389966fdb2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -42,6 +42,7 @@ Filter + View all sources View options Downloaded Not downloaded