From ecde2b87cc61e8ece8f5251c2a596f25507b54fb Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 3 May 2020 12:45:59 -0400 Subject: [PATCH] Fix crash sources --- .../java/eu/kanade/tachiyomi/ui/source/SourceController.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt index f92ab3fbdd..dd038fe2ef 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceController.kt @@ -131,7 +131,8 @@ class SourceController : NucleusController(), ext_bottom_sheet.sheetBehavior?.addBottomSheetCallback(object : BottomSheetBehavior .BottomSheetCallback() { override fun onSlide(bottomSheet: View, progress: Float) { - shadow2?.alpha = (1 - max(0f, progress)) * 0.25f + val recycler = recycler ?: return + shadow2.alpha = (1 - max(0f, progress)) * 0.25f activity?.appbar?.elevation = max(progress * 15f, if (recycler.canScrollVertically(-1)) 15f else 0f) @@ -146,6 +147,7 @@ class SourceController : NucleusController(), } override fun onStateChanged(p0: View, state: Int) { + val ext_bottom_sheet = ext_bottom_sheet ?: return if (state == BottomSheetBehavior.STATE_EXPANDED) activity?.appbar?.y = 0f if (state == BottomSheetBehavior.STATE_EXPANDED || state == BottomSheetBehavior.STATE_COLLAPSED) {