From 720a78d968f9551a4c757ef1afc529181a92f015 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Fri, 9 Apr 2021 01:52:41 -0400 Subject: [PATCH] Fixed initial scroll of categories on SetCategoriesSheet --- .../ui/category/addtolibrary/SetCategoriesSheet.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/category/addtolibrary/SetCategoriesSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/category/addtolibrary/SetCategoriesSheet.kt index 9c6120347f..510058e1de 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/category/addtolibrary/SetCategoriesSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/category/addtolibrary/SetCategoriesSheet.kt @@ -155,9 +155,6 @@ class SetCategoriesSheet( ) } ) - binding.categoryRecyclerView.scrollToPosition( - max(0, itemAdapter.adapterItems.indexOf(selectExtension.selectedItems.firstOrNull())) - ) } override fun onStart() { @@ -165,6 +162,11 @@ class SetCategoriesSheet( sheetBehavior.expand() sheetBehavior.skipCollapsed = true updateBottomButtons() + binding.root.post { + binding.categoryRecyclerView.scrollToPosition( + max(0, itemAdapter.adapterItems.indexOf(selectExtension.selectedItems.firstOrNull())) + ) + } } fun updateBottomButtons() {