From c72041441aed9d4cce3ba79b23c56ac78430692a Mon Sep 17 00:00:00 2001 From: ekibun Date: Fri, 13 Mar 2020 14:02:25 +0800 Subject: [PATCH] fix crash FastScrollRecyclerView#172 --- .../java/soko/ekibun/bangumi/ui/view/FastScrollRecyclerView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/soko/ekibun/bangumi/ui/view/FastScrollRecyclerView.kt b/app/src/main/java/soko/ekibun/bangumi/ui/view/FastScrollRecyclerView.kt index 4e5607e..2e46acc 100644 --- a/app/src/main/java/soko/ekibun/bangumi/ui/view/FastScrollRecyclerView.kt +++ b/app/src/main/java/soko/ekibun/bangumi/ui/view/FastScrollRecyclerView.kt @@ -164,7 +164,7 @@ class FastScrollRecyclerView @JvmOverloads constructor( } ?: adapter.itemCount) if (itemHeightCache.size != itemCount) itemHeightCache = IntArray(itemCount) { itemHeightCache.getOrNull(it) ?: 200 } - + if (itemHeightCache.isEmpty()) return if (layoutManager is LinearLayoutManager) { val firstIndex = layoutManager.findFirstVisibleItemPosition() val lastIndex = layoutManager.findLastVisibleItemPosition()