Fixed initial scroll of categories on SetCategoriesSheet

This commit is contained in:
Jays2Kings 2021-04-09 01:52:41 -04:00
parent 0cfce71266
commit 720a78d968

View File

@ -155,9 +155,6 @@ class SetCategoriesSheet(
) )
} }
) )
binding.categoryRecyclerView.scrollToPosition(
max(0, itemAdapter.adapterItems.indexOf(selectExtension.selectedItems.firstOrNull()))
)
} }
override fun onStart() { override fun onStart() {
@ -165,6 +162,11 @@ class SetCategoriesSheet(
sheetBehavior.expand() sheetBehavior.expand()
sheetBehavior.skipCollapsed = true sheetBehavior.skipCollapsed = true
updateBottomButtons() updateBottomButtons()
binding.root.post {
binding.categoryRecyclerView.scrollToPosition(
max(0, itemAdapter.adapterItems.indexOf(selectExtension.selectedItems.firstOrNull()))
)
}
} }
fun updateBottomButtons() { fun updateBottomButtons() {